Merge json files using Pandas

Posted Leave a commentPosted in Coding, Pandas

Quick demo for merging multiple json files using Pandas – import pandas as pd import glob import json file_list = glob.glob(“*.json”) >>> file_list [‘b.json’, ‘c.json’, ‘a.json’] Use enumerate to assign counter to files. allFilesDict = {v:k for v, k in enumerate(file_list, 1)} >>> allFilesDict {1: ‘b.json’, 2: ‘c.json’, 3: ‘a.json’} Append the data into list […]