convert string list to decimal list to 10 decimal points in python -
how convert folowing list:
['524.7940719572', '0.1874483617', '0.0321140582', '228.8002278843', '6843.5984811891', '29.9108027316', '60.2048797607', '220.7372120052', '556.828334181']
to:
[524.7940719572, 0.1874483617, 0.0321140582, 228.8002278843, 6843.5984811891, 29.9108027316, 60.2048797607, 220.7372120052, 556.828334181] in python
l = ['524.7940719572', '0.1874483617', '0.0321140582', '228.8002278843', '6843.5984811891', '29.9108027316', '60.2048797607', '220.7372120052', '556.828334181'] = 0 v in l: l[i] = float(v) = i+1 print l
results following output:
[524.7940719572, 0.1874483617, 0.0321140582, 228.8002278843, 6843.5984811891, 29.9108027316, 60.2048797607, 220.7372120052, 556.828334181]
Comments
Post a Comment