1#return a subset of the dataframe where the column name value != NaN
2df.loc[df['column name'].isnull() == False]
1In [30]: df.dropna(subset=[1]) #Drop only if NaN in specific column (as asked in the question)
2Out[30]:
3 0 1 2
41 2.677677 -1.466923 -0.750366
52 NaN 0.798002 -0.906038
63 0.672201 0.964789 NaN
75 -1.250970 0.030561 -2.678622
86 NaN 1.036043 NaN
97 0.049896 -0.308003 0.823295
109 -0.310130 0.078891 NaN
11
1a = [[y for y in x if pd.notna(y)] for x in df.values.tolist()]
2print (a)
3[['str', 'aad', 'asd'], ['ddd'], ['xyz', 'abc'], ['btc', 'trz', 'abd']]
4