Как иправить ошибку UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in invalid start byte
import time
start_time = time.time()
fig=None
import pandas as pd
df = pd.read_csv('data/2020_ready.csv',encoding='utf-8', index_col='date', parse_dates=['date'])#,
import bar_chart_race as bcr
#df = bcr.load_dataset('data/videogame', index_col='date')
bcr.bar_chart_race(
df=df,
filename='test1.mp4',
orientation='h',
sort='desc',
n_bars=30,
fixed_order=False,
fixed_max=False,
steps_per_period=20,
interpolate_period=False,
label_bars=True,
bar_size=.95,
period_label={'x': .99, 'y': .20, 'ha': 'right', 'va': 'center', 'size': 20},
period_fmt='%B %Y',
period_summary_func=lambda v, r: {'x': .99, 'y': .10,
's': f'Top 10 views: {v.nlargest(10).sum():,.0f}',
'ha': 'right', 'size': 10, 'family': 'Tahoma'},
#perpendicular_bar_func='median',
period_length=1000,
figsize=(8, 4.5),
dpi=240,
cmap='dark24',
title='Most popular',
title_size='',
bar_label_size=7,
tick_label_size=7,
shared_fontdict={'family' : 'Tahoma', 'color' : '.1'},
scale='linear',
writer=None,
fig=fig,
bar_kwargs={'alpha': .7},
filter_column_colors=True)
print("--- %s seconds ---" % (time.time() - start_time))
эти данные вставить в эксель
data 50 Cent Aaliyah Aaron Carter Aaron Paul Adam Driver Adam Levine
01.07.2015 10043 6454 1943 5691 2562 8765
02.07.2015 9722 7383 1853 5319 2458 8497
03.07.2015 8880 6298 1764 5271 3737 8940
04.07.2015 11003 6113 1657 5425 3017 9703
05.07.2015 11166 6091 1835 6724 3172 9920
06.07.2015 20089 5838 1800 6088 3343 8358
07.07.2015 14031 6357 1794 5771 2807 9752
08.07.2015 11580 6580 1805 6432 2715 7835
09.07.2015 10300 6680 1867 5943 2277 10472
10.07.2015 12415 7575 1678 6059 2448 8778
11.07.2015 10415 8769 1742 6538 8342 9998
12.07.2015 11614 7054 1876 7188 7343 9853
13.07.2015 46312 6437 1792 6761 6171 8756
14.07.2015 47444 5812 1886 5827 4744 10374
При таком большом количестве данных выписывает ошибку. Как эту ошибку проигнорировать или исправить?
Traceback (most recent call last):
File "C:\!!!1\1prog\rantings\2.py", line 21, in <module>
df = pd.read_csv('data/2020rating.csv',encoding='utf-8', index_col='data', parse_dates=['data'])#,
File "C:\Python38\lib\site-packages\pandas\io\parsers.py", line 676, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Python38\lib\site-packages\pandas\io\parsers.py", line 448, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "C:\Python38\lib\site-packages\pandas\io\parsers.py", line 880, in __init__
self._make_engine(self.engine)
File "C:\Python38\lib\site-packages\pandas\io\parsers.py", line 1114, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "C:\Python38\lib\site-packages\pandas\io\parsers.py", line 1891, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas\_libs\parsers.pyx", line 529, in pandas._libs.parsers.TextReader.__cinit__
File "pandas\_libs\parsers.pyx", line 720, in pandas._libs.parsers.TextReader._get_header
File "pandas\_libs\parsers.pyx", line 916, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas\_libs\parsers.pyx", line 2063, in pandas._libs.parsers.raise_parser_error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 4492: invalid continuation byte
