-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PeriodIndex cannot infer frequency in cases where Period can #8466
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
you need st least. 3 element to infer a freq |
I get the same error with PeriodIndex(["2000-01", "2000-02", "2000-03"]), or with a larger list.
That's sort of what I expected from PeriodIndex: try to use the inferred frequency (using the same algorithm as Period) of the first element of the data. A simple workaround is PeriodIndex([Period(x) for x in ["2000-01", "2000-02"]]). |
see #6771 most of these conversions are ambiguous (I suppose in the given case) its prob ok. So welcome to provide a soln for a fully-functional So we'll keep this as an adjust issue. but soln is a bit non-trivial. |
This seems very fragile... I think we'll close this, unless someone can provide a clear example and proposed API. |
xref #6771
Same problem with 2000-Jan and Jan-2000. Works fine if I pass freq="M".
The text was updated successfully, but these errors were encountered: