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

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

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

Comments

Projects
None yet
2 participants
@AnkurDedania

AnkurDedania commented Mar 22, 2016

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

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Mar 22, 2016

Contributor

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

Contributor

jreback commented Mar 22, 2016

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

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Mar 22, 2016

Contributor

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).

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