I\'m using Pandas to explore some datasets. I have this dataframe:
I want to exclude any row that has a city value. So I\'ve tried:
new_df =
I hope "where" can do what you expect
where
new_df = new_df.where(new_df["city"], None)
And it is better use np.nan rather than None.
np.nan
None
For more details pandas.DataFrame.where