title: How do you get the value from a data-frame using the index?
body: <p>I have a dataframe:</p>
  
  <pre><code>test      data
   1         11
   1         12
   1         0
   1         15
   1         16
   1         0
  </code></pre>
  
  <p>So here I am trying to get the value which is before the <code>0</code></p>
  
  <pre><code>    zero_indexes = list(input_with[input_with['data'] == 0].index)
      df2 = pd.DataFrame()
      for each_zero_index in zero_indexes:
         value = input_with.loc[each_zero_index - 1: each_zero_index]
          if(value != 0):
                df1 = input_csv.loc[each_zero_index - 3: each_zero_index]
                df2 = df2.append(df1) 
  df2.to_csv('final_2.csv')
  </code></pre>
  
  <p>Here, I am not getting the <code>value</code> as it is only returning <code>df</code>. Can Someone help me with this?</p>