{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/10318","labels_url":"https://api.github.com/repos/pydata/pandas/issues/10318/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/10318/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/10318/events","html_url":"https://github.com/pydata/pandas/issues/10318","id":86709121,"number":10318,"title":"BUG: Timestamp construction from numpy.datetime64 creates a naive Timestamp","user":{"login":"kawochen","id":10709573,"avatar_url":"https://avatars.githubusercontent.com/u/10709573?v=3","gravatar_id":"","url":"https://api.github.com/users/kawochen","html_url":"https://github.com/kawochen","followers_url":"https://api.github.com/users/kawochen/followers","following_url":"https://api.github.com/users/kawochen/following{/other_user}","gists_url":"https://api.github.com/users/kawochen/gists{/gist_id}","starred_url":"https://api.github.com/users/kawochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kawochen/subscriptions","organizations_url":"https://api.github.com/users/kawochen/orgs","repos_url":"https://api.github.com/users/kawochen/repos","events_url":"https://api.github.com/users/kawochen/events{/privacy}","received_events_url":"https://api.github.com/users/kawochen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-09T19:30:59Z","updated_at":"2015-06-09T20:57:45Z","closed_at":"2015-06-09T19:51:08Z","body":"```\r\n>>> d = '2013-02-02T02:12:34+0600'\r\n>>> ts_from_str = pandas.Timestamp(d)\r\n>>> ts_from_dt64 = pandas.Timestamp(numpy.datetime64(d))\r\n>>> ts_from_dt64.tzinfo\r\n>>> ts_from_str.tzinfo\r\npytz.FixedOffset(360)\r\n```\r\nNumPy documentation is clear about `datetime64` representing 'a single moment in time' and being 'always stored based on POSIX time'. It seems to me that a `Timestamp` object constructed from `datetime64` should always be tz-aware, so that the equality comparison between `ts_from_dt64` and `ts_from_str` would return `True`, instead of raising an error. \r\nThis part seems easy and I can create a PR if what I wrote makes sense. Since `datetime64` doesn't seem to store offsets, we probably can't `get ts_from_dt64` and `ts_from_str` to print the same string."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/110502119","html_url":"https://github.com/pydata/pandas/issues/10318#issuecomment-110502119","issue_url":"https://api.github.com/repos/pydata/pandas/issues/10318","id":110502119,"user":{"login":"kawochen","id":10709573,"avatar_url":"https://avatars.githubusercontent.com/u/10709573?v=3","gravatar_id":"","url":"https://api.github.com/users/kawochen","html_url":"https://github.com/kawochen","followers_url":"https://api.github.com/users/kawochen/followers","following_url":"https://api.github.com/users/kawochen/following{/other_user}","gists_url":"https://api.github.com/users/kawochen/gists{/gist_id}","starred_url":"https://api.github.com/users/kawochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kawochen/subscriptions","organizations_url":"https://api.github.com/users/kawochen/orgs","repos_url":"https://api.github.com/users/kawochen/repos","events_url":"https://api.github.com/users/kawochen/events{/privacy}","received_events_url":"https://api.github.com/users/kawochen/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T20:57:45Z","updated_at":"2015-06-09T20:57:45Z","body":"I am not concerned about the display. I was thinking that `pandas.Timestamp(d)==pandas.Timestamp(numpy.datetime64(d))` should always evaluate to `True`, but then I guess it's not possible to make it work for both cases (`d = '2013-02-02T02:00'` and `d = '2013-02-02T02:00+0000'`).\r\n"}}