title: IndexError: index 164 is out of bounds for axis 1 with size 164
body: <p>I try to drop columns and rows, and reset columns and rows after it. But on the third file, I get error:</p>
  
  <blockquote>
    <p>IndexError: index 164 is out of bounds for axis 1 with size 164</p>
  </blockquote>
  
  <p>Files in my folder are <code>167*164</code> and, after dropping, are becoming <code>95*95</code>.</p>
  
  <pre><code>path = r'/home/RESULTS'
  allFiles = sorted((glob.glob(path + "/*.csv")))
  for file_ in allFiles:
      data = pd.read_csv(file_, header=None)
      data = data.astype(str)
      data = data.apply(lambda x: x.str.replace(',', '.'))
      data = data.astype(float)
      data = data.fillna(value=1)
      data.drop(data.columns[cols_to_drop],axis=1,inplace=True)
      data.drop(data.index[rows_to_drop], inplace=True)
      data = data.reset_index(drop=True)
      data = data.T.reset_index(drop=True).T
      print(file_)
  </code></pre>