Error with Dataframe column mapping for get_playerstats()
cjt243 opened this issue · 6 comments
cjt243 commented
cjt243 commented
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']
j-andrews7 commented
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 ***@***.***> 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
<#5?email_source=notifications&email_token=ACOAQNGFQKFX7DAFHILQZVDRGUUVLA5CNFSM4LEM3642YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOICU7I#issuecomment-596650621>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOAQNDY2GGR7D5C5RGXCYLRGUUVLANCNFSM4LEM364Q>
.
cjt243 commented
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
j-andrews7 commented
This is indeed an oversight for 2P%, 3P%, and FT% metrics. I will push a fix soon.
j-andrews7 commented
This is fixed in a new release, v0.2.1. Thanks for reporting.
cjt243 commented
No problem, glad to help! Love the package btw