home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 153985189

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/645#issuecomment-153985189 https://api.github.com/repos/pydata/xarray/issues/645 153985189 MDEyOklzc3VlQ29tbWVudDE1Mzk4NTE4OQ== 5635139 2015-11-05T08:22:28Z 2015-11-05T08:46:35Z MEMBER

Yes .values is much headache on PeriodIndex... A Period dtype would be great although unlikely to happen soon I'd guess. In the mean time, I used is_period_arraylike rather than dtype to identify type IIRC.

Happy to have a go at this - at least to ensure it doesn't break while printing - could you give me an initial 'leg up'? Specifically: - Do you know why it's trying to pull a value from the index when it prints? Its dependence on n seems particularly odd, since changing n doesn't actually change what's attempted to be displayed from that coord (shown below with Timestamps to demonstrate what's displayed in either case) - Do you know why this line https://github.com/xray/xray/blob/master/xray/core/indexing.py#L400 isn't just value? If we need value in a container, I think .shallow_copy([value]) will work. But this leaves the question above unanswered.

``` python In [149]:

n=100 m=3 xray.Dataset( variables = { 'a': (['x', 'y'], np.random.rand(m,n)), 'b': (['x', 'y'], np.random.rand(m,n)) }, coords = { 'x': pd.date_range(start='2000', periods=m), 'y': range(n), }

) Out[149]: <xray.Dataset> Dimensions: (x: 3, y: 100) Coordinates: * y (y) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... * x (x) datetime64[ns] 2000-01-01 2000-01-02 2000-01-03 Data variables: a (x, y) float64 0.927 0.9906 0.1317 0.7665 0.4558 0.9502 0.1435 ... b (x, y) float64 0.9084 0.5827 0.8724 0.1391 0.4529 0.6794 0.555 ... In [150]:

n=10 m=3 xray.Dataset( variables = { 'a': (['x', 'y'], np.random.rand(m,n)), 'b': (['x', 'y'], np.random.rand(m,n)) }, coords = { 'x': pd.date_range(start='2000', periods=m), 'y': range(n), }

) Out[150]: <xray.Dataset> Dimensions: (x: 3, y: 10) Coordinates: * y (y) int64 0 1 2 3 4 5 6 7 8 9 * x (x) datetime64[ns] 2000-01-01 2000-01-02 2000-01-03 Data variables: a (x, y) float64 0.09265 0.4552 0.6755 0.5913 0.5198 0.2473 ... b (x, y) float64 0.5253 0.04162 0.8621 0.2462 0.2081 0.4814 ... ```

Am excited for IntervalIndex!

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