json
file like this:
{"authors":[{"ids":["4888852"],"name":"Andrea D. Foebel"},{"ids":["3325893"],"name":"John P. Hirdes"},{"ids":["5316482"],"name":"George A. Heckman"}]}
{"authors":[{"ids":["4836831"],"name":"A. S. Gavrish"},{"ids":["4061357"],"name":"E. N. Kilimnik"}]}
{"authors":[{"ids":["4888852"],"name":"A. S. Gavrish"},{"ids":["4061357"],"name":"E. N. Kilimnik"}]}
Code
import csv
import json
import pandas as pd
from itertools import islice
from collections import Counter
data=[]
with open('papers-2017-10-30-sample.json',encoding='utf-8') as f:
for line in f:
data.append(json.loads(line))
c = Counter(player['ids'] for player in data)
print(c)
I want to count same ids
's value and use name
to group
any ideas? please help