issues: 110737724
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
110737724 | MDU6SXNzdWUxMTA3Mzc3MjQ= | 616 | Support arithmetic with pandas.Timedelta objects | 1217238 | closed | 0 | 2 | 2015-10-09T21:19:56Z | 2019-02-02T06:25:54Z | 2019-02-02T06:25:54Z | MEMBER | This currently doesn't work, as reported in #615: ``` python from datetime import datetime, timedelta import xray import pandas as pd a = xray.Dataset({'time': [datetime(2000, 1, 1)]}) a['time'] -= pd.to_timedelta(timedelta(hours=6)) ``` ```TypeError Traceback (most recent call last) <ipython-input-7-655c9cabcf6d> in <module>() 4 5 a = xray.Dataset({'time': [datetime(2000, 1, 1)]}) ----> 6 a['time'] -= pd.to_timedelta(timedelta(hours=6)) /Users/shoyer/dev/xray/xray/core/dataarray.pyc in func(self, other) 1089 other_variable = getattr(other, 'variable', other) 1090 with self.coords._merge_inplace(other_coords): -> 1091 f(self.variable, other_variable) 1092 return self 1093 return func /Users/shoyer/dev/xray/xray/core/variable.pyc in func(self, other) 797 raise ValueError('dimensions cannot change for in-place ' 798 'operations') --> 799 self.values = f(self_data, other_data) 800 return self 801 return func TypeError: ufunc subtract cannot use operands with types dtype('<M8[ns]') and dtype('O') ``` We could fix this by adding some sort of coercion logic into |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/616/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |