home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1480964097

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/7662#issuecomment-1480964097 https://api.github.com/repos/pydata/xarray/issues/7662 1480964097 IC_kwDOAMm_X85YRbgB 43635101 2023-03-23T10:44:26Z 2023-03-23T10:46:22Z NONE

Idk if this comes from xarray, pandas seems to have the same behaviour:

```python import xarray as xr import pandas as pd import numpy as np

time = pd.date_range("2000-01-01", "2022-01-01", freq="1h") ds = xr.Dataset({"time": time, "v": ("time",np.random.rand(len(time)))}) ds

df = ds.to_dataframe() df = df[df.index.month.isin([6,7,8])] df.groupby(pd.Grouper(freq="D")).mean()

               v

time
2000-06-01 0.451577 2000-06-02 0.524039 2000-06-03 0.540553 2000-06-04 0.537686 2000-06-05 0.521928 ... ... 2021-08-27 0.441088 2021-08-28 0.473274 2021-08-29 0.455666 2021-08-30 0.559104 2021-08-31 0.424167

[7762 rows x 1 columns] ```

You can select your months after performing aggregation and you will have the correct number of rows

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