从网上都有这段代码,但是就我的报错:
搞了好久了,毫无头绪
解决后 直接给悬赏
import pandas_alive
import pandas as pd
covid_df = pd.read_csv('data/covid19.csv', index_col=0, parse_dates=[0])
covid_df.plot_animated(filename='examples/example-barh-chart.gif', n_visible=15)
报错:
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe C:/wj/aoyu/ayu.py
Generating BarChartRace, plotting ['Belgium', 'Brazil', 'Canada', 'China', 'France', 'Germany', 'India', 'Indonesia', 'Iran', 'Ireland', 'Italy', 'Mexico', 'Netherlands', 'Portugal', 'Spain', 'Sweden', 'Switzerland', 'Turkey', 'USA', 'United Kingdom']
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas_alive\charts.py:221: UserWarning: FixedFormatter should only be used together with FixedLocator
ax.set_yticklabels(self.df.columns)
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas_alive\charts.py:222: UserWarning: FixedFormatter should only be used together with FixedLocator
ax.set_xticklabels([max_val] * len(ax.get_xticks()))
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\animation.py:973: UserWarning: Animation was deleted without rendering anything. This is most likely unintended. To prevent deletion, assign the Animation to a variable that exists for as long as you need the Animation.
warnings.warn(
Process finished with exit code 0