I will like to delete all empty row in a column
prices_dataframe[prices_dataframe['postcode'].isnull()]
This only seems to be showing me the empty rows not deleting it.
I will like to delete all empty row in a column
prices_dataframe[prices_dataframe['postcode'].isnull()]
This only seems to be showing me the empty rows not deleting it.
Is Null only returns the empty rows it does not drop them. Your empty rows should contain NaN so you can use `prices_dataframe.dropna(inplace=True) To drop them.
If your rows don't contain NaN you can first replace the empty rows with NaN
prices_dataframe.replace('', np.nan, inplace=True)
and then drop them
You can use pandas.DataFrame.dropna
or pandas.Series.dropna
for this purpose.
Example for a particular column:
df = df.dropna("postcode")
Example for all columns:
df = df.dropna()