-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
period_range() bug? #7817
Comments
docs are here you need to specify the
|
but i don't need 'H' frequency I need daily frequency that starts at some hour |
what are you trying to do with the range? e.g. show the output frame you are expecting |
I don't know what normalize does, I will look into it. i need to make a dataframe with Timestamp index functionality when it comes to planets or geological studies, Timestamp is so limited I want to scream |
and the example I gave give you and hourly frequency, no? show your start and end dates and a sample of the index. |
what I do usually, an example that works with Timestamps: df = P.DataFrame(index=P.date_range('1950-1-1 12:00', '2050-1-1'))
df = add_ephemeris_function(df) # which updates the dataframe with planetary information the problem appears when the range is too big for Timestamp |
What is the point of the hour if you don't have hourly frequency? |
if you calculate moon position at midnight, period_range() will do I guess but moon travels 6 degrees in 12 hours so if I need planet positions as 12:00, daily date_range() works, but it's limited |
so you prob want something like this: #7811 |
i'm not sure I need that (although i didn't understood his need exactly) In my mind, i don't understand why the start point has to be 00:00 for daily I see that if I do: 102 In : P.period_range('2000-1-13', '2002-1-26', freq='M')[0]
102 Out: Period('2000-01', 'M')
103 In : P.period_range('2000-1-13', '2002-1-26', freq='M')[0].day
103 Out: 31 it doesnt make sense to me at all. in my mind myeah, so no PeriodIndex for me, it doesnt click for me |
@ifmihai you might be better off asking colleagues / mailing lists for your field on how they use pandas. |
@jreback it's a good point, i will do that |
@ifmihai its unclear what is not working for you. If you supply a complete example you might get some more help. Periods do not have 100% feature compat with Timestamps, because they don't have the user base. We are working to fix that, and if something is missing (see the issue I ref above), then it will be addressed. But, I stress that Periods are exactly what you are looking and they were setup to span ANY timestamp. |
my need is quite simple thinking in daily frequency date_range() is capable of starting from 12:00 and then add to datetimes the desired frequency it doesn't feel right for me, a period, I repeat, in my mind is: starting point + freq span I would want period_range() or any function which generates a range I hope I'm clear now, I didn't know it wasnt clear, sorry |
You want a 12H frequency Period, which is currently under development. You can do this with timestamps, but not yet with Periods (it only allows a 1H freq atm). simply because it hasn't been done. |
good to know this ps. I'm not sure what it will give |
yes. But you can filter them out. The issue is that the underlying Period representation doesn't consider '2013-1-1 12', freq='D' (it simply drops the time). not 100% sure if this is changable (easily) or not. a '24H' freq might also work for you. Would have to experiment. (but again that's the same issue). |
The outputs of while the outputs of |
I did:
it should have been 10, right?
why does period_range() loses time information?
I was recommended to use periods and period_range() because of pandas Timestamp limitation (nanoseconds time units)
now I'm stuck, because I need datetimes outside Timestamp range
ps.
would it be too drastic to change time units from nanoseconds to microseconds in Timestamp? so that we would be happier? :P
see also #7307
The text was updated successfully, but these errors were encountered: