You can use the dropna
function along with the axis=1
, how='all'
and inplace=True
parameters to drop columns where all the values are nan. Here's an example:
main.py237 chars10 lines
This will output the following dataframe with only the non-nan columns:
main.py51 chars5 lines
gistlibby LogSnag