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, 2020 in Machine Learning by akhtar
• 38,210 points
1,050 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, 2020 by MD
• 95,300 points

Related Questions In Machine Learning

+1 vote
1 answer

How to load CNN model in keras?

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

answered May 18, 2020 in Machine Learning by MD
• 95,300 points
787 views
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, 2020 in Machine Learning by MD
• 95,300 points
819 views
0 votes
1 answer

How to save classifier to disk in scikit-learn?

Hi@akhtar, Classifiers are just objects that can be ...READ MORE

answered Jul 14, 2020 in Machine Learning by MD
• 95,300 points
169 views
0 votes
1 answer
+2 votes
2 answers

ImportError: numpy.core.multiarray failed to import

try this... run this code one by one.... pip ...READ MORE

answered Nov 4, 2020 in Python by Anand Vijay Rajsri

reshown Nov 4, 2020 by Sirajul 14,943 views
+2 votes
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
• 58,140 points
11,672 views
0 votes
7 answers
0 votes
1 answer

How to load a model from an HDF5 file in Keras?

Hi@akhtar, If you stored the complete model, not ...READ MORE

answered Jul 14, 2020 in Machine Learning by MD
• 95,300 points
2,305 views
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, 2020 in Machine Learning by MD
• 95,300 points
181 views