Created
May 10, 2020 04:49
-
-
Save Ken-Kuroki/2576ec5ca4c6dac37a593ac51ecda574 to your computer and use it in GitHub Desktop.
Find rows containing nan or inf
This file contains 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
import pandas as pd | |
import numpy as np | |
df = pd.DataFrame([[1.,2.,np.nan,np.inf],[1.,2.,3.,4.,]]).T | |
df[np.isnan(df).any(axis=1) | np.isinf(df).any(axis=1)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment