Skip to content

RangeIndex not generated with pd.concat with ignore_index as True #12695

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

Closed
AnkurDedania opened this issue Mar 22, 2016 · 2 comments
Closed

RangeIndex not generated with pd.concat with ignore_index as True #12695

AnkurDedania opened this issue Mar 22, 2016 · 2 comments
Labels
Enhancement Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@AnkurDedania
Copy link

With version 0.18.0 introducing RangeIndex, should RangeIndex be applied for concat when ignore_index is set to True?

df = pd.concat([df_a, df_b], ignore_index=True)

df.index is an instance of Int64Index, not RangeIndex currently in 0.18.0

@jreback
Copy link
Contributor

jreback commented Mar 22, 2016

yes this should be here as well. pull-requests welcome.

@jreback jreback added Enhancement Indexing Related to indexing on series/frames, not to indexes themselves Difficulty Novice labels Mar 22, 2016
@jreback jreback added this to the 0.18.1 milestone Mar 22, 2016
@jreback
Copy link
Contributor

jreback commented Mar 22, 2016

make sure tests are of the form: assert_frame_equal(resut, expected, check_index_type=True) (otherwise defaults to an 'equiv' comparison, which doesnt distinguish between Int64 and equiv RangeIndex.

In fact that is how to find differences in the test suite (to look for cases where we could/should be returning a RangeIndex but are currently not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
2 participants