How can I convert an object dtype structure to a string dtype? The method below is not working and the column remains object after converting to a string with .astype
import pandas as pd
df = pd.DataFrame({'country': ['A', 'B', 'C', 'D', 'E']})
df.dtypes
#country object
#dtype: object
df['county'] = df['country'].astype(str)
df.dtypes
#country object
#dtype: object
pandas V 1.0introducedStringDtype- check the docs for more info on dtypes.