title: How to remove '=-inf' from a data frame with Python?
body: <p>I have some files with <code>=-inf</code> cells. I have been trying to remove it with: </p>
  
  <p><code>.replace(np.inf, 0).replace(np.nan,0)</code></p>
  
  <p>However it stays there, I also check if the data frame has any infinity number with:</p>
  
  <p><code>df.isnull().values.any()
  np.all(np.isfinite(df))</code></p>
  
  <p>But none of them finds =-inf or NA. </p>
  
  <p>How could I replace this kind of issue with Python? </p>
  
  <p><a href="https://i.stack.imgur.com/cH5J4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cH5J4.png" alt="enter image description here"></a> </p>
  
  <p><a href="https://i.stack.imgur.com/9Do0G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Do0G.png" alt="enter image description here"></a></p>
  
  <p>EDIT:
  Download the actual csv file here:
  <a href="https://drive.google.com/file/d/1ol_DfiUbkybLx-ksne3rszyODTARzMJM/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1ol_DfiUbkybLx-ksne3rszyODTARzMJM/view?usp=sharing</a></p>
  
  <pre><code>df = pd.read_csv('test.csv')
  labels = np.array(df['class'])
  
  features= df.drop('class', axis = 1)
  feature_list = list(features.columns)
  features = np.array(df)
  
  clf= RandomForestClassifier(n_estimators=100, random_state=20)
  scores = cross_val_score(clf, features, labels, cv=10)
  </code></pre>