data = np.load('pems04.npz')
lst = data.files
traffic_data = data[lst[0]]
data_dict = []
for timestep in range(traffic_data.shape[0]):
for location in range(traffic_data.shape[1]):
data_dict.append({
"timestep" : timestep+1,
"location" : location,
"flow" : traffic_data[timestep][location][0],
"occupy" : traffic_data[timestep][location][1],
"speed" : traffic_data[timestep][location][2]
})
11-23
216
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)