ENH: df.astype
could accept a dict of {col: type}
#7271
Labels
Milestone
df.astype
could accept a dict of {col: type}
#7271
This would be consistent with other pandas methods.
The reason I'm running into it is having some NaNs scattered across some
int
andbool
columns, which converts to float / objects. If I discard those NaNs, it would be nice to dodf = df.astype({'my_bool', 'bool', 'my_int': 'int'})
instead of
The text was updated successfully, but these errors were encountered: