MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / readJson

Function readJson

union/Santos/generalFunctions.py:145–154  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

143
144#to read json input files where, the data are stored with relation as key.
145def readJson(filename):
146 with open(filename) as f:
147 data = json.load(f)
148 df = pd.DataFrame(data["relation"])
149 df_transposed = df.T
150 # To use the first row as the header row:
151 #new_header = df_transposed.iloc[0]
152 df_transposed = df_transposed[1:]
153 #df_transposed.columns = new_header
154 return df_transposed

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected