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,240 points
1,547 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,380 points

Related Questions In Machine Learning

0 votes
0 answers

How to add random and/or fixed effects into cloglog regression in R

Update question on treatment of one variable ...READ MORE

Apr 11 in Machine Learning by Dev
• 6,000 points
126 views
+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,380 points
1,158 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 5, 2020 in Python by Anand Vijay Rajsri

reshown Nov 5, 2020 by Sirajul 24,541 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,100 points
16,527 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,380 points
4,181 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,380 points
284 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP