In [1]:
import numpy as np
In [2]:
a = np.genfromtxt('data/src/sample_nan.csv', delimiter=',')
print(a)
In [3]:
print(np.isnan(a))
In [4]:
print(~np.isnan(a))
In [5]:
print(a[~np.isnan(a)])
In [6]:
print(np.isnan(a).any(axis=1))
In [7]:
print(~np.isnan(a).any(axis=1))
In [8]:
print(a[~np.isnan(a).any(axis=1), :])
In [9]:
print(a[~np.isnan(a).any(axis=1)])
In [10]:
print(~np.isnan(a).any(axis=0))
In [11]:
print(a[:, ~np.isnan(a).any(axis=0)])
In [12]:
a = np.genfromtxt('data/src/sample_nan.csv', delimiter=',')
a[2, 2] = np.nan
print(a)
In [13]:
print(a[:, ~np.isnan(a).any(axis=0)])
In [14]:
print(a[:, ~np.isnan(a).all(axis=0)])