title: ValueError:Input contains NaN, infinity or a value too large for dtype('float64') even when isnan and isinf are false and dtype=float64
body: <p>My code is to analyze the <strong>PUBG</strong> dataset from kaggle and make a model. I have extracted all the features and <strong>Standardised</strong> them using <strong>StandardScaler</strong> from <strong>sklearn</strong>. </p>
  
  <pre><code>//Snippet
  
  X=standardized_data
  y=training_features_output
  X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.30,random_state=42)
  print(standardized_data.shape,training_features_output.shape)
  </code></pre>
  
  <blockquote>
    <p>[Output]: (4446966, 16) (4446966,)</p>
  </blockquote>
  
  <pre><code>print(np.all(np.isinf(standardized_data)))
  print(np.all(np.isinf(training_features_output)))
  print(np.all(np.isnan(standardized_data)))
  print(np.all(np.isnan(training_features_output)))
  </code></pre>
  
  <blockquote>
    <p>[Output]:<br> False <br>
    False<br>
    False<br>
    False<br></p>
  </blockquote>
  
  <pre><code>print(X.dtype)
  print(y.dtype)
  </code></pre>
  
  <blockquote>
    <p>[Output]:<br> dtype('float64')<br>dtype('float64')</p>
  </blockquote>
  
  <pre><code>model=LinearRegression()
  model.fit(X_train,y_train)
  y_train_pred=model.predict(X_train)
  y_test_pred=model.predict(X_test)
  print('Train r2_accuracy:',r2_score(y_train,y_train_pred))
  print('Test r2_accuracy:',r2_score(y_test,y_test_pred))
  </code></pre>
  
  <blockquote>
    <p>ValueError: Input contains NaN, infinity or a value too large for dtype('float64').<br><br>
    <a href="https://i.stack.imgur.com/RnIFa.png" rel="nofollow noreferrer">error photo</a><br>
    <a href="https://drive.google.com/drive/folders/1O8I_I_TKyxGrO3ycAlQ6x_ztnYIqzB_b?usp=sharing" rel="nofollow noreferrer">Full Code</a></p>
  </blockquote>
  
  <p>From the above outputs we can see that they are no <strong>nan</strong> and <strong>infinite</strong> values in the dataset and also the data is in <strong>float64</strong>. but how am I getting this error and how to resolve it?<br>
  Tried other queries regarding this on stackoverflow all were having nan or something messed up and I dont know where is this code messing up.</p>