I have two json files that I would like to concatenate into one. Is there any approach to combine these json?
json1 = {
"105912": {
"name": "Avatar - Tocasia, Dig Site Mentor",
"cardset": "VAN",
"rarity": "Rare",
"foil": 0,
"price": 0.05
},
"105911": {
"name": "Avatar - Yotian Frontliner",
"cardset": "VAN",
"rarity": "Rare",
"foil": 0,
"price": 0.05
}
}
json2 = {
"105912": {
"name": "Avatar - Tocasia, Dig Site Mentor",
"cardset": "VAN",
"rarity": "Rare",
"foil": 0,
"price": 0.0007
},
"105911": {
"name": "Avatar - Yotian Frontliner",
"cardset": "VAN",
"rarity": "Rare",
"foil": 0,
"price": 0.0007
}
}
import pandas as pd
from glob import glob
arquivos = sorted(glob('price-history\*.json'))
todos_dados = pd.concat((pd.read_json(cont, lines=True, orient='records') for cont in
arquivos))
print(todos_dados)
the error that is returning is ValueError: Expected object or value
The expected output would be a dataframe to be able to filter data.