Skip to content

ENH/CLN: support enhanced timedelta64 operations/conversions #4822

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 4 commits into from
Sep 12, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 12, 2013

closes .#3577
realted #3009

  • ENH: add top-level to_timedelta to convert string/integer to timedeltas
  • TST: add pandas/tseries/tests/test_timedeltas.py
  • API: add full timedelta parsing and conversion to np.timedelta64[ns]
  • CLN: refactored locations of timedeltas to core/tseries/timedeltas (from a series of functions in core/common)
  • ENH: support timedelta64[ns] as a serialization type in HDFStore for query and append (GH3577)

@jreback
Copy link
Contributor Author

jreback commented Sep 12, 2013

@cpcloud @jtratner comments?

@@ -1719,6 +1736,8 @@ def convert(self, values, nan_rep, encoding):
else:
self.data = np.asarray(self.data, dtype='M8[ns]')

elif dtype == u('timedelta64'):
Copy link
Contributor

Choose a reason for hiding this comment

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

does it matter to compare to unicode? (I honestly don't know...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually it does because the data is stored as bytes (and reconverted) in read back by pytables (I think)
these are comparing vs stored data

@jreback
Copy link
Contributor Author

jreback commented Sep 12, 2013

@cpcloud this ended up morphing...but now have to_timedelta top-level function....pretty nice if I do say so myself!

@cpcloud
Copy link
Member

cpcloud commented Sep 12, 2013

All of the experimentalists using pandas will now be chomping at the bit for TimedeltaIndex. You've teased them with a to_timedelta!

One does not simply ....

implement to_timedelta without TimedeltaIndex

😄

@jreback
Copy link
Contributor Author

jreback commented Sep 12, 2013

hah...I just returned a Series, easier (and pretty close actually)

@jreback
Copy link
Contributor Author

jreback commented Sep 12, 2013

TimedeltaIndex is for you!

jreback added a commit that referenced this pull request Sep 12, 2013
ENH/CLN: support enhanced timedelta64 operations/conversions
@jreback jreback merged commit 2f24d6e into pandas-dev:master Sep 12, 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.

3 participants