import pandas as pd
city_temp = pd.read_csv('weather trend/Tokyo_Japan.csv')
city_temp.head()
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 "name 'year' is not defined"
city_temp[year >= 1900 & year <= 1950].avg_temp
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().
city_temp[city_temp.year >= 1900 & city_temp.year <= 1950]. avg_temp
How can I fix this?