I am trying to slice the value corresponding to the Year 2010 but I get an error message I can not explain.
df1
GDP USA_GDP_Deflator
Year
2005 14408093840400 90.877573
2006 14792303791800 93.669574
2007 15055395304800 96.162437
2008 15011490541400 98.048771
2009 14594842181900 98.793388
2010 14964372000000 100.000000
2011 15204019634600 102.064628
2012 15542161722300 103.944710
2013 15802855301300 105.623425
2014 16208861247400 107.519021
df1.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 10 entries, 2005 to 2014
Data columns (total 2 columns):
GDP 10 non-null int64
USA_GDP_Deflator 10 non-null float64
dtypes: float64(1), int64(1)
memory usage: 240.0 bytes
df1[2010]
KeyError: 2010
Your advice will be appreciated.