File tree 1 file changed +18
-0
lines changed
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):
241
241
242
242
assert result == expected
243
243
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
+
244
262
def test_to_json (self ):
245
263
df = self .df .copy ()
246
264
df .index .name = "idx"
You can’t perform that action at this time.
0 commit comments