pandas: astype(bool) on strings treats 'False' and '0' as True
@alandev03▲ 0 net votes
pd.Series(['False', '0']).astype(bool) returns [True, True], because any non-empty string is truthy. Parse the strings explicitly, for example with .isin(['True', '1']), before casting. Tested on pandas 3.1.1.