issue_comments: 458101606
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/2688#issuecomment-458101606 | https://api.github.com/repos/pydata/xarray/issues/2688 | 458101606 | MDEyOklzc3VlQ29tbWVudDQ1ODEwMTYwNg== | 6628425 | 2019-01-28T11:50:21Z | 2019-01-28T11:50:21Z | MEMBER | The issue seems to stem from the fact that the In the case of a DatetimeIndex, In [2]: times = pd.date_range('2000', periods=3) In [3]: series = pd.Series([0., np.nan, 1.], index=times) In [4]: times.get_value(series, [True, False, True])TypeError Traceback (most recent call last) ~/pandas/pandas/core/indexes/base.py in get_value(self, series, key) 4290 return self._engine.get_value(s, k, -> 4291 tz=getattr(series.dtype, 'tz', None)) 4292 except KeyError as e1: ~/pandas/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value() ~/pandas/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value() ~/pandas/pandas/_libs/index.pyx in pandas._libs.index.DatetimeEngine.get_loc() TypeError: During handling of the above exception, another exception occurred: InvalidIndexError Traceback (most recent call last) <ipython-input-7-1b8f8313de2a> in <module> ----> 1 times.get_value(series, [True, False, True]) ~/pandas/pandas/core/indexes/datetimes.py in get_value(self, series, key) 934 935 try: --> 936 return com.maybe_box(self, Index.get_value(self, series, key), 937 series, key) 938 except KeyError: ~/pandas/pandas/core/indexes/base.py in get_value(self, series, key) 4310 if is_scalar(key): # pragma: no cover 4311 raise IndexError(key) -> 4312 raise InvalidIndexError(key) 4313 4314 def set_value(self, arr, key, value): InvalidIndexError: [True, False, True]
@shoyer do you think you might have a recommendation here? Does either one of those options make sense, or might there be an alternative? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
400504690 |