Let me explain a bit better my problem.
I have a .csv that contains columns with 'False'
or 'True'
and others with 'true'
and 'false'
(note the presence of capital letters or not).
I'm ok with pandas read_csv
function converting the first ones directly to Python boolean True
and False
.
However, I want to keep 'true'
and 'false'
as strings but they are converted to Python boolean True
and False
.
Is there a way to keep them as strings ?
I know about true_values
optional keyword to add values to consider as True but it adds values, and not replaces values to consider True.
If come accross this other StackOverlow post but can't apply it to my problem as I want some columns with True
and some with 'true'
and the only way to know which columns needs to be a string or not is to read the data (but it is converted thus this post).
Thanks in advance for any help,