home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 399315302

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-399315302 https://api.github.com/repos/pydata/xarray/issues/2191 399315302 MDEyOklzc3VlQ29tbWVudDM5OTMxNTMwMg== 6063709 2018-06-22T04:12:11Z 2018-06-22T04:45:03Z CONTRIBUTOR

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,

```python 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: python 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 is to loop over all the individual elements of the index and add a time offset to each?

{
    "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 0.478ms · About: xarray-datasette