Skip to content

Conversation

@jbrockmendel
Copy link
Member

No description provided.

@jreback jreback added the Interval Interval data type label Nov 2, 2020
@jreback jreback added this to the 1.2 milestone Nov 2, 2020
@jreback
Copy link
Contributor

jreback commented Nov 2, 2020

any more equals you can remove because of this? (followon)

@jreback jreback merged commit 7d2a794 into pandas-dev:master Nov 2, 2020
@jbrockmendel
Copy link
Member Author

any more equals you can remove because of this? (followon)

Not without API changes, but it may be worthwhile to get these more strict/consistent

@jbrockmendel jbrockmendel deleted the ref-ei-equals branch November 2, 2020 01:12
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
@jbrockmendel
Copy link
Member Author

any more equals you can remove because of this? (followon)

Not without API changes, but it may be worthwhile to get these more strict/consistent

So the least invasive would be CategoricalIndex. Changing it to match this strict version (actually just removing it) breaks 5 tests. Four of these are asserting index.equals(index.astype(object)), which we test for all Index subclasses except IntervalIndex (which suggests IntervalIndex possibly should support this)

The fifth is an indexing test that may indicate a bug elsewhere:

 df = DataFrame(np.random.randn(3, 3), index=list("ABA"), columns=list("XYX")) cdf = df.copy() cdf.index = CategoricalIndex(df.index) cdf.columns = CategoricalIndex(df.columns) exp_index = CategoricalIndex(list("AA"), categories=["A", "B"]) > expect = DataFrame(df.loc["A", :], columns=cdf.columns, index=exp_index) [...] E ValueError: cannot reindex from a duplicate axis 
ukarroum pushed a commit to ukarroum/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Interval Interval data type

2 participants