-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
implementation of from_julian_date() #11276
New issue
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
Comments
fyi, this is somewhat easy to do with the current In [66]: julian_dates = pd.date_range('2014-1-1', periods=10).to_julian_date().values
In [67]: julian_dates
Out[67]:
array([ 2456658.5, 2456659.5, 2456660.5, 2456661.5, 2456662.5,
2456663.5, 2456664.5, 2456665.5, 2456666.5, 2456667.5])
In [68]: pd.to_datetime(julian_dates - pd.Timestamp(0).to_julian_date(), unit='D')
Out[68]:
DatetimeIndex(['2014-01-01', '2014-01-02', '2014-01-03', '2014-01-04',
'2014-01-05', '2014-01-06', '2014-01-07', '2014-01-08',
'2014-01-09', '2014-01-10'],
dtype='datetime64[ns]', freq=None) |
interesting solution, thank you very much for that! |
I think this would not be unreasonable to have We don't have any |
Good idea! So you plan to support this in the future? |
@sebhahn if you'd like to do a PR with the |
@sumitbinnani I haven't started yet, so feel free to implement it 😄 |
@sebhahn: Thanks. Will soon submit a patch :-) |
closes pandas-dev#11276 closes pandas-dev#11745 closes pandas-dev#11470
👍 |
pandas.DatetimeIndex
supports a method calledto_julian_date()
would it be easily possible to support a function/method doing the opposite, i.e.from_julian_date()
?The text was updated successfully, but these errors were encountered: