A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/10038 below:

No deprecation warning raised for index

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4