home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 645571138

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/pull/3975#issuecomment-645571138 https://api.github.com/repos/pydata/xarray/issues/3975 645571138 MDEyOklzc3VlQ29tbWVudDY0NTU3MTEzOA== 2448579 2020-06-17T19:17:58Z 2020-06-17T19:17:58Z MEMBER

Looks like an incompatibility with latest pandas

``` ____ TestDataset.test_resample[int-coords] _______

self = <xarray.tests.test_units.TestDataset object at 0x7fa84fb9e490> variant = 'coords', dtype = <class 'int'> return func(all_args, *all_kwargs) xarray/core/common.py:1123: in resample grouper = pd.Grouper(


cls = <class 'pandas.core.groupby.grouper.Grouper'>, args = () kwargs = {'base': 0, 'closed': None, 'freq': '6m', 'label': None, ...} TimeGrouper = <class 'pandas.core.resample.TimeGrouper'>, stacklevel = 2

def __new__(cls, *args, **kwargs):
    if kwargs.get("freq") is not None:
        from pandas.core.resample import TimeGrouper

        # Deprecation warning of `base` and `loffset` since v1.1.0:
        # we are raising the warning here to be able to set the `stacklevel`
        # properly since we need to raise the `base` and `loffset` deprecation
        # warning from three different cases:
        #   core/generic.py::NDFrame.resample
        #   core/groupby/groupby.py::GroupBy.resample
        #   core/groupby/grouper.py::Grouper
        # raising these warnings from TimeGrouper directly would fail the test:
        #   tests/resample/test_deprecated.py::test_deprecating_on_loffset_and_base

        # hacky way to set the stacklevel: if cls is TimeGrouper it means
        # that the call comes from a pandas internal call of resample,
        # otherwise it comes from pd.Grouper
        stacklevel = 4 if cls is TimeGrouper else 2
        if kwargs.get("base", None) is not None:
          warnings.warn(
                "'base' in .resample() and in Grouper() is deprecated.\n"
                "The new arguments that you should use are 'offset' or 'origin'.\n"
                '\n>>> df.resample(freq="3s", base=2)\n'
                "\nbecomes:\n"
                '\n>>> df.resample(freq="3s", offset="2s")\n',
                FutureWarning,
                stacklevel=stacklevel,
            )

E FutureWarning: 'base' in .resample() and in Grouper() is deprecated. E The new arguments that you should use are 'offset' or 'origin'. E
E >>> df.resample(freq="3s", base=2) E
E becomes: E
E >>> df.resample(freq="3s", offset="2s") ```

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