dimanche 17 janvier 2021

How to do Categorical in pandas

I have some table which is look like this :

Cars Purchased Bike 0 0 No 1 1 No 2 2 No 3 1 Yes 4 0 Yes ... ... ... 995 2 Yes 996 0 Yes 997 0 Yes 998 3 No 999 2 Yes

I would like to create two items 0 and 1 from the Cars column 0 = if you dont have car 1= for car owners, no matter how many later, i Want to check if there is some relation between purchased bike and having car. How to do that ? Thanks !

Aucun commentaire:

Enregistrer un commentaire