I have a pandas dataframe with boolean values, i.e.
col1 col2
1 True False
2 False True
3 True True
when I use pandas' DataFrame.to_csv method, the resulting dataframe looks like
,col1,col2
1,True,False
2,False,True
3,True,True
is there a way to write the boolean variables as 1s and 0s (more space-efficient), i.e.
,col1,col2
1,1,0
2,0,1
3,1,1
without having to cast the entire dataframe first?