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

Pandas deprecation error #9

Closed
mirix opened this issue Jul 28, 2022 · 1 comment
Closed

Pandas deprecation error #9

mirix opened this issue Jul 28, 2022 · 1 comment

Comments

@mirix
Copy link

mirix commented Jul 28, 2022

I have installed Macest in an ad hoc Anaconda environment to make sure all the requirements meet the exact version required. This includes pandas==1.0.3

However, I am not able to make it work with Pandas dataframes due to a deprecation error:

File "test_macest.py", line 48, in
macest_model.fit(X_cal, y_cal)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/macest/classification/models.py", line 397, in fit
train_helper.fit(optimiser_args=optimiser_args)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/macest/classification/models.py", line 625, in fit
point_preds[conflicts] == self.y_cal[conflicts]
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/series.py", line 910, in getitem
return self._get_with(key)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/series.py", line 943, in _get_with
return self.loc[key]
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/indexing.py", line 1768, in getitem
return self._getitem_axis(maybe_callable, axis=axis)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/indexing.py", line 1954, in _getitem_axis
return self._getitem_iterable(key, axis=axis)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/indexing.py", line 1595, in _getitem_iterable
keyarr, indexer = self._get_listlike_indexer(key, axis, raise_missing=False)
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/indexing.py", line 1552, in _get_listlike_indexer
self._validate_read_indexer(
File "/home/mirix/anaconda3/envs/macest/lib/python3.8/site-packages/pandas/core/indexing.py", line 1654, in _validate_read_indexer
raise KeyError(
KeyError: 'Passing list-likes to .loc or [] with any missing labels is no longer supported, see https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike'

@mirix
Copy link
Author

mirix commented Jul 28, 2022

It works if the dataframes are converted to numpy arrays.

@mirix mirix closed this as completed Jul 28, 2022
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