nickpadd / EuropeanFootballLeaguePredictor

A machine learning/statistical model to derive prediction probabilities for football matches of the top european leagues.
https://nickpadd.github.io/EuropeanFootballLeaguePredictor/Home.html
MIT License
25 stars 4 forks source link

KeyError: "['Result'] not in index" #74

Closed ramsys28 closed 1 week ago

ramsys28 commented 2 weeks ago

Hi there,

I am trying to run the run_udpates and I get this error:

Traceback (most recent call last):
  File "g:\My Drive\33_Upwork\Stoixima\EuropeanFootballLeaguePredictor-master\run_updates.py", line 81, in <module>
    main()
  File "g:\My Drive\33_Upwork\Stoixima\EuropeanFootballLeaguePredictor-master\run_updates.py", line 63, in main
    upcoming_match_scheduler.setup_upcoming_fixtures()
  File "g:\My Drive\33_Upwork\Stoixima\EuropeanFootballLeaguePredictor-master\europeanfootballleaguepredictor\data\upcoming_matches.py", line 134, in setup_upcoming_fixtures
    upcoming_preprocessed_list = preprocessor.preprocessing_pipeline(data = [upcoming_raw_long, upcoming_raw_short])
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "g:\My Drive\33_Upwork\Stoixima\EuropeanFootballLeaguePredictor-master\europeanfootballleaguepredictor\data\preprocessor.py", line 130, in preprocessing_pipeline
    data = self.test_for_nulls(data,  data_status='Raw')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "g:\My Drive\33_Upwork\Stoixima\EuropeanFootballLeaguePredictor-master\europeanfootballleaguepredictor\data\preprocessor.py", line 92, in test_for_nulls
    info_has_nulls = dataframe[info_columns].isnull().any()
                     ~~~~~~~~~^^^^^^^^^^^^^^
  File "C:\Users\mklados\AppData\Roaming\Python\Python311\site-packages\pandas\core\frame.py", line 3899, in __getitem__       
    indexer = self.columns._get_indexer_strict(key, "columns")[1]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mklados\AppData\Roaming\Python\Python311\site-packages\pandas\core\indexes\base.py", line 6114, in _get_indexer_strict
    self._raise_if_missing(keyarr, indexer, axis_name)
  File "C:\Users\mklados\AppData\Roaming\Python\Python311\site-packages\pandas\core\indexes\base.py", line 6178, in _raise_if_missing
    raise KeyError(f"{not_found} not in index")
KeyError: "['Result'] not in index"

Any idea what is it?

ramsys28 commented 2 weeks ago

I noticed that is done only i specifc Leages (like Italy and Germany)

nickpadd commented 2 weeks ago

Will take a look as soon as possible.

nickpadd commented 1 week ago

I am sure I have encountered this error too but I cannot replicate at the moment. I will push the version I am running so you can try and tell me if it is fixed.