Home
Sign Up
Sign In
0.05
V2EX
›
问与答
Python 简单数据处理
DJI360
·
Mar 10, 2020
· 1417 views
This topic created in 2452 days ago, the information mentioned may be changed or developed.
从 txt 读取了很多数据,要都转成 float 的列表有什么快速的方法吗
Python
float
txt
读取
7 replies
•
2020-03-10 18:41:56 +08:00
imkuang
Mar 10, 2020
1
float_list = list(map(float,str_list))
DJI360
OP
Mar 10, 2020
2
@
xiri
这个还是不够块,几千乘几千的二维矩阵转换就得四五秒
ipwx
Mar 10, 2020
3
??? 你的数据量级多少,格式什么样的,一概没说,我们怎么评价?
ipwx
Mar 10, 2020
4
够标准可以考虑
https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html
DJI360
OP
Mar 10, 2020
5
数据大概十万,每条数据两千个数吧
imkuang
Mar 10, 2020
6
@
hfutzj
矩阵吗?那用楼上说的 numpy.loadtxt()不知道咋样
DJI360
OP
Mar 10, 2020 via Android
7
@
xiri
实测速度没有明显区别,可能是我这个数据量不算非常大
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
3913 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 09:44
·
PVG 17:44
·
LAX 01:44
·
JFK 04:44
♥ Do have faith in what you're doing.
❯