Last active
June 24, 2023 13:59
-
-
Save trcook/cf7789f4bd88bff246936d16f22e91bf to your computer and use it in GitHub Desktop.
strip nan values from pandas data frame by rows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msk=dat.apply(pd.isnull).apply(sum,1)<=0 | |
dat.loc[msk,:] | |
# to drop missing values by cols: | |
msk=dat.apply(pd.isnull).apply(sum,0)<=0 | |
dat.loc[:,msk] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tasty