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/805#issuecomment-269059020,https://api.github.com/repos/pydata/xarray/issues/805,269059020,MDEyOklzc3VlQ29tbWVudDI2OTA1OTAyMA==,1217238,2016-12-24T00:09:47Z,2016-12-24T00:09:47Z,MEMBER,"Yep, looks like this works now. There's no period dtype in NumPy, so object dtype is the best we can do.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,143764621 https://github.com/pydata/xarray/issues/805#issuecomment-269031217,https://api.github.com/repos/pydata/xarray/issues/805,269031217,MDEyOklzc3VlQ29tbWVudDI2OTAzMTIxNw==,5635139,2016-12-23T18:51:10Z,2016-12-23T18:51:10Z,MEMBER,"This now works, although as an object array rather than PI. Which is probably OK: ```python In [6]: ds Out[6]: Dimensions: (time: 3, x: 2, y: 2) Coordinates: lon (x, y) float64 -99.83 -99.32 -99.79 -99.23 lat (x, y) float64 42.25 42.21 42.63 42.59 * time (time) datetime64[ns] 2014-09-06 2014-09-07 2014-09-08 reference_time object 2014 * x (x) int64 0 1 * y (y) int64 0 1 Data variables: temperature (x, y, time) float64 12.29 8.305 10.63 16.6 2.823 16.29 ... precipitation (x, y, time) float64 4.541 3.618 3.336 2.332 7.987 4.197 ... In [7]: ds.reference_time Out[7]: array(Period('2014', 'A-DEC'), dtype=object) Coordinates: reference_time object 2014 ``` @shoyer - to close?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,143764621 https://github.com/pydata/xarray/issues/805#issuecomment-202469160,https://api.github.com/repos/pydata/xarray/issues/805,202469160,MDEyOklzc3VlQ29tbWVudDIwMjQ2OTE2MA==,1634164,2016-03-28T16:19:05Z,2016-03-28T16:19:05Z,NONE,"@jhamman — you're right. In truth, I was working with some more complex code using a PeriodIndex and getting errors I couldn't decipher, so I pulled those lines from the docs and played with them to try to understand what was happening. I don't know why it's that way in the docs…maybe because `ds['reference_time']` or `ds.reference_time` is more concise than `ds.attrs['reference_time']`? @shoyer — thanks! ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,143764621 https://github.com/pydata/xarray/issues/805#issuecomment-202199581,https://api.github.com/repos/pydata/xarray/issues/805,202199581,MDEyOklzc3VlQ29tbWVudDIwMjE5OTU4MQ==,1217238,2016-03-28T02:36:54Z,2016-03-28T02:36:54Z,MEMBER,"Thanks for the bug report -- this should definitely work. I'll take a look. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,143764621 https://github.com/pydata/xarray/issues/805#issuecomment-201992240,https://api.github.com/repos/pydata/xarray/issues/805,201992240,MDEyOklzc3VlQ29tbWVudDIwMTk5MjI0MA==,2443309,2016-03-27T05:00:49Z,2016-03-27T05:00:49Z,MEMBER,"It doesn't really seem like `reference_time` is a ""coordinate"" variable. Being a scalar, you are not going to use it as a coordinate in the same sense as lat/lon/time. Nevertheless, your example works if you cast the `Period` to a DataArray first: ``` Python ds = xr.Dataset({'temperature': (['x', 'y', 'time'], temp), 'precipitation': (['x', 'y', 'time'], precip)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': pd.date_range('2014-09-06', periods=3), 'reference_time': xr.DataArray(pd.Period('2014'))}) ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,143764621