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,260 points
2,413 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,460 points

Related Questions In Machine Learning

0 votes
1 answer

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

The standard glm function can be used ...READ MORE

answered Apr 13, 2022 in Machine Learning by anonymous
639 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,460 points
1,808 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 36,017 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
18,586 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,460 points
6,258 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,460 points
686 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