Python初心者です。以下のようなコードを書いたのですが、上手くいきません。
なぜでしょうか?ご親切な方のご回答をお待ちしております。
import pandas as pd import numpy as np import plotly.graph_objects as go df = pd.read_csv('toyota_stock.csv') df.head()
エラーメッセージ
Traceback (most recent call last):
File "C:\Users\cjrr6\Desktop\toyota_stock.py", line 7, in <module>
df = pd.read_csv('toyota_stock.csv')
File "C:\Users\cjrr6\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pandas\io\parsers.py", line 688, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\Users\cjrr6\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pandas\io\parsers.py", line 454, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "C:\Users\cjrr6\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pandas\io\parsers.py", line 948, in init
self._make_engine(self.engine)
File "C:\Users\cjrr6\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pandas\io\parsers.py", line 1180, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "C:\Users\cjrr6\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pandas\io\parsers.py", line 2010, in init
self._reader = parsers.TextReader(src, **kwds)
File "pandas_libs\parsers.pyx", line 537, in pandas._libs.parsers.TextReader.cinit
File "pandas_libs\parsers.pyx", line 740, in pandas._libs.parsers.TextReader._get_header
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x93 in position 0: invalid start byte
回答1件
あなたの回答
tips
プレビュー