1

I have a data frame which looks like below :-

leftmost side of the df:- enter image description here

rightmost side of the df :- enter image description here

I want to filter row index where none of the columns are blank. I have row index and column index and don't have the column names. I can't rename it because i have two different values in it and i want to rename after filtering.

I am not aware of how to do it so i don't have any code which i have tried.

  • It is best in this type of question to create a small sample dataframe with expected outcome... See this [SO Post](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – Scott Boston Nov 19 '18 at 14:23
  • I think `df = df.dropna(axis=1)` should working. – jezrael Nov 19 '18 at 14:23
  • 1
    How about you just do `df.dropna()` – yatu Nov 19 '18 at 14:23
  • none @jezrael that is dropping all the columns where value is –  Nov 19 '18 at 15:21
  • @AlexandreNixon that works i dont why i didnt think of this simple method but i want to make two df one is with none of the value is null and the other is the remianing value –  Nov 19 '18 at 15:22
  • 1
    @ScottBoston i will keep that in mind from next time. –  Nov 19 '18 at 15:22
  • 1
    df[df.isnull().any(axis=1)] will be the answer – ak3191 Nov 19 '18 at 15:38
  • @ak3191 thanks a lot this is thing what i was looking for. –  Nov 19 '18 at 15:39

0 Answers0