Skip to content

API: properly box numeric timedelta ops on Series (GH4984) #4985

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

Merged
merged 1 commit into from
Sep 25, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 25, 2013

closes #4984

@jreback
Copy link
Contributor Author

jreback commented Sep 25, 2013

@cpcloud @jtratner have a look if you would...


# coerce float to results
if is_float(result):
result = int(result)
Copy link
Member

Choose a reason for hiding this comment

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

is the float value here somehow guaranteed to not have a fractional part? seems strange to just smash it to int

Copy link
Member

Choose a reason for hiding this comment

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

ah just read your comment in the issue thread

Copy link
Member

Choose a reason for hiding this comment

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

we'll have to revisit this in the future if a finer timescale is desired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at worse it kills a fractional ns...and that is below our precision anyhow

Copy link
Member

Choose a reason for hiding this comment

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

yep

@cpcloud
Copy link
Member

cpcloud commented Sep 25, 2013

maybe a couple small examples in timeseries.rst? just so that new users are not surprised when they get back an int after computing an average...

@jreback
Copy link
Contributor Author

jreback commented Sep 25, 2013

yep....pusing in a second

jreback added a commit that referenced this pull request Sep 25, 2013
API: properly box numeric timedelta ops on Series (GH4984)
@jreback jreback merged commit d2f95f2 into pandas-dev:master Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency in return value of mean, median, and quantile on timedelta64[ns] series
2 participants