랭귀지/pandas
bool 결측치 처리
유키공
2025. 2. 4. 10:53
df['bool_col'] = df['bool_col'].astype(str).str.lower().eq('true')
df['bool_col'] = df['bool_col'].fillna(False).astype(str).str.lower().eq('true')
df['bool_col'] = df['bool_col'].map(lambda x: x is True)