Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a league crashes #80

Open
PatWekan opened this issue Apr 5, 2024 · 0 comments
Open

Creating a league crashes #80

PatWekan opened this issue Apr 5, 2024 · 0 comments

Comments

@PatWekan
Copy link

PatWekan commented Apr 5, 2024

As pointed by other earlier, creating the league crashes

/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
Exception in thread Thread-1 (_submit_task):
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/frame.py", line 12304, in _reindex_for_setitem
reindexed_value = value.reindex(index)._values
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/series.py", line 4977, in reindex
return super().reindex(
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/generic.py", line 5521, in reindex
return self._reindex_axes(
^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/generic.py", line 5544, in _reindex_axes
new_index, indexer = ax.reindex(
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 4437, in reindex
target = self._wrap_reindex_result(target, indexer, preserve_names)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/indexes/multi.py", line 2602, in _wrap_reindex_result
target = MultiIndex.from_tuples(target)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/indexes/multi.py", line 220, in new_meth
return meth(self_or_cls, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/indexes/multi.py", line 615, in from_tuples
arrays = list(lib.tuples_to_object_array(tuples).T)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib.pyx", line 2977, in pandas._libs.lib.tuples_to_object_array
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/Users/xxx/Downloads/ProphitBet-Soccer-Bets-Predictor-main/gui/task.py", line 35, in _submit_task
self._result = self._task(*self._args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxxx/Downloads/ProphitBet-Soccer-Bets-Predictor-main/database/repositories/league.py", line 77, in create_league
df = self._download_league_data(league_config=league_config, year_start=league_config.league.year_start)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/Downloads/ProphitBet-Soccer-Bets-Predictor-main/database/repositories/league.py", line 69, in _download_league_data
df = stats_engine.compute_statistics(matches_df=df, features=league_config.features)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxxx/Downloads/ProphitBet-Soccer-Bets-Predictor-main/preprocessing/statistics.py", line 132, in compute_statistics
self._statistic_featurescol
File "/Users/xxxx/Downloads/ProphitBet-Soccer-Bets-Predictor-main/preprocessing/statistics.py", line 36, in compute_home_wins
matches_df['HW'] = self._compute_last_results(matches_df=matches_df, team_column='Home Team', result='H')
~~~~~~~~~~^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/frame.py", line 4091, in setitem
self._set_item(key, value)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/frame.py", line 4300, in _set_item
value, refs = self._sanitize_column(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/frame.py", line 5036, in _sanitize_column
return _reindex_for_setitem(value, self.index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/core/frame.py", line 12311, in _reindex_for_setitem
raise TypeError(
TypeError: incompatible index of inserted column with frame index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant