vaastav / Fantasy-Premier-League

Creates a .csv file of all players in the English Player League with their respective team and total fantasy points
Other
1.45k stars 812 forks source link

Error on running `python teams_scraper.py` #34

Closed freanuperiaa closed 4 years ago

freanuperiaa commented 4 years ago

Hi! So our team is working on a project, and we're trying out your scraping tool.

when we ran the python3 teams_scraper.py 4583 on the terminal, it returned an error.

Traceback (most recent call last): File "teams_scraper.py", line 27, in <module> main() File "teams_scraper.py", line 22, in main parse_entry_leagues(personal_data, output_folder) File "/home/freanu/dav.io/Fantasy-Premier-League/parsers.py", line 72, in parse_entry_leagues cup_leagues_df = pd.DataFrame.from_records(data["leagues"]["cup"]) File "/home/freanu/py_envs/fntsy-premier-lg/lib/python3.7/site-packages/pandas/core/frame.py", line 1652, in from_records mgr = arrays_to_mgr(arrays, arr_columns, result_index, columns) File "/home/freanu/py_envs/fntsy-premier-lg/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 77, in arrays_to_mgr index = extract_index(arrays) File "/home/freanu/py_envs/fntsy-premier-lg/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 372, in extract_index "Mixing dicts with non-Series may lead to ambiguous ordering." ValueError: Mixing dicts with non-Series may lead to ambiguous ordering.

also debugged it, saw that on line 72, maybe the datatype of the data that's to be made as a Dataframe causes the error?

Hope you could help, thanks

vaastav commented 4 years ago

This was because FPL changed the data format for the cup matches. This is fixed now.