Closed cjt243 closed 4 years ago
I added an additional elif to the get_playerstats() function that essentially cleans up the dataframe properly (albeit a bit hacky):
ps_df.columns = ['Rank', 'Player', 'Team', metric.replace('%','M'), metric.replace('%','A'), metric, 'Ht', 'Wt', 'Yr']
Can you give me a reproducible call? I'll take a look at this sometime this week if I get a chance.
On Mon, Mar 9, 2020, 11:56 AM Cullin Tripp notifications@github.com wrote:
I added an additional elif to the get_playerstats() function that essentially cleans up the dataframe properly (albeit a bit hacky): ps_df.columns = ['Rank', 'Player', 'Team', metric.replace('%','M'), metric.replace('%','A'), metric, 'Ht', 'Wt', 'Yr']
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/j-andrews7/kenpompy/issues/5?email_source=notifications&email_token=ACOAQNGFQKFX7DAFHILQZVDRGUUVLA5CNFSM4LEM3642YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOICU7I#issuecomment-596650621, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOAQNDY2GGR7D5C5RGXCYLRGUUVLANCNFSM4LEM364Q .
You should be able to reproduce this:
df = kp.get_playerstats(browser,season=2020,metric='2P')
I get this Traceback (last error):
ValueError: Length mismatch: Expected axis has 9 elements, new values have 7 elements
This is indeed an oversight for 2P%, 3P%, and FT% metrics. I will push a fix soon.
This is fixed in a new release, v0.2.1. Thanks for reporting.
No problem, glad to help! Love the package btw
For 2P, 3P and FT metrics, the column mapping is 7 elements instead of 9.
And missing (2P for example):
So the 2P% is fitting, but the column mapping isn't accounting for attempts and makes.