Skip to content
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

IntervalIndex nbytes computation #19209

Closed
TomAugspurger opened this issue Jan 12, 2018 · 1 comment
Closed

IntervalIndex nbytes computation #19209

TomAugspurger opened this issue Jan 12, 2018 · 1 comment
Labels
Interval Interval data type
Milestone

Comments

@TomAugspurger
Copy link
Contributor

Currently, it looks like IntervalIndex.nbytes just uses IndexOpsMixin.nbytes

@property
def nbytes(self):
    """ return the number of bytes in the underlying data """
    return self._values.nbytes

Should it instead be self.left.nbytes + self.right.nbytes? This will be faster, and I think more correct.

@TomAugspurger TomAugspurger added the Interval Interval data type label Jan 12, 2018
@jschendel
Copy link
Member

Should it instead be self.left.nbytes + self.right.nbytes?

That makes more sense to me. Not sure exactly what the use case of nbytes is though, so really just basing this off the docstring description.

TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Apr 4, 2018
Avoid materializing the ndarray of Intervals. Just get from left and right
instead.

Closes pandas-dev#19209
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Apr 4, 2018
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Apr 4, 2018
@jreback jreback added this to the 0.23.0 milestone Apr 14, 2018
@TomAugspurger TomAugspurger modified the milestones: 0.23.0, Next Major Release Apr 23, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Jul 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type
Projects
None yet
Development

No branches or pull requests

3 participants