-
-
Couldn't load subscription status.
- Fork 19.2k
BUG: conversion a JSON field descriptor into pandas type for deprecated offsets frequency 'M' #55581
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
BUG: conversion a JSON field descriptor into pandas type for deprecated offsets frequency 'M' #55581
Changes from 4 commits
a832dcc
e55001e
e454892
c0a7ee6
7a98c81
e073336
a298a24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -845,3 +845,13 @@ def test_read_json_orient_table_old_schema_version(self): | |
| expected = DataFrame({"a": [1, 2.0, "s"]}) | ||
| result = pd.read_json(StringIO(df_json), orient="table") | ||
| tm.assert_frame_equal(expected, result) | ||
|
|
||
| def test_read_json_table_orient_period_depr_freq(self, recwarn): | ||
| # GH#9586 | ||
| df = DataFrame( | ||
| {"ints": [1, 2]}, | ||
| index=pd.PeriodIndex(["2011-01", "2011-08"], freq="2M"), | ||
|
||
| ) | ||
| out = df.to_json(orient="table") | ||
| result = pd.read_json(out, orient="table") | ||
| tm.assert_frame_equal(df, result) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having a regular expression here looks a bit complex - would it work to do
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, it works very well. I replaced the regular expression with to_offset and updated my PR.