Skip to content

Fix #12695 : RangeIndex generated with pd.concat with ignore_index as True #12696

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
wants to merge 3 commits into from
Closed

Conversation

AnkurDedania
Copy link

@AnkurDedania AnkurDedania commented Mar 22, 2016

Replaced generated indexes with RangeIndex, test still needed

@@ -1079,8 +1079,7 @@ def _get_concat_axis(self):
if self.axis == 0:
indexes = [x.index for x in self.objs]
elif self.ignore_index:
idx = Index(np.arange(len(self.objs)))
idx.is_unique = True # arange is always unique
idx = RangeIndex(len(self.objs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use com._default_index(...) (you can create above and use in the comparison as well)

@jreback
Copy link
Contributor

jreback commented Mar 22, 2016

tests! always start with the tests to make sure it fails first!

@jreback jreback added Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 22, 2016
@jreback
Copy link
Contributor

jreback commented Apr 1, 2016

  • needs some tests (use the one from the original issue)
  • whatsnew entry (bug fix)

@sinhrks
Copy link
Member

sinhrks commented Apr 10, 2016

Thanks for the PR:) But I've included the fix in #12846 to refactor existing code. Pls lmk if anything.

@jreback jreback closed this in c03f545 Apr 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RangeIndex not generated with pd.concat with ignore_index as True
3 participants