I have string None & other string values in dataframe columns, I want to empty all "None" and keep others.
df[['status','Amount']].replace("None", " ",inplace=True)
The "None" still in columns, How can remove them PERMANENTLY? THANK YOU
I have string None & other string values in dataframe columns, I want to empty all "None" and keep others.
df[['status','Amount']].replace("None", " ",inplace=True)
The "None" still in columns, How can remove them PERMANENTLY? THANK YOU
There are a few different ways to do this. I am not sure how the rest of your code looks, but I would do something along the lines of:
d = {'status': statusArray, 'Amount': amountArray}
df = pd.DataFrame(data = d)
df.replace(regex = "None", value = "", inplace = True)
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html this is the reference page for the pandas.DataFrame.replace there are good examples at the bottom for the other ways to do this.