-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
API DesignDeprecateFunctionality to remove in pandasFunctionality to remove in pandasIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
Ilustration:
idx = pd.Index(['a', 'b', 'c', 'd'])
idx - ['a', 'd']
idx - pd.Index(['a', 'd'])
gives:
In [1]: idx = pd.Index(['a', 'b', 'c', 'd'])
In [2]: idx - ['a', 'd']
Out[2]: Index([u'b', u'c'], dtype='object')
In [3]: idx - pd.Index(['a', 'd'])
c:\users\vdbosscj\scipy\pandas-joris\pandas\core\index.py:1192: FutureWarning: u
sing '-' to provide set differences with Indexes is deprecated, use .difference(
)
"use .difference()",FutureWarning)
Out[3]: Index([u'b', u'c'], dtype='object')
So a list is treated a an index-like (as it performs a set operation), but does not raise a warning as it should (the same for arrays, series).
We have an occurrence in the docs of this one.
Metadata
Metadata
Assignees
Labels
API DesignDeprecateFunctionality to remove in pandasFunctionality to remove in pandasIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves