-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
date_range treats '.5s' as '5s' #8419
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
these don't take fractional units ATM (I don't think was ever implemented). I don't think very difficult to fix. welcome to have a pull-request. |
https://github.com/pydata/pandas/blob/master/pandas/tseries/frequencies.py#L97 I think this may have to do with the integer division when assigned values to a freq group. For example, if you also try .05s, it gets cut to 5S. I believe this is because of the (freq // 1000) operation used in grouping. Someone else might be able to correct me or give additional insights. Edit: jreback beat me to it. I might look into this tonight as it seems like it would be interesting, but simple. No promises though. |
@jbradish sounds great! basically you need to patch |
I think fix should be 2 parts: 1.
|
Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is an integer, this commit ensures that that's the case for resolutions from days to microseconds. Fixes pandas-dev#8419
Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is an integer, this commit ensures that that's the case for resolutions from days to microseconds. Fixes pandas-dev#8419
Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is an integer, this commit ensures that that's the case for resolutions from days to microseconds. Fixes pandas-dev#8419
Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is an integer, this commit ensures that that's the case for resolutions from days to microseconds. Fixes #8419
…4378) Passing `'0.5min'` as a frequency string should generate 30 second intervals, rather than five minute intervals. By recursively increasing resolution until one is found for which the frequency is an integer, this commit ensures that that's the case for resolutions from days to microseconds. Fixes pandas-dev#8419
I'm new to pandas, so maybe I'm missing something, but I'd expected freq='.5s' to give me 500ms intervals, not 5s intervals:
Behaviour is the same under Python 2 and 3.
The text was updated successfully, but these errors were encountered: