np array转json import numpy as np import codecs, json a = np.arange().reshape(,) # a by array b = a.tolist() # nested lists with same data, indices file_path = "/path.json" ## your path variable json.dump(b, codecs.open(file_path, ) ### this save
1. 写入缓存:建立文件夹,把list集合里面的数组转换为JSON数组,存入文件夹2. 读取缓存:把JSON数组从文件夹里面读取出来,然后放入list集合,返回list集合 private final static File filefolder=new File("/sdcard/myData"); private final static File filename=new File("/sdcard/myData/tem.txt"); public sta
Function Return Type Description Example Result array_append(anyarray,anyelement) anyarray append an element to the end of an array array_append(ARRAY[1,2], 3) {1,2,3} array_cat(anyarray,anyarray) anyarray concatenate two arrays array_cat(ARRAY[1,2,3