Skip to main content

types

We can view and inspect types of a dataframe with:

ds.dtypes

In order to change a column to a categoric type we can do:

ds['column_name'] = ds['column_name'].astype('category', categories=['good', 'very good', 'excellent'])