인프런 업데이트 소식 🔨👷🏼‍♂️

numpy로 loadtxt 할 때 이런 오류가 뜨는데 도대체 뭔가요 ㅠㅠ?

미해결질문
김지우 프로필

<class 'tuple'>: (<class 'ValueError'>, ValueError('could not convert string to float: \'"-0.0588235\''), None)

본래 오류는

Traceback (most recent call last):

File "/Users/gimjiu/PycharmProjects/tensorflow/logistic_classification-2.py", line 4, in

xy = np.loadtxt('data-03-diabetes.csv', delimiter=',', dtype=np.float32, skiprows=2)

File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1134, in loadtxt

for x in read_data(_loadtxt_chunksize):

File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1061, in read_data

items = [conv(val) for (conv, val) in zip(converters, vals)]

File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1061, in

items = [conv(val) for (conv, val) in zip(converters, vals)]

File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/npyio.py", line 768, in floatconv

return float(x)

ValueError: could not convert string to float: '"-0.0588235'

이런 오류여서 디버깅했더니 저렇게 나오더라구요 검색해보니까 비슷한 오류일 때 encoding을 utf-8-sig로 하면 된다 해서 바꿨는데도 똑같은 오류가 뜨네요 ㅠㅠ