什么是JSON文件?
JSON数据是一种轻量级得数据交换格式,因起简洁和清晰得层次结构使JSON成为理想的数据交换语言。
import pandas as pd
import numpy as np
import os
os.chdir(r'E:\python_learn\train') # 相对路径
json文件读取 → pd.read_json
read_json读取json文件后,返回DataFrame,是一个index标签乱序的顺序,可以用sort_index对其重新排序
file_name = 'eueo2012.json'
json = pd.read_json(file_name)
json.head()
Team | Goals | Shots on target | Shots off target | Shooting Accuracy | % Goals-to-shots | Total shots (inc |
---|