| ²é¿´: 6220 | »Ø¸´: 5 | |||
| µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû | |||
lanmoaгæ (³õÈëÎÄ̳)
|
[ÇóÖú]
ÐÂÊÖµ¼Èëcsv¹ý³ÌÖÐ×ÜÊdzöÏÖpython could not convert string to float ÒÑÓÐ1È˲ÎÓë
|
||
|
³ÌÐò£º image_path = r'C:\Users\abc\Documents\csv_result\cracking\41.csv' with open(image_path,'r') as image_file: image_string = image_file.read() image_string = image_string.replace(' ','').replace('\n',',').replace('\t','') print(image_string) image_data = image_string.split(',') print(image_data) image_data_values = [float(x) for x in image_data] print (image_string) ǰÁ½¸ö½á¹û1 -11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.26,-11.2 ½á¹û2 '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', '-11.26', È»ºó±¨´í ValueError Traceback (most recent call last) <ipython-input-27-225cd40ddc4d> in <module>() 6 image_data = image_string.split(',') 7 print(image_data) ----> 8 image_data_values = [float(x) for x in image_data] 9 print (image_string) <ipython-input-27-225cd40ddc4d> in <listcomp>(.0) 6 image_data = image_string.split(',') 7 print(image_data) ----> 8 image_data_values = [float(x) for x in image_data] 9 print (image_string) ValueError: could not convert string to float: ![]() ![]() ![]() Ϊʲô£¿ |
» ²ÂÄãϲ»¶
288Çóµ÷¼Á
ÒѾÓÐ5È˻ظ´
281Çóµ÷¼Á£¨0805£©
ÒѾÓÐ19È˻ظ´
²ÄÁÏ¿¼Ñе÷¼Á
ÒѾÓÐ3È˻ظ´
346Çóµ÷¼Á[0856]
ÒѾÓÐ6È˻ظ´
294Çóµ÷¼Á²ÄÁÏÓ뻯¹¤×¨Ë¶
ÒѾÓÐ9È˻ظ´
328Çóµ÷¼Á£¬Ó¢ÓïÁù¼¶551£¬ÓпÆÑоÀú
ÒѾÓÐ12È˻ظ´
Ò»Ö¾Ô¸Î÷°²½»Í¨´óѧ²ÄÁϹ¤³Ìרҵ 282·ÖÇóµ÷¼Á
ÒѾÓÐ5È˻ظ´
085601²ÄÁϹ¤³Ìר˶Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
321Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
Ò»Ö¾Ô¸Öк£Ñó²ÄÁϹ¤³Ìר˶330·ÖÇóµ÷¼Á
ÒѾÓÐ7È˻ظ´
3Â¥2017-06-26 14:02:55
somomo91
ר¼Ò¹ËÎÊ (Ö°Òµ×÷¼Ò)
-

ר¼Ò¾Ñé: +3 - Ó¦Öú: 144 (¸ßÖÐÉú)
- ½ð±Ò: 19353
- ºì»¨: 115
- Ìû×Ó: 3854
- ÔÚÏß: 1053.2Сʱ
- ³æºÅ: 2399301
- ×¢²á: 2013-04-03
- רҵ: ¶¯Á¦Ñ§Óë¿ØÖÆ
- ¹ÜϽ: ¼ÆËãÄ£Äâ
2Â¥2017-06-22 19:16:29
4Â¥2017-06-26 14:03:57
me_yu
ľ³æ (ÕýʽдÊÖ)
- Ó¦Öú: 26 (СѧÉú)
- ½ð±Ò: 3369.5
- É¢½ð: 350
- ºì»¨: 7
- ɳ·¢: 1
- Ìû×Ó: 895
- ÔÚÏß: 468.1Сʱ
- ³æºÅ: 2533501
- ×¢²á: 2013-07-05
- רҵ: ¼ÆËã»úÈí¼þ

5Â¥2017-08-25 11:57:20














»Ø¸´´ËÂ¥