numpy remove columns containing nan

Solutions on MaxInterview for numpy remove columns containing nan by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "numpy remove columns containing nan"
Finn
02 May 2017
1a = a[~(np.isnan(a).any(axis=0))] # removes columns containing at least one nan
2a = a[~(np.isnan(a).all(axis=0))] # removes columns containing all nan
3
4