Skip to content

Unhelpful exception / bug in ix + MultiIndex use case #709

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

Closed
wesm opened this issue Jan 28, 2012 · 0 comments
Closed

Unhelpful exception / bug in ix + MultiIndex use case #709

wesm opened this issue Jan 28, 2012 · 0 comments
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented Jan 28, 2012

This should work IMHO

In [20]: df
Out[20]: 
       value
   id       
t1 a   1    
   b   2    
   c   3    
t2 a   7    
   b   8    

In [21]: df.ix[:, 'value']
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/<ipython-input-21-7d089958dc90> in <module>()
----> 1 df.ix[:, 'value']

/home/wesm/code/pandas/pandas/core/indexing.pyc in __getitem__(self, key)
     28                 pass
     29 
---> 30             return self._getitem_tuple(key)
     31         else:
     32             return self._getitem_axis(key, axis=0)

/home/wesm/code/pandas/pandas/core/indexing.pyc in _getitem_tuple(self, tup)
     97     def _getitem_tuple(self, tup):
     98         try:
---> 99             return self._getitem_lowerdim(tup)
    100         except IndexingError:
    101             pass

/home/wesm/code/pandas/pandas/core/indexing.pyc in _getitem_lowerdim(self, tup)
    126                 pass
    127             except Exception:
--> 128                 if tup[0] not in ax0:
    129                     raise
    130 

/home/wesm/code/pandas/pandas/core/index.pyc in __contains__(self, key)
    209 
    210     def __contains__(self, key):
--> 211         return key in self._engine
    212 
    213     def __hash__(self):

/home/wesm/code/pandas/pandas/_engines.so in pandas._engines.DictIndexEngine.__contains__ (pandas/src/engines.c:1958)()

TypeError: unhashable type
adamklein added a commit that referenced this issue Jan 30, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Feb 10, 2012
* commit 'v0.7.0rc1-94-ge3df4e2':
  DOC: added info on encoding parameter for csv i/o
  TST: renamed io b/c module conflict, made suite check for config
  added vbench for write csv
  BUG: made encoding optional on csv read/write, addresses pandas-dev#717
  BUG: float64 hash table for handling NAs in Series.unique, close pandas-dev#714
  TST: add bench_unique.py
  TST: added better testing for pandas-dev#709
  BUG: closes pandas-dev#709, bug in ix + multiindex use case
  DOC: release notes
  BUG: don't assume that each object contains every unique block type in concat, GH pandas-dev#708
  BUG: inconsistency in .ix with integer label and float index
  Fix test that assumed py2.
  Don't use unnecessary UnicodeReader on Python 3.
  BUG: remove poor man's breakpoint
  BUG: closes pandas-dev#705, csv is encoded utf-8 and then decoded on the read side
  updated support contact info
  DOC: note EWMA adjustment, closes pandas-dev#703
  ENH: close pandas-dev#694, pandas-dev#693, pandas-dev#692
  BUG: Bar plot fails if axis parameter supplied, closes pandas-dev#702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants