Skip to content

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

@baronet2

Description

@baronet2

Discussed in #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:

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 <module>
    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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions