Asked
Active
Viewed 58 times
1 Answers
0
Most likely your data contain empty values, which will be represented as NaN
(Not a Number) by pandas. So you need to preprocess your data.
- In case your data have infinity values, you can replace them first by using
data = data.replace([np.inf, -np.inf], np.nan)
- Then you need to either drop the rows which contain
NaN
values usingdata = data.dropna()
, or fill NaN values with 0, mean or median value of your data withdata = data.fillna()
For further information, you can check this link.

Chris
- 11
- 2