pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

Salaries.csv missing from core

Open lyledanley opened this issue 3 years ago • 1 comments

The code calls from the core folder, and the Salaries.csv file is actually in contrib.

lyledanley avatar Mar 17 '22 18:03 lyledanley

I am having this same issue too; how do we modify the function salaries() so that it relooks in the contrib directory?

Thanks in advance

eric8395 avatar Aug 08 '22 18:08 eric8395

Not a fix but a work around, on Windows the files were downloaded to: C:/Users/<USERNAME>/.pybaseball/cache/baseballdatabank-master/ where you have your contrib and core directories. I moved the salaries.csv file from the contrib directory into the core directory and it worked fine for me on 2.2.1

schottcr avatar Nov 11 '22 00:11 schottcr

This doesn't seem to be an issue any longer.

In lahman.py: def salaries() -> pd.DataFrame: return _get_file("contrib/Salaries.csv")

from pybaseball.lahman import * salaries = salaries() print(salaries) yearID teamID lgID playerID salary 0 1985 ATL NL barkele01 870000 1 1985 ATL NL bedrost01 550000 2 1985 ATL NL benedbr01 545000 3 1985 ATL NL campri01 633333 4 1985 ATL NL ceronri01 625000 ... ... ... ... ... ... 26423 2016 WAS NL strasst01 10400000 26424 2016 WAS NL taylomi02 524000 26425 2016 WAS NL treinbl01 524900 26426 2016 WAS NL werthja01 21733615 26427 2016 WAS NL zimmery01 14000000

[26428 rows x 5 columns]

Close?

bryanpeabody avatar Feb 07 '23 15:02 bryanpeabody

Yep. Solved in #251. The lingering issue was a result of updated versions not being added to pypi, but that's been sorted now. Closing.

tjburch avatar Feb 13 '23 01:02 tjburch