Apr-18-2023, 01:07 PM
There is some weird multi-indexing thing going on with 2013.
If you look at the list of index values you'll see that 2013 is suspiciously absent even though it appears in the dataframe when printed.
If you look at the list of index values you'll see that 2013 is suspiciously absent even though it appears in the dataframe when printed.
Output:Index(['2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022',
'Career', '7 yrs', '2 yrs', '1 yr'],
dtype='object')
Year Age Tm Pos No. G GS Pnt Yds Y/P RetYds Net NY/P Lng TB TB% In20 In20% Blck AV
2013 23 DET P 6 16 0 72 3399 47.2 250 2949 41.0 72 10 13.9% 22 30.6% 1 3
2014 24 DET P 6.0 16 0.0 68 3138 46.1 311 2727 40.1 71 5 7.4% 29 42.6% 0 3
2015 25 DET P 6.0 16 0.0 80 3679 46.0 263 3356 42.0 66 3 3.8% 25 31.3% 0 3
. . .
Then printed a row.Output:df.loc['2017']
Year 2013
Age 23 27
Tm DET DET
Pos P P
This series has 2 rows. The year, and 2013. If I print the '2022' row I see the same thing. The 2022 year values and the 2013 values.Output:df.loc['2022']
Year 2013
Age 23 32
Tm DET BUF
Pos P P
Why this is happening is beyond my scope. I looked at the web page, but it is too complicated for me to understand how the tables are created and why they are messing up the dataframe