home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 399316316

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/2191#issuecomment-399316316 https://api.github.com/repos/pydata/xarray/issues/2191 399316316 MDEyOklzc3VlQ29tbWVudDM5OTMxNjMxNg== 1217238 2018-06-22T04:20:48Z 2018-06-22T04:20:48Z MEMBER

shift() is different from resampling, but indeed it looks like we’ll need to add it manually to CFTimeIndex. On Thu, Jun 21, 2018 at 9:12 PM Aidan Heerdegen notifications@github.com wrote:

I'm not sure if my issue belongs in here, but I didn't want to create a new Issue (there are already 455 open ones).

I am experimenting with the new CFTimeIndex functionality (thanks heaps BTW! That was a mammoth effort if the PR thread is anything to go by).

I am trying to shift a time index as I need to align datasets to a common start point. So using the example code above,

da.time.get_index('time').shift(1,'D')---------------------------------------------------------------------------NotImplementedError Traceback (most recent call last)<ipython-input-71-db48b2fbb340> in <module>()----> 1 da.time.get_index('time').shift(1,'D') /g/data3/hh5/public/apps/miniconda3/envs/analysis27-18.04/lib/python2.7/site-packages/pandas/core/indexes/base.pyc in shift(self, periods, freq) 2627 """ 2628 raise NotImplementedError("Not supported for type %s" %-> 2629 type(self).name) 2630 2631 def argsort(self, args, *kwargs):NotImplementedError: Not supported for type CFTimeIndex

Is this not implemented because it might require resampling?

I ask because this works:

times[0] + pd.Timedelta('365 days') cftime.DatetimeNoLeap(2, 1, 1, 0, 0, 0, 0, -1, 1)```

I guess I am asking, if I want to shift a time index is the best (only?) way currently to loop over all the individual elements of the index and add a time offset to each?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/issues/2191#issuecomment-399315302, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKS1vEhsbxVMPJ6nHrwU9BT_AgCLLWlks5t_G6cgaJpZM4UQeax .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  327089588
Powered by Datasette · Queries took 1358.557ms · About: xarray-datasette