File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,24 @@ def test_build_series(self):
241241
242242 assert result == expected
243243
244+ def test_read_json_from_to_json_results (self ):
245+ # GH32383
246+ df = pd .DataFrame (
247+ {
248+ "_id" : {"row_0" : 0 },
249+ "category" : {"row_0" : "Goods" },
250+ "recommender_id" : {"row_0" : 3 },
251+ "recommender_name_jp" : {"row_0" : "浦田" },
252+ "recommender_name_en" : {"row_0" : "Urata" },
253+ "name_jp" : {"row_0" : "博多人形(松尾吉将まつお よしまさ)" },
254+ "name_en" : {"row_0" : "Hakata Dolls Matsuo" },
255+ }
256+ )
257+ result1 = pd .read_json (df .to_json ())
258+ result2 = pd .DataFrame .from_dict (json .loads (df .to_json ()))
259+ tm .assert_frame_equal (result1 , df )
260+ tm .assert_frame_equal (result2 , df )
261+
244262 def test_to_json (self ):
245263 df = self .df .copy ()
246264 df .index .name = "idx"
You can’t perform that action at this time.
0 commit comments