我对python很陌生,我只需要它,所以我分析了一些生物数据。
请帮助我如何解决以下错误,
could not convert string to float
我正在尝试绘制(时间,距离)
以下是一些示例数据:
Nematode No. 1 1 2 2
No. of jumps Time (sec) Distance (mm) Time Distance
1 0.195781141 0.893988392 1.25388 0.56569
2 2.386623538 1.073359412 3.5848484 1.55656
3 2.915538343 1.227371636 4.284848 2.34454545
4 4.993603286 0.653631116 6.4545454 3.65445
5 8.002735854 0.986036142 2.35554 0.2548545
6 10.84267517 0.939671599 4.245454 0.5484848
我的代码(还)
from mmap import mmap,ACCESS_READ
from xlrd import open_workbook
from pylab import *
from xlrd import open_workbook,XL_CELL_TEXT
import csv
from scipy import stats
values = csv.reader(open('simple.csv', 'rb'), delimiter=',',skipinitialspace=True)
for column in values:
print column[1],column[2]
Time = column[1]
Distance = column[2]
plot(Time,Distance)
show()