0

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.

Dera
  • 13
  • 2

2 Answers2

0

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

Niko
  • 144
  • 8
0

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()
Imperial_J
  • 306
  • 1
  • 7
  • 23