scikit-spectra
scikit-spectra copied to clipboard
bool indexing doesn't work
aunps[aunps > 5]
but no prob w/ aunps.data[aunps.data > 5]. Traceback seems like this is a pandas error!
need subclass dataframe...
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-68-69ec731c29d2> in <module>()
----> 1 aunps[aunps > 5]
/home/adam/Desktop/pyuvvis/pyuvvis/core/spectra.pyc in __getitem__(self, keyslice)
1473 point we just want to return that.'''
1474
-> 1475 dfout = self._frame.__getitem__(keyslice)
1476
1477 if isinstance(dfout, Series):
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pandas/core/frame.pyc in __getitem__(self, key)
1676 return self._getitem_multilevel(key)
1677 else:
-> 1678 return self._getitem_column(key)
1679
1680 def _getitem_column(self, key):
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pandas/core/frame.pyc in _getitem_column(self, key)
1683 # get column
1684 if self.columns.is_unique:
-> 1685 return self._get_item_cache(key)
1686
1687 # duplicate columns & possible reduce dimensionaility
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pandas/core/generic.pyc in _get_item_cache(self, item)
1050 res = cache.get(item)
1051 if res is None:
-> 1052 values = self._data.get(item)
1053 res = self._box_item_values(item, values)
1054 cache[item] = res
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pandas/core/internals.pyc in get(self, item, fastpath)
2562 if self.items.is_unique:
2563
-> 2564 if not isnull(item):
2565 loc = self.items.get_loc(item)
2566 else:
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pandas/core/generic.pyc in __nonzero__(self)
690 raise ValueError("The truth value of a {0} is ambiguous. "
691 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
--> 692 .format(self.__class__.__name__))
693
694 __bool__ = __nonzero__
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().