home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

10 rows where issue = 241714748 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • snowman2 6
  • fmaussion 4

author_association 2

  • CONTRIBUTOR 6
  • MEMBER 4

issue 1

  • Selecting time with different variable and dimensions names · 10 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
314167150 https://github.com/pydata/xarray/issues/1474#issuecomment-314167150 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2NzE1MA== snowman2 8699967 2017-07-10T16:53:25Z 2017-07-10T16:53:25Z CONTRIBUTOR

@fmaussion, thanks again for your time!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314162736 https://github.com/pydata/xarray/issues/1474#issuecomment-314162736 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2MjczNg== snowman2 8699967 2017-07-10T16:38:39Z 2017-07-10T16:38:39Z CONTRIBUTOR

Which is what I think you do in salem.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314162500 https://github.com/pydata/xarray/issues/1474#issuecomment-314162500 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2MjUwMA== snowman2 8699967 2017-07-10T16:37:56Z 2017-07-10T16:37:56Z CONTRIBUTOR

Oh, and to make the time slice work for WRF, I had to make the time variables consistent: python xds.rename( { time_dim: 'time', time_var: 'time', }, inplace=True )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314162435 https://github.com/pydata/xarray/issues/1474#issuecomment-314162435 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2MjQzNQ== fmaussion 10050469 2017-07-10T16:37:45Z 2017-07-10T16:37:45Z MEMBER

In this case, I don't know the name if the dimension beforehand

Yes, in this case definitely a good use case for a dict and .loc

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314162219 https://github.com/pydata/xarray/issues/1474#issuecomment-314162219 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2MjIxOQ== snowman2 8699967 2017-07-10T16:36:53Z 2017-07-10T16:36:53Z CONTRIBUTOR

OK. That is good to know. In this case, I don't know the name if the dimension beforehand, so I thought it might be preferable to do:

python data = data.loc[{self.lsm_time_dim: [pd.to_datetime(time_step)]}] instead of: python data = data.sel(**{self.lsm_time_dim: [pd.to_datetime(time_step)]}) What are your thoughts?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314161175 https://github.com/pydata/xarray/issues/1474#issuecomment-314161175 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE2MTE3NQ== fmaussion 10050469 2017-07-10T16:33:05Z 2017-07-10T16:33:05Z MEMBER

I personally very much prefer the readability of .sel and .isel, which is what I teach to my students.

I don't know however what's most used amongst other xarray users

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314159012 https://github.com/pydata/xarray/issues/1474#issuecomment-314159012 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE1OTAxMg== snowman2 8699967 2017-07-10T16:25:20Z 2017-07-10T16:25:20Z CONTRIBUTOR

OK. I feel silly now. I thought I should have been using loc[] Thanks @fmaussion for that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314152374 https://github.com/pydata/xarray/issues/1474#issuecomment-314152374 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE1MjM3NA== fmaussion 10050469 2017-07-10T16:02:48Z 2017-07-10T16:02:48Z MEMBER

have you tried the way it is done in the docs?

http://xarray.pydata.org/en/latest/indexing.html#indexing-with-labeled-dimensions

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748
314151625 https://github.com/pydata/xarray/issues/1474#issuecomment-314151625 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDE1MTYyNQ== snowman2 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
}
  Selecting time with different variable and dimensions names 241714748
314112894 https://github.com/pydata/xarray/issues/1474#issuecomment-314112894 https://api.github.com/repos/pydata/xarray/issues/1474 MDEyOklzc3VlQ29tbWVudDMxNDExMjg5NA== fmaussion 10050469 2017-07-10T13:55:41Z 2017-07-10T13:55:41Z MEMBER

Somewhat not a direct answer to your question, but I see you are reading in WRF files. Have you considered using Salem's open_wrf_dataset on your files? It will solve some time related issues that these files have

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Selecting time with different variable and dimensions names 241714748

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 12.083ms · About: xarray-datasette