Im trying to replace an empty string " " in a pandas dataframe column. The dtype of that column is "O". Ive tried using
df[col].replace(" ", np.nan, inplace = True)
However, I get a nonetype object in return or the whole column is erased. I've also tried using
df[col].dropna(axis=0, subset=['CLOSED_TIME'])
I should also mention the column is a bunch of dates/time but not in datetime format. My goal is to fill the empty strings with nan, so that i can run .fillna(0) on the whole dataframe.