1. 保存list
import numpy as np
a = [1,2,3,4,5]
np.save("number.npy", a)
k = np.load("number.npy")
2. 保存map
import json
data = {}
data["a"] = 1
data["b"] = 2
# Writing JSON data
with open('data.json', 'w') as f:
json.dump(data, f)
# Reading data back
with open('data.json', 'r') as f:
data = json.load(f)