Skip to content

availability of nanosecond periods in DatetimeIndex #1812

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
wuan opened this issue Aug 26, 2012 · 2 comments · Fixed by #3060
Closed

availability of nanosecond periods in DatetimeIndex #1812

wuan opened this issue Aug 26, 2012 · 2 comments · Fixed by #3060
Labels
Datetime Datetime data dtype Enhancement Frequency DateOffsets
Milestone

Comments

@wuan
Copy link
Contributor

wuan commented Aug 26, 2012

Hi there,

when trying to create a DatetimeIndex for data sampled in the nanosecond range

pd.DatetimeIndex(start=pd.Timestamp('2012-12-01'), periods=10, freq=pd.offsets.Nano(2800))

there appears an error due to an uninitialized timestamp.

Inside the pandas code python datetime objects seem to be used for time representation of "slower" than nanosecond times, whereas the nanosecond period seems to appear as a simple int objects which cannot be handled by the internal arithmetics at the moment.

Is there a plan to switch to nanosecond aware time objects internally? As I would like to use this great library for fast data as well I can also offer to help working on that.

Best regards
Andreas

@changhiskhan
Copy link
Contributor

Hi Andreas, we'd love to get your contribution on getting the nano second offsets to play nicer. There are a number of places where the internal arithmetic would have to change to handle the nano-second delta, some of which needs to be in the cython code.
Please take a look and let us know if it's something you'd have time to work on. A PR would be very welcome.

@wuan
Copy link
Contributor Author

wuan commented Sep 4, 2012

Hi,

in the meantime there is a working version of nanosecond period in my branch. Unfortunately getting a sub-second frequency string like freq='2800N' to work required some kind of rework of src/period.c which is still work in progress.

Yes, I would be glad to contribute to the project.

Regards
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Enhancement Frequency DateOffsets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants