dictionary = {'hello': 'world'}
np.save('my_file.npy', dictionary)
read_dictionary = np.load('my_file.npy',allow_pickle = True).item()
print(read_dictionary['hello'])
print("ok")
https://zhuanlan.zhihu.com/p/258140196
https://blog.youkuaiyun.com/qq_39362996/article/details/85755087
本文介绍了如何使用numpy库将字典序列化为.npy文件,并进行反序列化读取。示例中展示了保存和加载字典到.npy文件的过程,以及在Python中打印读取内容的方法。
5505

被折叠的 条评论
为什么被折叠?



