1 Answers1

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.

  1. In case your data have infinity values, you can replace them first by using data = data.replace([np.inf, -np.inf], np.nan)
  2. Then you need to either drop the rows which contain NaN values using data = data.dropna(), or fill NaN values with 0, mean or median value of your data with data = data.fillna()

For further information, you can check this link.

Chris
  • 11
  • 2