Home>

I'm new to Python. I wrote the following code, but it doesn't work.
Why? We look forward to hearing from you.

import pandas as pd
import numpy as np
import plotly.graph_objects as go
df = pd.read_csv ('toyota_stock.csv')
df.head ()

Error message

Traceback (most recent call last):
File "C: \ Users \ cjrr6 \ Desktop \ toyota_stock.py", line 7, in
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, ininit 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, ininit
self._reader = parsers.TextReader (src, ** kwds)
File "pandas \ _ libs \ parser.pyx", line 537, in pandas ._libs.parsers.TextReader.cinit
File "pandas \ _ libs \ parser.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