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

icol([0]) fails with non-unique, integer columns #2259

Closed
ghost opened this issue Nov 15, 2012 · 1 comment
Closed

icol([0]) fails with non-unique, integer columns #2259

ghost opened this issue Nov 15, 2012 · 1 comment
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 15, 2012

In [14]: df=pd.DataFrame([[1,2,3],[4,5,6]],columns=[1,1,2])

In [15]: df.icol([0])
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-15-bb76389fbd62> in <module>()
----> 1 df.icol([0])

/home/user1/src/pandas/pandas/core/frame.pyc in icol(self, i)
   1877             return self[name]
   1878         raise AttributeError("'%s' object has no attribute '%s'" %
-> 1879                              (type(self).__name__, name))
   1880 
   1881     def __setattr__(self, name, value):

/home/user1/src/pandas/pandas/core/frame.pyc in reindex(self, index, columns, method, level, fill_value, limit, copy)
   2503             necessary. Setting to False will improve the performance of this
   2504             method
-> 2505 
   2506         Examples
   2507         --------

/home/user1/src/pandas/pandas/core/frame.pyc in _reindex_columns(self, new_columns, copy, level, fill_value, limit)
   2590             levels are named. If None then the index name is repeated.
   2591 
-> 2592         Returns
   2593         -------
   2594         resetted : DataFrame

/home/user1/src/pandas/pandas/core/index.pyc in reindex(self, target, method, level, limit)
    870         if self._join_precedence < other._join_precedence:
    871             how = {'right': 'left', 'left': 'right'}.get(how, how)
--> 872             result = other.join(self, how=how, level=level,
    873                                 return_indexers=return_indexers)
    874             if return_indexers:

/home/user1/src/pandas/pandas/core/index.pyc in get_indexer(self, target, method, limit)
    789         is_contained : ndarray (boolean dtype)
    790         """
--> 791         value_set = set(values)
    792         return lib.ismember(self._array_values(), value_set)
    793 

Exception: Reindexing only valid with uniquely valued Index objects
@ghost
Copy link
Author

ghost commented Dec 10, 2012

bump

@wesm wesm closed this as completed in 25d522c Dec 14, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Dec 20, 2012
* commit 'v0.10.0b1-51-gbbe2fc1': (518 commits)
  BLD: add patsy, numexpr to ci/print_versions.py
  BUG: fix DataFrame.icol with list of integers when columns are integers with duplicates. close pandas-dev#2259
  TST: unit test to assert behavior described in pandas-dev#2525
  BUG: compat OrderedDict import for python 2.6
  DOC: Emphazise that cython is needed when installing from the repo in install.rst
  BLD: document pytz as a hard dependency
  BUG: import OrderedDict from util.compat for 2.6
  BUG: df.from_dict should respect OrderedDict 2517
  start date -> 7/1/12
  ENH: vbench support for HDFStore      added benchmarchs to compare (100,000) rows:        read/write store        read/write store mixed        read/write table        read/write table wide (200 columns)        read/write table mixed        query wide/table
  TST: refactoring to speed up test suite
  BUG: more floating point error robustness in rolling mean. close pandas-dev#2527
  BUG: fix python 3 zip usage
  DOC: updated HDFStore docs for indexing support and better explanations on how to deal with strings in indexables/values
  ENH: allow index recreation by calling create_table_index with new parameters
  BUG: fixed versioning of the data, not reporting correct warnings
  BUG: fixed string appending when length of subsequent is longer/shorter that existing      removed meta data saving      disable memory tests (and put a try:except: around it)
  DOC: small doc change w.r.t. min_itemsize
  BUG: fixed string truncation in values by passing min_itemsize = { 'values' : 1024 }
  BUG: non-datetime indicies were not being handled correctly in searchings (via Terms)       added support for integer, float, date
  ...
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

1 participant