解决方法:
- 将
np.isnan
改为pd.isna
例子:
import numpy as np
import pandas as pd
print('Missing: %d' % sum(np.isnan(X).flatten()))
改为:
print('Missing: %d' % sum(pd.isna(X).flatten()))
np.isnan
改为pd.isna
import numpy as np
import pandas as pd
print('Missing: %d' % sum(np.isnan(X).flatten()))
改为:
print('Missing: %d' % sum(pd.isna(X).flatten()))