를 작동 튜플 나는 다음과 같은 기능을 썼다 :변환이 간헐적으로
읽고 잘 튜플 this file로 변환def read_data(filename):
lines = [line.strip() for line in open(filename)]
coordinates = [line.split(' ') for line in lines]
coordinates = [(float(c[0]), float(c[1])) for c in coordinates]
return tuple(coordinates)
.
그러나 this file 및 this one에서 실패합니다.
coordinates = [(float(c[0]), float(c[1])) for c in coordinates]
ValueError: could not convert string to float:
왜이 오류가 나타나지 않고 problem0.dat을 읽을 때 왜 나타나지 않습니다
와?