+ 1

What is wrong with that?

So. I've written a code that create the 'New Column' in my CSV-file. And if the column 'Adult' == 0 the program write down True or False in a CSV-file ( if not Adult == True ). The column "Adult" has 1 if Adult and 0 if not Adult. Please check my profile. There is my code ( the last post ).

5th Jul 2020, 9:42 AM
Mark W.L.
Mark W.L. - avatar
6 odpowiedzi
+ 1
Its throwing a keyerror meaning it doesn't think Adult is a valid column. Can't say forsure without seeing csv. My guess would be capitalization issue. I'd try printing Df.columns.tolist()
6th Jul 2020, 5:48 AM
JME
+ 2
My PyCharm didn't like "New column". So i 've written "New" and this is working now. Idk what is wrong with my PyCharm.
6th Jul 2020, 7:21 AM
Mark W.L.
Mark W.L. - avatar
+ 1
Thank you bro)
6th Jul 2020, 7:10 AM
Mark W.L.
Mark W.L. - avatar
+ 1
May be you have not imported numpy ,pandas and matplotlib or the file is not readable in CSV format.(comma separated value)
6th Jul 2020, 4:59 PM
shubham kumar
shubham kumar - avatar
+ 1
Yeap, exactly
6th Jul 2020, 5:06 PM
Mark W.L.
Mark W.L. - avatar
0
I'm curios, what did the issue turn out to be?
6th Jul 2020, 7:13 AM
JME