We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Was surprised at how difficult it was to convert a unix timestamp to a pandas Timestamp recently
The text was updated successfully, but these errors were encountered:
I think an API like:
pd.to_datetime(values, unit='s') Timestamp(value,unit='s')
might be all that we need, in that the unit is a hint that I am giving you something that this is in these units
e.g. right now the default is (so no conversion from int needed)
In [9]: Timestamp(1368431149000000000, unit='ns') Out[9]: <Timestamp: 2013-05-13 07:45:49>
http://stackoverflow.com/questions/16517240/pandas-using-unix-epoch-timestamp-as-datetime-index
In [3]: np.array([1368431149, 1368431150]).astype('datetime64[s]') Out[3]: array([2013-05-13 07:45:49, 2013-05-13 07:45:50], dtype=datetime64[s]) In [4]: pd.to_datetime(np.array([1368431149, 1368431150])*int(1e6)) Out[4]: <class 'pandas.tseries.index.DatetimeIndex'> [1970-01-16 20:07:11.149000, 1970-01-16 20:07:11.150000] Length: 2, Freq: None, Timezone: None In [5]: pd.to_datetime(np.array([1368431149, 1368431150])*int(1e9)) Out[5]: <class 'pandas.tseries.index.DatetimeIndex'> [2013-05-13 07:45:49, 2013-05-13 07:45:50] Length: 2, Freq: None, Timezone: None
Sorry, something went wrong.
@hayd what do u think about this API?
I think unit is descriptive, I like it.
unit
Successfully merging a pull request may close this issue.
Was surprised at how difficult it was to convert a unix timestamp to a pandas Timestamp recently
The text was updated successfully, but these errors were encountered: