0

I'm trying to delete empty cells with pandas. I wanna delete only empty cells but I have no idea how to do that.

ex

A B C D E F G H I J
1 apple price 10 quantity 5
2 pineapple price 12 condition good quantity 4

what I want

A B C D E F G H I J
1 apple price 10 quantity 5
2 pineapple price 12 condition good quantity 4

I need all values without empty cells. So I don't want to delete whole row or column. I wanna delete empty cell and pull the values ​​in the back.

Real Data EXCEL

Clyde
  • 11
  • 3
  • 1
    Please share a dataframe - or part of the file you import into pandas using load_csv. this might be as easy as provide some more parameters on load. post a [mre] as well so we see how your df is created. – Patrick Artner Feb 09 '21 at 10:47
  • I shared as image file. Thank you – Clyde Feb 09 '21 at 11:25
  • https://stackoverflow.com/questions/32062157/move-non-empty-cells-to-the-left-in-pandas-dataframe – Patrick Artner Feb 09 '21 at 12:15

1 Answers1

0

I made it with this

Removing nan from pandas dataframe and reshaping dataframe

Keypoint : Change Invalid_val with len of value strings

Clyde
  • 11
  • 3