Searched and tried several answers here on SO, but they are all for returning rows with NaN's. I'd like to return only the columns with NaN values. For example the following df. How can I select columns 'A' and 'LG'?
df = pd.DataFrame(
{'H': ['a','b', 'c'],
'A': [np.nan,'d', 'e'],
'LG':['AR1', 'RO1', np.nan],
})
print(df)
A H LG
0 NaN a AR1
1 d b RO1
2 e c NaN