How to convert categorical variable into dummy variable

0 votes

Hi Guys,

I am trying to create one Machine Learning model . But my dataset contains one string column that contains categorical values. I want to convert these string values into dummy variable. How can I do that? 

May 7, 2020 in Machine Learning by akhtar
• 38,240 points
6,265 views

1 answer to this question.

0 votes

Hi@akhtar,

You can do this task using pandas module. Pandas has a function named get_dummies. It will convert your categorical string values into dummy variables. You can use this module as given bellow.

import pandas as pd
pd.get_dummies(name of categorical column)

Hope this will help.

answered May 7, 2020 by MD
• 95,340 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
17 views
0 votes
1 answer

How to compare expected and predicted values?

The predict() function returns a plain numpy ...READ MORE

answered Jul 14, 2019 in Machine Learning by Tina
6,532 views
+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
6,933 views
0 votes
0 answers

How to know if a problem is solvable by machine learning?

I have recently started learning the machine. ...READ MORE

Nov 21, 2019 in Machine Learning by Hannah
• 18,570 points
324 views
0 votes
1 answer

Python : Cannot Import Data using Pandas

So< if your error says: ...READ MORE

answered Dec 7, 2018 in Data Analytics by Upasana
• 8,620 points
4,420 views
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

not able to see all columns and rows of a pandas DataFrame?

Hi@akhtar, Your data set contains lots of rows ...READ MORE

answered Apr 8, 2020 in Machine Learning by MD
• 95,340 points
3,236 views
0 votes
1 answer

How to convert 1D array into 2D array using pandas?

Hi@akhtar, You can follow the below given codes to ...READ MORE

answered May 8, 2020 in Machine Learning by MD
• 95,340 points
3,602 views
0 votes
1 answer

How to save machine learning model?

Hi@akhtar, To save your Machine Learning model, you ...READ MORE

answered Apr 13, 2020 in Machine Learning by MD
• 95,340 points
387 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP