title: SMOTE oversampling ValueError: Input contains NaN, infinity or a value too large for dtype('float64'
body: <p>I am trying to oversample my dataset before training but i get this error &quot;ValueError: Input contains NaN, infinity or a value too large for dtype('float64'&quot; even though there are no NAN values.</p>
  <p>This is the code that gives the error</p>
  <pre><code>sm = SMOTE(random_state=42)
  X_res, y_res = sm.fit_resample(X, y)
  y_res = pd.DataFrame(y_res)
  print(y_res[0].value_counts())
  </code></pre>
  <p>This is the error i get</p>
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-18-001a5445f47a&gt; in &lt;module&gt;()
    1 sm = SMOTE(random_state=42)
  ----&gt; 2 X_res, y_res = sm.fit_resample(X, y)
    3 y_res = pd.DataFrame(y_res)
    4 print(y_res[0].value_counts())
  
  3 frames
  /usr/local/lib/python3.7/dist-packages/sklearn/utils/validation.py in _assert_all_finite(X, 
  allow_nan, msg_dtype)
  114             raise ValueError(
  115                 msg_err.format(
  --&gt; 116                     type_err, msg_dtype if msg_dtype is not None else X.dtype
  117                 )
  118             )
  
  ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
  </code></pre>