home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 369639339

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
369639339 MDU6SXNzdWUzNjk2MzkzMzk= 2481 Implement CFPeriodIndex 81219 closed 0     3 2018-10-12T17:20:04Z 2020-11-02T01:26:48Z 2020-11-02T01:26:48Z CONTRIBUTOR      

A CFPeriodIndex supporting non-standard calendars would be useful to facilitate climate analyses. The use case for me would be to find the start and end date of a resampling group. This is useful to spot missing values in a resampled time series, or to create time_bnds arrays in a netCDF file.

``` import xarray as xr import pandas as pd

cftime = xr.cftime_range(start='2000-01-01', periods=361, freq='D', calendar='360_day') pdtime = pd.date_range(start='2000-01-01', periods=361, freq='D')

cf_da = xr.DataArray(range(361), coords={'time': cftime}, dims='time') pd_da = xr.DataArray(range(361), coords={'time': pdtime}, dims='time')

cf_c = cf_da.resample(time='M').count()

pd_c = pd_da.resample(time='M').count()

cf_p = cf_c.indexes['time'].to_period()

pd_p = pd_c.indexes['time'].to_period()

cf_expected_days_in_group = cf_p.end_time - cf_p.start_time + pd.offsets.Day(1)

pd_expected_days_in_group = pd_p.end_time - pd_p.start_time + pd.offsets.Day(1) ```

Depends on #2191

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2481/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.633ms · About: xarray-datasette