
python
Datura_Metel
这个作者很懒,什么都没留下…
展开
-
txt文件数据处理
读取每行数据,并进行简单处理f = open('result.txt', 'r')row = f.readline()print(row)# [8, 0, 30, 30, 30, 30, 30, 30, 45, 90, 1.460]\nprint(row.strip().strip('[]').strip(','))# 8, 0, 30, 30, 30, 30, 30, 30, 45, 90, 1.460print(row.strip().strip('[]').split(',')).原创 2020-06-29 11:13:27 · 5406 阅读 · 0 评论 -
numpy读取.p文件时出现Cannot load file containing pickled data
import numpydata = numpy.load('y_train.p')执行上述代码会出现以下错误提示:data = numpy.load('y_train.p') File "D:\Python37\lib\site-packages\numpy\lib\npyio.py", line 457, in load raise ValueError("Canno...原创 2020-03-03 20:31:46 · 48174 阅读 · 1 评论