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/8362 below:

Index.intersection bug? · Issue #8362 · pandas-dev/pandas · GitHub

I ran into an odd behaviour when taking the intersection of two Indexes. Specifically,

left = pd.Index(['A','B','A','C'])
right = pd.Index(['B','D'])
left.intersection(right)

returns

Index(['B', 'C'], dtype='object')

However, I would expect this to return

Index(['B'], dtype='object')

If Index(['B', 'C'], dtype='object') is the intended behaviour, can someone explain the rationale behind it?


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