I use Pandas to handle my data. I tried using the reconstruction measures in skcosmo.metrics
on this data, and I got the following error:
>>> res = GRE(X, y)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-20-49fdd3baf61d> in <module>
----> 1 res = GRE(X, y)
~/.local/lib/python3.8/site-packages/skcosmo-0.1.0rc2-py3.8.egg/skcosmo/metrics/_reconstruction_measures.py in pointwise_global_reconstruction_error(X, Y, train_idx, test_idx, scaler, estimator)
84 )
85 X_train, X_test, Y_train, Y_test = (
---> 86 X[train_idx],
87 X[test_idx],
88 Y[train_idx],
/usr/local/lib/python3.8/dist-packages/pandas/core/frame.py in __getitem__(self, key)
3028 if is_iterator(key):
3029 key = list(key)
-> 3030 indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
3031
3032 # take() does not accept boolean indexers
/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py in _get_listlike_indexer(self, key, axis, raise_missing)
1264 keyarr, indexer, new_indexer = ax._reindex_non_unique(keyarr)
1265
-> 1266 self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
1267 return keyarr, indexer
1268
/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py in _validate_read_indexer(self, key, indexer, axis, raise_missing)
1306 if missing == len(indexer):
1307 axis_name = self.obj._get_axis_name(axis)
-> 1308 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
1309
1310 ax = self.obj._get_axis(axis)
KeyError: "None of [Int64Index([7244, 6396, 8502, 7776, 8453, 3175, 3288, 4566, 9549, 8645,\n ...\n 2898, 7536, 1362, 3751, 2530, 5451, 4733, 6878, 5054, 2796],\n dtype='int64', length=5110)] are in the [columns]"
[-]
res = GRE(X.to_numpy(), y.to_numpy())
I don't know if Pandas is going to be supported, but until then it might be helpful to mention this limitation in the documentation.