###実現したいこと・実行したこと
JyputerLabでbar_chart_raceを行いたいと思い以下のようなコード実行しました。
コードは以下の通りです、
import pandas as pd import bar_chart_race as bcr df = pd.read_csv('tennis.csv') bcr.bar_chart_race(df)
tennis.csvの中身は以下のようになります
week_title player_slug ranking_points 0 2000/1/31 andre agassi 5045 1 2000/1/31 gustavo kuerten 2169 2 2000/1/31 magnus norman 2083 3 2000/1/31 marcelo rios 1846 4 2000/1/31 nicolas kiefer 2325
###エラー
実行したら次のようなエラーが発生しました。
C:\Users\user\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py:286: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_yticklabels(self.df_values.columns) C:\Users\user\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py:287: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_xticklabels([max_val] * len(ax.get_xticks())) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in make_animation(self) 427 if self.html: --> 428 ret_val = anim.to_html5_video() 429 try: ~\anaconda3\lib\site-packages\matplotlib\animation.py in to_html5_video(self, embed_limit) 1315 # appropriate size for the tag -> 1316 Writer = writers[mpl.rcParams['animation.writer']] 1317 writer = Writer(codec='h264', ~\anaconda3\lib\site-packages\matplotlib\animation.py in __getitem__(self, name) 165 return self._registered[name] --> 166 raise RuntimeError(f"Requested MovieWriter ({name}) not available") 167 RuntimeError: Requested MovieWriter (ffmpeg) not available During handling of the above exception, another exception occurred: Exception Traceback (most recent call last) <ipython-input-4-bdeaf7844271> in <module> ----> 1 bcr.bar_chart_race(df) ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors) 781 figsize, cmap, title, title_size, bar_label_size, tick_label_size, 782 shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors) --> 783 return bcr.make_animation() 784 785 def load_dataset(name='covid19'): ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in make_animation(self) 444 else: 445 message = str(e) --> 446 raise Exception(message) 447 finally: 448 plt.rcParams = self.orig_rcParams Exception: You do not have ffmpeg installed on your machine. Download ffmpeg from here: https://www.ffmpeg.org/download.html. Matplotlib's original error message below: Requested MovieWriter (ffmpeg) not available
###試したこと
https://www.gyan.dev/ffmpeg/builds/
からreleaseにあるhttps://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7zを
ダウンロードし、解凍したものをProgram Filesに置きました。その後、システム環境変数の
PathにC:\Program Files\ffmpeg-4.3.2-2021-02-20-full_build\binを通したのですが上記のエラーが変わらず発生します。
回答1件
あなたの回答
tips
プレビュー