Closed
Description
This would be consistent with other pandas methods.
The reason I'm running into it is having some NaNs scattered across some int
and bool
columns, which converts to float / objects. If I discard those NaNs, it would be nice to do
df = df.astype({'my_bool', 'bool', 'my_int': 'int'})
instead of
df['my_bool'] = df.my_bool.astype('bool')
df['my_int'] = df.my_int.astype('int')