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/846#issuecomment-218362743,https://api.github.com/repos/pydata/xarray/issues/846,218362743,MDEyOklzc3VlQ29tbWVudDIxODM2Mjc0Mw==,5635139,2016-05-11T05:05:36Z,2016-05-11T05:05:36Z,MEMBER,"OK great. Closing this. Cheers
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,153640301
https://github.com/pydata/xarray/issues/846#issuecomment-218360165,https://api.github.com/repos/pydata/xarray/issues/846,218360165,MDEyOklzc3VlQ29tbWVudDIxODM2MDE2NQ==,1217238,2016-05-11T04:40:58Z,2016-05-11T04:40:58Z,MEMBER,"> I see, because all numpy dtypes have .item(), and Period is trying to be a dtype? I haven't come across .item() before but I generally don't work much with numpy directly
Yes, that would be the argument here. It's not clear how closely pandas should be mimicking NumPy here, though, given that we are looking to eventually make the backend flexible enough that it doesn't need to be built on NumPy.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,153640301
https://github.com/pydata/xarray/issues/846#issuecomment-218357921,https://api.github.com/repos/pydata/xarray/issues/846,218357921,MDEyOklzc3VlQ29tbWVudDIxODM1NzkyMQ==,5635139,2016-05-11T04:19:50Z,2016-05-11T04:19:50Z,MEMBER,"> So I think one reasonable approach would be to implement .item() for pandas.Period, too.
I see, because all numpy dtypes have `.item()`, and `Period` is trying to be a dtype? I haven't come across `.item()` before but I generally don't work much with numpy directly
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,153640301
https://github.com/pydata/xarray/issues/846#issuecomment-218355316,https://api.github.com/repos/pydata/xarray/issues/846,218355316,MDEyOklzc3VlQ29tbWVudDIxODM1NTMxNg==,1217238,2016-05-11T03:53:50Z,2016-05-11T03:53:50Z,MEMBER,"Actually, `p.values` in your first example is a `datetime64` scalar. NumPy scalars support `.item()`, though.
So I think one reasonable approach would be to implement `.item()` for `pandas.Period`, too. One difference is that there is no native Python scalar for periods, so I would probably just make `.item()` a no-op.
Side note: that the behavior you show for `DatetimeIndex`/`datetime64[ns]` is actually a bug in NumPy related to nanosecond precision:
```
In [4]: np.array(np.datetime64('2000-01-01', 'us')).item()
Out[4]: datetime.datetime(2000, 1, 1, 0, 0)
In [5]: np.array(np.datetime64('2000-01-01', 's')).item()
Out[5]: datetime.datetime(2000, 1, 1, 0, 0)
In [6]: np.array(np.datetime64('2000-01-01', 'ns')).item()
Out[6]: 946684800000000000
```
It's probably worth filing on bug report, if one doesn't already exist...
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,153640301