I have a dataframe like this labeled by year:
I would like to change these ints
to strs
because they are actually categorical variables. However, this is the result:
X_train['YrSold'] = X_train['YrSold'].apply(str)
I would prefer to get rid of all those \n
's automatically in the .apply(str)
process, as opposed to postprocessing each column via regex. Seems like the latter would have more room for error.
Solution was astype(str)
instead of apply(str)