home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

17 rows where user = 3621629 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 8

  • Rank Methods 4
  • pandas casting issues 4
  • Behavior of dataarray with no dimensions 2
  • Stack() & unstack() issues on Multindex 2
  • ENH: str accessor 2
  • Rank function 1
  • Dropping values along multidimensions 1
  • BUG: fix safe_cast_to_index 1

user 1

  • 0x0L · 17 ✖

author_association 1

  • CONTRIBUTOR 17
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
709313477 https://github.com/pydata/xarray/issues/2933#issuecomment-709313477 https://api.github.com/repos/pydata/xarray/issues/2933 MDEyOklzc3VlQ29tbWVudDcwOTMxMzQ3Nw== 0x0L 3621629 2020-10-15T13:09:18Z 2020-10-15T13:09:18Z CONTRIBUTOR

You could do it by creating a flatten view of the underlying numpy array, building the multiindex manually and creating a new DataArray from the view and the multiindex.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Stack() & unstack() issues on Multindex 438947247
500109150 https://github.com/pydata/xarray/pull/2991#issuecomment-500109150 https://api.github.com/repos/pydata/xarray/issues/2991 MDEyOklzc3VlQ29tbWVudDUwMDEwOTE1MA== 0x0L 3621629 2019-06-08T09:10:38Z 2019-06-08T09:10:38Z CONTRIBUTOR

@shoyer it should be all good now

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: str accessor 448478648
499598244 https://github.com/pydata/xarray/pull/3001#issuecomment-499598244 https://api.github.com/repos/pydata/xarray/issues/3001 MDEyOklzc3VlQ29tbWVudDQ5OTU5ODI0NA== 0x0L 3621629 2019-06-06T17:47:36Z 2019-06-06T17:47:36Z CONTRIBUTOR

@spencerkclark Are you ok with keeping the len > 0 test and then just moving up the assert at the top of the constructor of CFTimeIndex so that we raise before allocating the memory with result._data = np.array(data, dtype='O')

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  BUG: fix safe_cast_to_index 452734140
499285779 https://github.com/pydata/xarray/issues/2834#issuecomment-499285779 https://api.github.com/repos/pydata/xarray/issues/2834 MDEyOklzc3VlQ29tbWVudDQ5OTI4NTc3OQ== 0x0L 3621629 2019-06-05T22:56:00Z 2019-06-05T22:58:18Z CONTRIBUTOR

Hello @maxdow

I'm not sure I understand your issue correctly. If all you want is to keep only the points time, lat, lon for which t and/or dd is not NA you can simply use ```python z = d.stack(index=d.dims).dropna('index', how='all')

<xarray.Dataset> Dimensions: (index: 346) Coordinates: * index (index) MultiIndex - time (index) datetime64[ns] 2019-03-09 2019-03-09 ... 2019-03-09 - lat (index) float64 43.5 43.5 43.5 43.75 43.75 ... 45.0 45.0 45.5 45.5 - lon (index) float64 1.25 1.5 4.25 1.75 2.25 ... 1.75 2.0 4.0 1.5 2.0 Data variables: t (index) float64 0.6184 0.2966 1.426 0.8666 ... 0.09348 1.271 1.353 dd (index) float64 2.075 1.174 0.906 0.6451 ... 0.3491 0.1789 0.8922 You still have access to the coordinates of the valid points through `z.time`, `z.lat` and `z.lon`:python z.lat

<xarray.DataArray 'lat' (index: 346)> array([43.5 , 43.5 , 43.5 , ..., 51.25, 51.25, 51.25]) Coordinates: * index (index) MultiIndex - time (index) datetime64[ns] 2019-03-09 2019-03-09 ... 2019-03-09 - lat (index) float64 43.5 43.5 43.5 43.75 43.75 ... 45.0 45.0 45.5 45.5 - lon (index) float64 1.25 1.5 4.25 1.75 2.25 ... 1.75 2.0 4.0 1.5 2.0 ```

One can still unstack this and achieve the equivalent of multi-dimensional dropna. However in your example all the coordinates for time look equal (they shouldn't be) and this will prevent unstacking.

I hope this helps

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dropping values along multidimensions 423632904
499248139 https://github.com/pydata/xarray/issues/2933#issuecomment-499248139 https://api.github.com/repos/pydata/xarray/issues/2933 MDEyOklzc3VlQ29tbWVudDQ5OTI0ODEzOQ== 0x0L 3621629 2019-06-05T20:44:29Z 2019-06-05T20:44:29Z CONTRIBUTOR

Hello @ray306

stack/unstack in xarray is a bit different from pandas mechanics.

  • From the stack docstring ``` Stack any number of existing dimensions into a single new dimension.

