home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 314151625

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/1474#issuecomment-314151625 https://api.github.com/repos/pydata/xarray/issues/1474 314151625 MDEyOklzc3VlQ29tbWVudDMxNDE1MTYyNQ== 8699967 2017-07-10T16:00:11Z 2017-07-10T16:02:35Z CONTRIBUTOR

I am having the same issue with a completely different grid: <xarray.DataArray 'sp' (time: 72, latitude: 5, longitude: 4)> dask.array<getitem, shape=(72, 5, 4), dtype=float64, chunksize=(24, 5, 4)> Coordinates: * longitude (longitude) float32 248.0 248.25 248.5 248.75 * latitude (latitude) float32 40.75 40.5 40.25 40.0 39.75 * time (time) datetime64[ns] 2016-01-02 2016-01-02T01:00:00 ... Attributes: units: Pa long_name: Surface pressure standard_name: surface_air_pressure Error: ``` self = DatetimeIndex(['2016-01-02 00:00:00', '2016-01-02 01:00:00', '2016-01-02 02:00:00', '2016-01-02 03:00:0...:00:00', '2016-01-04 22:00:00', '2016-01-04 23:00:00'], dtype='datetime64[ns]', freq=None) key = array(Timestamp('2016-01-02 00:00:00'), dtype=object)

def __getitem__(self, key):
    """
        This getitem defers to the underlying array, which by-definition can
        only handle list-likes, slices, and integer scalars
        """

    is_int = is_integer(key)
    if is_scalar(key) and not is_int:
        raise ValueError

    getitem = self._data.__getitem__
    if is_int:
        val = getitem(key)
        return self._box_func(val)
    else:
        if com.is_bool_indexer(key):
            key = np.asarray(key)
            if key.all():
                key = slice(0, None, None)
            else:
                key = lib.maybe_booleans_to_slice(key.view(np.uint8))

        attribs = self._get_attributes_dict()

        is_period = isinstance(self, ABCPeriodIndex)
        if is_period:
            freq = self.freq
        else:
            freq = None
            if isinstance(key, slice):
                if self.freq is not None and key.step is not None:
                    freq = key.step * self.freq
                else:
                    freq = self.freq

        attribs['freq'] = freq
      result = getitem(key)

E IndexError: arrays used as indices must be of integer (or boolean) type

../../../tethys/miniconda/envs/gssha/lib/python3.6/site-packages/pandas/core/indexes/datetimelike.py:296: IndexError ```

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