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)

相关文章:

  • 2021-08-19
  • 2022-02-03
  • 2022-12-23
  • 2021-12-08
  • 2021-08-26
  • 2021-09-12
  • 2022-01-29
猜你喜欢
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2021-10-14
  • 2021-12-05
相关资源
相似解决方案