How to add one new column in an existing dataset?

0 votes

Hi Guys,

I have my data set to create Machine Learning model. But I want to add one new column at the beginning of my data set. How can I do that? 

Apr 17 in Machine Learning by akhtar
• 10,580 points
18 views

1 answer to this question.

0 votes

Hi@akhtar,

You can do this task using numpy module. For that first convert your column in an array as follows.

import numpy as np
b = np.array(column)

Now you can append your column with previous data.

new_data = np.append(arr=b, values=previous_data, axix=1/0)

Here axis=0 means row wise append and axis=1 means column wise append.

answered Apr 17 by MD
• 23,050 points

Related Questions In Machine Learning

0 votes
1 answer

How to save CNN model in keras?

Hi@akhtar, You can save your CNN model in keras. For ...READ MORE

answered May 19 in Machine Learning by MD
• 23,050 points
28 views
0 votes
1 answer
+1 vote
1 answer

how to analysis the heatmap to find the correlation

Hi @Vikas, there are 5 simple steps ...READ MORE

answered Sep 30, 2019 in Machine Learning by Vishal
1,134 views
0 votes
1 answer
+1 vote
3 answers

Problem with installation of Wordcloud in anaconda

Using Anaconda Python 3.6 version For Windows ...READ MORE

answered Aug 7, 2018 in Data Analytics by Priyaj
• 57,530 points
6,889 views
0 votes
7 answers
0 votes
1 answer

How to import one Machine Learning model?

Hi@akhtar, To import one pre-created ML model, you ...READ MORE

answered Apr 13 in Machine Learning by MD
• 23,050 points
44 views
0 votes
1 answer

How to load CNN model in keras?

Hi@akhtar, You can load your pre-created model in ...READ MORE

answered May 18 in Machine Learning by MD
• 23,050 points
74 views