ValueError: Input contains NaN, infinity or a value too large for dtype('float32'). site:stackoverflow.com
np.all(np.isfinite(mat))
ValueError: Input contains NaN, infinity or a value too large for dtype('float32'). site:stackoverflow.com
np.all(np.isfinite(mat))
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
# Loads your dataset, drops labels and response variable as usual...
df = pd.read_csv('train_test.csv', sep=',')
X = df.drop(["label_1","label_2","response_var"], axis=1)
y = df['response_var']
# this will print TRUE or FALSE for positions containing or not NaN
# values in your dataset
print(np.isnan(X))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us