Skip to content

Commit 1df9dfa

Browse files
code sample for pandas-dev#30323
1 parent 40dfd1e commit 1df9dfa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bisect/30323.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# json_normalize skips an entry in a pymongo cursor #30323
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
test_data = [{"_id": 1, "name": "Miriam"}, {"_id": 2, "name": "Peter"}]
8+
data_gen = (record for record in test_data)
9+
result = pd.json_normalize(data_gen)
10+
print(result)
11+
12+
expected = pd.json_normalize(test_data)
13+
pd.testing.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)