title: Dropping rows in pandas with .index
body: <p>I came across the below line of code, which gives an error when '.index' is not present in it.</p>
  
  <pre><code>print(df.drop(df[df['Quantity'] == 0].index).rename(columns={'Weight': 'Weight (oz.)'}))
  </code></pre>
  
  <p>What is the purpose of '.index' while using drop in pandas?</p>