I tried to encode columns as categories.
I can not work on my data frame because all columns are dtypes: object.
My code is:
categorize_column = lambda x: x.astype('category')
df.columns = df.columns.apply(categorize_column, axis=0)
I get an error:
'function' object has no attribute 'columns'
df.apply(categorize_column, axis=0)type(df)? Maybe you accidentally assigned a function to the variable namedf.