New dimensions will be added at the end, and the corresponding coordinate variables will be combined into a MultiIndex. `` Breaking it down,da.stack({'index': ['variable']})fails because it's trying to: 1. create a new multi-index with a single level inside (variable) [so far so good but probably not what you had in mind] 2. add a new dimension named 'index' with coordinates given by the newly created index. This part yields the error you saw sincedaalready has an index namedindex`.

To mesh the variable dimension into the index dimension, you first need to unstack it: python da.unstack('index').stack(index=('first', 'second', 'variable'))

  • From the unstack docstring ``` Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions.

Parameters

dim : str or sequence of str, optional Dimension(s) over which to unstack. By default unstacks all MultiIndexes. `` Yourdaarray only has two dimensions:variableandindex. That's why you can'tda.unstack('first').first` is a coordinate (along the dimension 'index') not a dimension.

You could use da.unstack('index').stack(index=['second']) but this is somehow the same thing as da.unstack() since a multi-index with a single level is totally equivalent to the level itself.

I hope this helps you enjoy xarray and use it more.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Stack() & unstack() issues on Multindex 438947247
495999155 https://github.com/pydata/xarray/pull/2991#issuecomment-495999155 https://api.github.com/repos/pydata/xarray/issues/2991 MDEyOklzc3VlQ29tbWVudDQ5NTk5OTE1NQ== 0x0L 3621629 2019-05-26T13:13:22Z 2019-05-26T13:13:22Z CONTRIBUTOR

@shoyer The api reference does not generate doc for the accessor methods. It's also missing for .dt Do you know how to do this ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: str accessor 448478648
357043145 https://github.com/pydata/xarray/pull/1734#issuecomment-357043145 https://api.github.com/repos/pydata/xarray/issues/1734 MDEyOklzc3VlQ29tbWVudDM1NzA0MzE0NQ== 0x0L 3621629 2018-01-11T19:56:03Z 2018-01-11T19:56:03Z CONTRIBUTOR

@jhamman Thank you

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  pandas casting issues 275813162
349142414 https://github.com/pydata/xarray/pull/1734#issuecomment-349142414 https://api.github.com/repos/pydata/xarray/issues/1734 MDEyOklzc3VlQ29tbWVudDM0OTE0MjQxNA== 0x0L 3621629 2017-12-04T23:29:29Z 2017-12-04T23:29:29Z CONTRIBUTOR

@shoyer Thanks for the help for the writing, most of these are your own words ^^

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  pandas casting issues 275813162
349105759 https://github.com/pydata/xarray/pull/1733#issuecomment-349105759 https://api.github.com/repos/pydata/xarray/issues/1733 MDEyOklzc3VlQ29tbWVudDM0OTEwNTc1OQ== 0x0L 3621629 2017-12-04T21:07:40Z 2017-12-04T21:07:40Z CONTRIBUTOR

Should i move the implementation on Variable and use temp datasets like quantile does ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rank Methods 275789502
349088887 https://github.com/pydata/xarray/pull/1733#issuecomment-349088887 https://api.github.com/repos/pydata/xarray/issues/1733 MDEyOklzc3VlQ29tbWVudDM0OTA4ODg4Nw== 0x0L 3621629 2017-12-04T20:06:41Z 2017-12-04T20:06:41Z CONTRIBUTOR

