Run
import pandas as pd df = pd.DataFrame({'name':['a', 'b', 'c'], 'age' :[20, 21, 20]}) df.to_json(path_or_buf='output.json')
Output