Code: Select all
def wrangle(jsonfilepath):
with gzip.open(jsonfilepath,"r") as jsfile:
taiwan_data = json.load(jsfile)
df= pd.DataFrame(taiwan_data)
df.set_index(company_id,inplace=True)
return df
df = wrangle("data/taiwan-bankruptcy-data.json.gz")
print("df shape:", df.shape)
df.head()