baronet2 / FirstCyclingAPI

An unofficial Python API wrapper for firstcycling.com
https://firstcyclingapi.readthedocs.io/en/latest/
MIT License
25 stars 3 forks source link

KeyError: "None of ['Information'] are in the columns" #18

Closed baronet2 closed 2 years ago

baronet2 commented 2 years ago

Discussed in https://github.com/baronet2/FirstCyclingAPI/discussions/17

Originally posted by **bfransol** June 4, 2022 Hello, I'm currently trying to use this repository for my studies, however I get the following error whent trying to retreive data from Rider. code: ```python from first_cycling_api import Rider roglic = Rider(16672) print(roglic.best_results()) ``` error: ``` Traceback (most recent call last): File "C:/Users/2de Master/Predictive and Prescriptive Analytics/FirstCyclingAPI-main/ExtractData.py", line 10, in print(roglic.best_results()) File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\rider\rider.py", line 43, in best_results return self._get_endpoint(high=1) File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\objects.py", line 25, in _get_endpoint return endpoint(response) File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\endpoints.py", line 39, in __init__ self._parse_result() File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\endpoints.py", line 43, in _parse_result self._parse_soup() File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\rider\endpoints.py", line 25, in _parse_soup self._get_sidebar_details() File "C:\Users\2de Master\Predictive and Prescriptive Analytics\FirstCyclingAPI-main\first_cycling_api\rider\endpoints.py", line 44, in _get_sidebar_details details = pd.Series(details_df.set_index('Information')['Information.1']) File "C:\Users\anaconda3\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper return func(*args, **kwargs) File "C:\Users\anaconda3\lib\site-packages\pandas\core\frame.py", line 5451, in set_index raise KeyError(f"None of {missing} are in the columns") KeyError: "None of ['Information'] are in the columns" ``` I was wondering if someone could help me out with it. Thanks in advance!