import numpy
X = numpy.array([1, 2, 3, 4])
str = ' '.join(str(j) for j in X)
with open('X.txt', 'w+') as f:
f.write(str+'\n')
数组转换为字符串写入文件中
猜你喜欢
转载自blog.csdn.net/weixin_43486780/article/details/104757015
今日推荐
周排行