title: Reset indexes of a pandas dataframe to start from zero
body: <p>I'm slicing a dataframe with shape of <code>(10, 8004)</code> to smaller pieces with shape of (58, 10), to be able to plot them (it also needs to be transposed before plotted). <code>n_samples = 58</code>.</p>
  
  <p>The problem is after slicing the index of the smaller pieces doesn't start from zero and the plots have big empty spaces. I tried to reset the index using different methods but all of them failed. Can someone help me to find the correct way of doing that? </p>
  
  <p>Here is some of I tried:</p>
  
  <pre><code>for i in range(0, 138):
      sliced_df = df.iloc[:, range(i*n_samples, (i+1)*n_samples)]
      if i != 0:
         sliced_df = sliced_df.rename(index=int, columns=range(0, n_samples))
      sliced_df.T.plot(kind='line', alpha=0.5, zorder=1, label='')
  </code></pre>
  
  <p>Here is tried to use <code>reindex_axis</code></p>
  
  <pre><code>for i in range(0, 138):
     sliced_df = df.iloc[:, range(i*n_samples, (i+1)*n_samples)].reindex_axis(range(0,n_samples), axis=1).T
     sliced_df.plot(kind='line', alpha=0.5, zorder=1, label='')
  </code></pre>
  
  <p>Also tried <code>reset_index(drop=True)</code>:</p>
  
  <pre><code>for i in range(0, 138):
     sliced_df = df.iloc[:, range(i*n_samples, (i+1)*n_samples)].reset_index(drop=True).T
     sliced_df.plot(kind='line', alpha=0.5, zorder=1, label='') 
  </code></pre>