jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.19k stars 324 forks source link

Salaries.csv missing from core #254

Closed lyledanley closed 1 year ago

lyledanley commented 2 years ago

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

eric8395 commented 1 year ago

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

schottcr commented 1 year ago

Not a fix but a work around, on Windows the files were downloaded to: C:/Users//.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

bryanpeabody commented 1 year ago

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?

tjburch commented 1 year ago

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.