@shoyer when the ranking dimension is missing from an array in the dataset, should we do nothing, or put 1s everywhere ? None of these looks appealing or natural.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rank Methods 275789502
348288575 https://github.com/pydata/xarray/pull/1734#issuecomment-348288575 https://api.github.com/repos/pydata/xarray/issues/1734 MDEyOklzc3VlQ29tbWVudDM0ODI4ODU3NQ== 0x0L 3621629 2017-11-30T19:06:48Z 2017-11-30T19:06:48Z CONTRIBUTOR

@shoyer all good

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  pandas casting issues 275813162
346905769 https://github.com/pydata/xarray/pull/1733#issuecomment-346905769 https://api.github.com/repos/pydata/xarray/issues/1733 MDEyOklzc3VlQ29tbWVudDM0NjkwNTc2OQ== 0x0L 3621629 2017-11-24T23:23:36Z 2017-11-24T23:23:36Z CONTRIBUTOR

Dropped support for Dataset. I don't think there's much use for it anyway.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rank Methods 275789502
346713298 https://github.com/pydata/xarray/pull/1733#issuecomment-346713298 https://api.github.com/repos/pydata/xarray/issues/1733 MDEyOklzc3VlQ29tbWVudDM0NjcxMzI5OA== 0x0L 3621629 2017-11-24T00:41:29Z 2017-11-24T00:41:29Z CONTRIBUTOR

@shoyer Thanks for the comment and the tips! I'll make the changes asap, hopefully this week-end

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rank Methods 275789502
346106494 https://github.com/pydata/xarray/issues/1726#issuecomment-346106494 https://api.github.com/repos/pydata/xarray/issues/1726 MDEyOklzc3VlQ29tbWVudDM0NjEwNjQ5NA== 0x0L 3621629 2017-11-21T17:47:44Z 2017-11-21T19:41:46Z CONTRIBUTOR

I dug it a bit further. Contrary to what I said numpy is fine. If x is a DataArray

```python np.array(x.mean())

-> array(2.0)

np.array([x.mean()])

-> array([2.0])

np.array(x)

-> ok

```

pandas behavior is more surprising

```python pd.Series(2)

ok

pd.Series(x.mean())

-> TypeError: len() of unsized object

pd.Series([x.mean()])

-> dtype=object

however for 1D x

pd.Series(x)

dtype is fine

```

Something looks a bit odd to me. But it looks more like a pandas issue

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Behavior of dataarray with no dimensions 274996832
346124454 https://github.com/pydata/xarray/pull/1734#issuecomment-346124454 https://api.github.com/repos/pydata/xarray/issues/1734 MDEyOklzc3VlQ29tbWVudDM0NjEyNDQ1NA== 0x0L 3621629 2017-11-21T18:51:09Z 2017-11-21T18:51:09Z CONTRIBUTOR

@fmaussion

In a nutshell,

python x = xr.DataArray([1,2,3]) pd.Series({'mean': x.mean()}) does not work as expected. You'll want one of

python pd.Series({'mean': float(x.mean())}) pd.Series({'mean': x.mean()}, dtype=float) pd.Series({'mean': x.mean()}).astype(float)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  pandas casting issues 275813162
346084931 https://github.com/pydata/xarray/issues/1731#issuecomment-346084931 https://api.github.com/repos/pydata/xarray/issues/1731 MDEyOklzc3VlQ29tbWVudDM0NjA4NDkzMQ== 0x0L 3621629 2017-11-21T16:37:37Z 2017-11-21T16:38:32Z CONTRIBUTOR

A few points:

  • nanrankdata only support numeric types, how about wrapping rankdata with a keyword option ?
  • There's also a push push method similar to pandas ffill which would be nice.
  • move_rank outputs are not normalized as rankdata, this might be a bit confusing
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rank function 275461273
345790125 https://github.com/pydata/xarray/issues/1726#issuecomment-345790125 https://api.github.com/repos/pydata/xarray/issues/1726 MDEyOklzc3VlQ29tbWVudDM0NTc5MDEyNQ== 0x0L 3621629 2017-11-20T18:47:12Z 2017-11-20T18:47:12Z CONTRIBUTOR

Thanks for your answer. I'll try to find a good spot in the doc to write a line or two about this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Behavior of dataarray with no dimensions 274996832

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 17.903ms · About: xarray-datasette