user2808117
user2808117

Reputation: 4897

How to reset a pandas dataframe data types to default or auto detect?

Is it possible to reset a dataframe dtypes to default or auto detected ones (e.g., to detect and match strings and numbers) after they have been set manually? If so how?

Upvotes: 0

Views: 3156

Answers (1)

Andy Hayden
Andy Hayden

Reputation: 375685

A possibility is to use convert_objects:

Attempt to infer better dtype for object columns

This will work well e.g. if you've made it of object dtype, but this certainly isn't a magic bullet.

Upvotes: 1

Related Questions