title: How can I extract specific year range in the table?
body: <pre><code>import pandas as pd
  city_temp = pd.read_csv('weather trend/Tokyo_Japan.csv')
  city_temp.head()
  </code></pre>
  <p>Then I want to extract the specific range of year like between 1900-1950.
  so I used this code like below and I got an error saying &quot;name 'year' is not defined&quot;</p>
  <pre><code>city_temp[year &gt;= 1900 &amp; year &lt;= 1950].avg_temp
  </code></pre>
  <p>plus I tried this code and got an valuerror 'The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  <pre><code>city_temp[city_temp.year &gt;= 1900 &amp; city_temp.year &lt;= 1950]. avg_temp
  </code></pre>
  <p>How can I fix this?</p>