Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
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 (1 point)

1 Answer

+3 votes

Good find! We initially used something very similar

answered by (1 point)