---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
//anaconda3/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)
//anaconda3/lib/python3.7/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
//anaconda3/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
ModuleNotFoundError: No module named 'pandas._libs.pandas'
During handling of the above exception, another exception occurred:
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-294-acb4781ec768> in <module>
3 predictor = DetectorRecommender(k=k)
4 predictor.fit(X_train)
----> 5 X_pred = predictor.predict(X_test)
6 print(k, mean_squared_error(X_true, X_pred))
<ipython-input-283-ed69ee6e949e> in predict(self, df)
60
61 # Extract just the non-z kinematic values for the eval planes
---> 62 det_eval_values = self.extract_values_at_eval_planes(X_pred, eval_planes)
63
64 return det_eval_values
<ipython-input-283-ed69ee6e949e> in extract_values_at_eval_planes(self, pred, planes)
74 X = pred.copy(deep=True)
75 X['eval_plane'] = planes
---> 76 retvals = X.apply(lambda x: self.get_vals_at_plane(x, x['eval_plane']), axis=1)
77 retvals_df = pd.DataFrame(retvals.values.tolist(), columns=self.kinematics)
78 return retvals_df
//anaconda3/lib/python3.7/site-packages/pandas/core/frame.py in apply(self, func, axis, broadcast, raw, reduce, result_type, args, **kwds)
6485 args=args,
6486 kwds=kwds)
-> 6487 return op.get_result()
6488
6489 def applymap(self, func):
//anaconda3/lib/python3.7/site-packages/pandas/core/apply.py in get_result(self)
149 return self.apply_raw()
150
--> 151 return self.apply_standard()
152
153 def apply_empty_result(self):
//anaconda3/lib/python3.7/site-packages/pandas/core/apply.py in apply_standard(self)
255
256 # compute the result using the series generator
--> 257 self.apply_series_generator()
258
259 # wrap results
//anaconda3/lib/python3.7/site-packages/pandas/core/apply.py in apply_series_generator(self)
284 try:
285 for i, v in enumerate(series_gen):
--> 286 results[i] = self.f(v)
287 keys.append(v.name)
288 except Exception as e:
<ipython-input-283-ed69ee6e949e> in <lambda>(x)
74 X = pred.copy(deep=True)
75 X['eval_plane'] = planes
---> 76 retvals = X.apply(lambda x: self.get_vals_at_plane(x, x['eval_plane']), axis=1)
77 retvals_df = pd.DataFrame(retvals.values.tolist(), columns=self.kinematics)
78 return retvals_df
<ipython-input-283-ed69ee6e949e> in get_vals_at_plane(self, row, plane)
80 def get_vals_at_plane(self, row, plane):
81 cols = [i + str(int(plane)) for i in self.kinematics]
---> 82 return row[cols].values
83
84 def get_eval_detector_plane(self, row):
//anaconda3/lib/python3.7/site-packages/pandas/core/series.py in __getitem__(self, key)
909 key = check_bool_indexer(self.index, key)
910
--> 911 return self._get_with(key)
912
913 def _get_with(self, key):
//anaconda3/lib/python3.7/site-packages/pandas/core/series.py in _get_with(self, key)
949 # handle the dup indexing case (GH 4246)
950 if isinstance(key, (list, tuple)):
--> 951 return self.loc[key]
952
953 return self.reindex(key)
//anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in __getitem__(self, key)
1498
1499 maybe_callable = com.apply_if_callable(key, self.obj)
-> 1500 return self._getitem_axis(maybe_callable, axis=axis)
1501
1502 def _is_scalar_access(self, key):
//anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in _getitem_axis(self, key, axis)
1900 raise ValueError('Cannot index with multidimensional key')
1901
-> 1902 return self._getitem_iterable(key, axis=axis)
1903
1904 # nested tuple slicing
//anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in _getitem_iterable(self, key, axis)
1203 # A collection of keys
1204 keyarr, indexer = self._get_listlike_indexer(key, axis,
-> 1205 raise_missing=False)
1206 return self.obj._reindex_with_indexers({axis: [keyarr, indexer]},
1207 copy=True, allow_dups=True)
//anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in _get_listlike_indexer(self, key, axis, raise_missing)
1152 if len(ax) or not len(key):
1153 key = self._convert_for_reindex(key, axis)
-> 1154 indexer = ax.get_indexer_for(key)
1155 keyarr = ax.reindex(keyarr)[0]
1156 else:
//anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_indexer_for(self, target, **kwargs)
4453 """
4454 if self.is_unique:
-> 4455 return self.get_indexer(target, **kwargs)
4456 indexer, _ = self.get_indexer_non_unique(target, **kwargs)
4457 return indexer
//anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_indexer(self, target, method, limit, tolerance)
2716 def get_indexer(self, target, method=None, limit=None, tolerance=None):
2717 method = missing.clean_reindex_fill_method(method)
-> 2718 target = ensure_index(target)
2719 if tolerance is not None:
2720 tolerance = self._convert_tolerance(tolerance, target)
//anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py in ensure_index(index_like, copy)
5362 index_like = list(index_like)
5363
-> 5364 converted, all_arrays = lib.clean_index_list(index_like)
5365
5366 if len(converted) > 0 and all_arrays:
pandas/_libs/lib.pyx in pandas._libs.lib.clean_index_list()
pandas/_libs/lib.pyx in pandas._libs.lib.infer_dtype()
//anaconda3/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)
KeyboardInterrupt: