I have a data frame with many null records:
Col_1 Col_2 Col_3
10 5 2
22 7 7
3 9 5
4 NaN NaN
5 NaN NaN
6 4 NaN
7 6 7
8 10 NaN
12 NaN 1
I want to remove all NaN values in all rows of columns . As you could see, each column has different number of rows. So, I want to get something like this:
Col_1 Col_2 Col_3
10 5 2
22 7 7
3 9 5
4 4 7
6 6 1
7 10
8
12
I tried
filtered_df = df.dropna(how='any')
But it removes all records in the dataframe. How may I do that ?