Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+10 votes

In the csv files, boolean values can appear as TRUE/FALSE, which look like strings, but they are actually evaluated as boolean values when you read csv with pandas. I came up with this yesterday when I was trying to do this: df.replace({ 'TRUE': 1, 'FALSE': 0}) but it didn't work. The fix was df.replace({ True: 1, False: 0})

asked in CSC320 by (8 points)

1 Answer

+3 votes

Good find! We initially used something very similar

answered by (1.2k points)