import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as manimation
import matplotlib.animation as anim
df = pd.read_csv('https://opendata.ecdc.europa.eu/covid19/casedistribution/csv/data.csv')
df.head()
dateRep | day | month | year | cases | deaths | countriesAndTerritories | geoId | countryterritoryCode | popData2019 | continentExp | Cumulative_number_for_14_days_of_COVID-19_cases_per_100000 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 14/12/2020 | 14 | 12 | 2020 | 746 | 6 | Afghanistan | AF | AFG | 38041757.0 | Asia | 9.013779 |
1 | 13/12/2020 | 13 | 12 | 2020 | 298 | 9 | Afghanistan | AF | AFG | 38041757.0 | Asia | 7.052776 |
2 | 12/12/2020 | 12 | 12 | 2020 | 113 | 11 | Afghanistan | AF | AFG | 38041757.0 | Asia | 6.868768 |
3 | 11/12/2020 | 11 | 12 | 2020 | 63 | 10 | Afghanistan | AF | AFG | 38041757.0 | Asia | 7.134266 |
4 | 10/12/2020 | 10 | 12 | 2020 | 202 | 16 | Afghanistan | AF | AFG | 38041757.0 | Asia | 6.968658 |
Nous n'allons pas utiliser toutes les données.
df = df[['dateRep', 'countriesAndTerritories', 'cases']]
df
dateRep | countriesAndTerritories | cases | |
---|---|---|---|
0 | 14/12/2020 | Afghanistan | 746 |
1 | 13/12/2020 | Afghanistan | 298 |
2 | 12/12/2020 | Afghanistan | 113 |
3 | 11/12/2020 | Afghanistan | 63 |
4 | 10/12/2020 | Afghanistan | 202 |
... | ... | ... | ... |
61895 | 25/03/2020 | Zimbabwe | 0 |
61896 | 24/03/2020 | Zimbabwe | 0 |
61897 | 23/03/2020 | Zimbabwe | 0 |
61898 | 22/03/2020 | Zimbabwe | 1 |
61899 | 21/03/2020 | Zimbabwe | 1 |
61900 rows × 3 columns
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 61900 entries, 0 to 61899 Data columns (total 3 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 dateRep 61900 non-null object 1 countriesAndTerritories 61900 non-null object 2 cases 61900 non-null int64 dtypes: int64(1), object(2) memory usage: 1.4+ MB
df.dtypes
dateRep object countriesAndTerritories object cases int64 dtype: object
df['date'] = pd.to_datetime(df['dateRep'], dayfirst=True)
df
dateRep | countriesAndTerritories | cases | date | |
---|---|---|---|---|
0 | 14/12/2020 | Afghanistan | 746 | 2020-12-14 |
1 | 13/12/2020 | Afghanistan | 298 | 2020-12-13 |
2 | 12/12/2020 | Afghanistan | 113 | 2020-12-12 |
3 | 11/12/2020 | Afghanistan | 63 | 2020-12-11 |
4 | 10/12/2020 | Afghanistan | 202 | 2020-12-10 |
... | ... | ... | ... | ... |
61895 | 25/03/2020 | Zimbabwe | 0 | 2020-03-25 |
61896 | 24/03/2020 | Zimbabwe | 0 | 2020-03-24 |
61897 | 23/03/2020 | Zimbabwe | 0 | 2020-03-23 |
61898 | 22/03/2020 | Zimbabwe | 1 | 2020-03-22 |
61899 | 21/03/2020 | Zimbabwe | 1 | 2020-03-21 |
61900 rows × 4 columns
df = df.drop(columns = ['dateRep'])
df
countriesAndTerritories | cases | date | |
---|---|---|---|
0 | Afghanistan | 746 | 2020-12-14 |
1 | Afghanistan | 298 | 2020-12-13 |
2 | Afghanistan | 113 | 2020-12-12 |
3 | Afghanistan | 63 | 2020-12-11 |
4 | Afghanistan | 202 | 2020-12-10 |
... | ... | ... | ... |
61895 | Zimbabwe | 0 | 2020-03-25 |
61896 | Zimbabwe | 0 | 2020-03-24 |
61897 | Zimbabwe | 0 | 2020-03-23 |
61898 | Zimbabwe | 1 | 2020-03-22 |
61899 | Zimbabwe | 1 | 2020-03-21 |
61900 rows × 3 columns
df['total_cases'] = df.sort_values('date').groupby('countriesAndTerritories').cumsum().sort_index()
df
countriesAndTerritories | cases | date | total_cases | |
---|---|---|---|---|
0 | Afghanistan | 746 | 2020-12-14 | 49273 |
1 | Afghanistan | 298 | 2020-12-13 | 48527 |
2 | Afghanistan | 113 | 2020-12-12 | 48229 |
3 | Afghanistan | 63 | 2020-12-11 | 48116 |
4 | Afghanistan | 202 | 2020-12-10 | 48053 |
... | ... | ... | ... | ... |
61895 | Zimbabwe | 0 | 2020-03-25 | 2 |
61896 | Zimbabwe | 0 | 2020-03-24 | 2 |
61897 | Zimbabwe | 0 | 2020-03-23 | 2 |
61898 | Zimbabwe | 1 | 2020-03-22 | 2 |
61899 | Zimbabwe | 1 | 2020-03-21 | 1 |
61900 rows × 4 columns
df = df[['date', 'countriesAndTerritories', 'total_cases']]
df = df.rename(columns={'countriesAndTerritories': 'country'})
df
date | country | total_cases | |
---|---|---|---|
0 | 2020-12-14 | Afghanistan | 49273 |
1 | 2020-12-13 | Afghanistan | 48527 |
2 | 2020-12-12 | Afghanistan | 48229 |
3 | 2020-12-11 | Afghanistan | 48116 |
4 | 2020-12-10 | Afghanistan | 48053 |
... | ... | ... | ... |
61895 | 2020-03-25 | Zimbabwe | 2 |
61896 | 2020-03-24 | Zimbabwe | 2 |
61897 | 2020-03-23 | Zimbabwe | 2 |
61898 | 2020-03-22 | Zimbabwe | 2 |
61899 | 2020-03-21 | Zimbabwe | 1 |
61900 rows × 3 columns
pivot_table
¶df = pd.pivot_table(df, index=['date'], columns=['country'], values=['total_cases'])
df
total_cases | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
country | Afghanistan | Albania | Algeria | Andorra | Angola | Anguilla | Antigua_and_Barbuda | Argentina | Armenia | Aruba | ... | Uruguay | Uzbekistan | Vanuatu | Venezuela | Vietnam | Wallis_and_Futuna | Western_Sahara | Yemen | Zambia | Zimbabwe |
date | |||||||||||||||||||||
2019-12-31 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-01 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-02 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-03 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-04 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2020-12-10 | 48053.0 | 45188.0 | 90014.0 | 7162.0 | 15804.0 | 10.0 | 146.0 | 1475222.0 | 145240.0 | 4996.0 | ... | 8104.0 | 74498.0 | 1.0 | 105852.0 | 1381.0 | 3.0 | 766.0 | 2079.0 | 18062.0 | 11007.0 |
2020-12-11 | 48116.0 | 46061.0 | 90579.0 | 7190.0 | 15925.0 | 10.0 | 146.0 | 1482216.0 | 146317.0 | 5011.0 | ... | 8487.0 | 74664.0 | 1.0 | 106280.0 | 1385.0 | 3.0 | 766.0 | 2081.0 | 18091.0 | 11081.0 |
2020-12-12 | 48229.0 | 46863.0 | 91121.0 | 7236.0 | 16061.0 | 10.0 | 147.0 | 1489328.0 | 147312.0 | 5031.0 | ... | 8849.0 | 74811.0 | 1.0 | 106715.0 | 1391.0 | 3.0 | 766.0 | 2082.0 | 18161.0 | 11162.0 |
2020-12-13 | 48527.0 | 47742.0 | 91638.0 | 7288.0 | 16161.0 | 10.0 | 148.0 | 1494602.0 | 148325.0 | 5044.0 | ... | 9180.0 | 74956.0 | 1.0 | 106715.0 | 1395.0 | 3.0 | 766.0 | 2083.0 | 18217.0 | 11219.0 |
2020-12-14 | 49273.0 | 48530.0 | 92102.0 | 7338.0 | 16188.0 | 10.0 | 148.0 | 1498160.0 | 148682.0 | 5049.0 | ... | 9708.0 | 75094.0 | 1.0 | 107177.0 | 1397.0 | 3.0 | 766.0 | 2083.0 | 18274.0 | 11246.0 |
350 rows × 214 columns
df.columns
MultiIndex([('total_cases', 'Afghanistan'), ('total_cases', 'Albania'), ('total_cases', 'Algeria'), ('total_cases', 'Andorra'), ('total_cases', 'Angola'), ('total_cases', 'Anguilla'), ('total_cases', 'Antigua_and_Barbuda'), ('total_cases', 'Argentina'), ('total_cases', 'Armenia'), ('total_cases', 'Aruba'), ... ('total_cases', 'Uruguay'), ('total_cases', 'Uzbekistan'), ('total_cases', 'Vanuatu'), ('total_cases', 'Venezuela'), ('total_cases', 'Vietnam'), ('total_cases', 'Wallis_and_Futuna'), ('total_cases', 'Western_Sahara'), ('total_cases', 'Yemen'), ('total_cases', 'Zambia'), ('total_cases', 'Zimbabwe')], names=[None, 'country'], length=214)
df.index.name = None
df.columns = [col[1] for col in df.columns]
df
Afghanistan | Albania | Algeria | Andorra | Angola | Anguilla | Antigua_and_Barbuda | Argentina | Armenia | Aruba | ... | Uruguay | Uzbekistan | Vanuatu | Venezuela | Vietnam | Wallis_and_Futuna | Western_Sahara | Yemen | Zambia | Zimbabwe | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2019-12-31 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-01 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-02 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-03 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
2020-01-04 | 0.0 | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN | 0.0 | NaN | ... | NaN | NaN | NaN | NaN | 0.0 | NaN | NaN | NaN | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2020-12-10 | 48053.0 | 45188.0 | 90014.0 | 7162.0 | 15804.0 | 10.0 | 146.0 | 1475222.0 | 145240.0 | 4996.0 | ... | 8104.0 | 74498.0 | 1.0 | 105852.0 | 1381.0 | 3.0 | 766.0 | 2079.0 | 18062.0 | 11007.0 |
2020-12-11 | 48116.0 | 46061.0 | 90579.0 | 7190.0 | 15925.0 | 10.0 | 146.0 | 1482216.0 | 146317.0 | 5011.0 | ... | 8487.0 | 74664.0 | 1.0 | 106280.0 | 1385.0 | 3.0 | 766.0 | 2081.0 | 18091.0 | 11081.0 |
2020-12-12 | 48229.0 | 46863.0 | 91121.0 | 7236.0 | 16061.0 | 10.0 | 147.0 | 1489328.0 | 147312.0 | 5031.0 | ... | 8849.0 | 74811.0 | 1.0 | 106715.0 | 1391.0 | 3.0 | 766.0 | 2082.0 | 18161.0 | 11162.0 |
2020-12-13 | 48527.0 | 47742.0 | 91638.0 | 7288.0 | 16161.0 | 10.0 | 148.0 | 1494602.0 | 148325.0 | 5044.0 | ... | 9180.0 | 74956.0 | 1.0 | 106715.0 | 1395.0 | 3.0 | 766.0 | 2083.0 | 18217.0 | 11219.0 |
2020-12-14 | 49273.0 | 48530.0 | 92102.0 | 7338.0 | 16188.0 | 10.0 | 148.0 | 1498160.0 | 148682.0 | 5049.0 | ... | 9708.0 | 75094.0 | 1.0 | 107177.0 | 1397.0 | 3.0 | 766.0 | 2083.0 | 18274.0 | 11246.0 |
350 rows × 214 columns
df = df.fillna(0).astype(int)
df
Afghanistan | Albania | Algeria | Andorra | Angola | Anguilla | Antigua_and_Barbuda | Argentina | Armenia | Aruba | ... | Uruguay | Uzbekistan | Vanuatu | Venezuela | Vietnam | Wallis_and_Futuna | Western_Sahara | Yemen | Zambia | Zimbabwe | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2019-12-31 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-04 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2020-12-10 | 48053 | 45188 | 90014 | 7162 | 15804 | 10 | 146 | 1475222 | 145240 | 4996 | ... | 8104 | 74498 | 1 | 105852 | 1381 | 3 | 766 | 2079 | 18062 | 11007 |
2020-12-11 | 48116 | 46061 | 90579 | 7190 | 15925 | 10 | 146 | 1482216 | 146317 | 5011 | ... | 8487 | 74664 | 1 | 106280 | 1385 | 3 | 766 | 2081 | 18091 | 11081 |
2020-12-12 | 48229 | 46863 | 91121 | 7236 | 16061 | 10 | 147 | 1489328 | 147312 | 5031 | ... | 8849 | 74811 | 1 | 106715 | 1391 | 3 | 766 | 2082 | 18161 | 11162 |
2020-12-13 | 48527 | 47742 | 91638 | 7288 | 16161 | 10 | 148 | 1494602 | 148325 | 5044 | ... | 9180 | 74956 | 1 | 106715 | 1395 | 3 | 766 | 2083 | 18217 | 11219 |
2020-12-14 | 49273 | 48530 | 92102 | 7338 | 16188 | 10 | 148 | 1498160 | 148682 | 5049 | ... | 9708 | 75094 | 1 | 107177 | 1397 | 3 | 766 | 2083 | 18274 | 11246 |
350 rows × 214 columns
Cases_on_an_international_conveyance_Japan
¶Cases_on_an_international_conveyance_Japan: c'est un bateau qui a été considéré comme un pays
df['Cases_on_an_international_conveyance_Japan']
2019-12-31 0 2020-01-01 0 2020-01-02 0 2020-01-03 0 2020-01-04 0 .. 2020-12-10 0 2020-12-11 0 2020-12-12 0 2020-12-13 0 2020-12-14 0 Name: Cases_on_an_international_conveyance_Japan, Length: 350, dtype: int32
df = df.drop(columns=['Cases_on_an_international_conveyance_Japan'])
df
Afghanistan | Albania | Algeria | Andorra | Angola | Anguilla | Antigua_and_Barbuda | Argentina | Armenia | Aruba | ... | Uruguay | Uzbekistan | Vanuatu | Venezuela | Vietnam | Wallis_and_Futuna | Western_Sahara | Yemen | Zambia | Zimbabwe | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2019-12-31 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-04 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2020-12-10 | 48053 | 45188 | 90014 | 7162 | 15804 | 10 | 146 | 1475222 | 145240 | 4996 | ... | 8104 | 74498 | 1 | 105852 | 1381 | 3 | 766 | 2079 | 18062 | 11007 |
2020-12-11 | 48116 | 46061 | 90579 | 7190 | 15925 | 10 | 146 | 1482216 | 146317 | 5011 | ... | 8487 | 74664 | 1 | 106280 | 1385 | 3 | 766 | 2081 | 18091 | 11081 |
2020-12-12 | 48229 | 46863 | 91121 | 7236 | 16061 | 10 | 147 | 1489328 | 147312 | 5031 | ... | 8849 | 74811 | 1 | 106715 | 1391 | 3 | 766 | 2082 | 18161 | 11162 |
2020-12-13 | 48527 | 47742 | 91638 | 7288 | 16161 | 10 | 148 | 1494602 | 148325 | 5044 | ... | 9180 | 74956 | 1 | 106715 | 1395 | 3 | 766 | 2083 | 18217 | 11219 |
2020-12-14 | 49273 | 48530 | 92102 | 7338 | 16188 | 10 | 148 | 1498160 | 148682 | 5049 | ... | 9708 | 75094 | 1 | 107177 | 1397 | 3 | 766 | 2083 | 18274 | 11246 |
350 rows × 213 columns
df.columns = [col.replace('_', ' ') for col in df.columns]
df
Afghanistan | Albania | Algeria | Andorra | Angola | Anguilla | Antigua and Barbuda | Argentina | Armenia | Aruba | ... | Uruguay | Uzbekistan | Vanuatu | Venezuela | Vietnam | Wallis and Futuna | Western Sahara | Yemen | Zambia | Zimbabwe | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2019-12-31 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-01 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-02 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-03 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2020-01-04 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2020-12-10 | 48053 | 45188 | 90014 | 7162 | 15804 | 10 | 146 | 1475222 | 145240 | 4996 | ... | 8104 | 74498 | 1 | 105852 | 1381 | 3 | 766 | 2079 | 18062 | 11007 |
2020-12-11 | 48116 | 46061 | 90579 | 7190 | 15925 | 10 | 146 | 1482216 | 146317 | 5011 | ... | 8487 | 74664 | 1 | 106280 | 1385 | 3 | 766 | 2081 | 18091 | 11081 |
2020-12-12 | 48229 | 46863 | 91121 | 7236 | 16061 | 10 | 147 | 1489328 | 147312 | 5031 | ... | 8849 | 74811 | 1 | 106715 | 1391 | 3 | 766 | 2082 | 18161 | 11162 |
2020-12-13 | 48527 | 47742 | 91638 | 7288 | 16161 | 10 | 148 | 1494602 | 148325 | 5044 | ... | 9180 | 74956 | 1 | 106715 | 1395 | 3 | 766 | 2083 | 18217 | 11219 |
2020-12-14 | 49273 | 48530 | 92102 | 7338 | 16188 | 10 | 148 | 1498160 | 148682 | 5049 | ... | 9708 | 75094 | 1 | 107177 | 1397 | 3 | 766 | 2083 | 18274 | 11246 |
350 rows × 213 columns
country_reserved = set()
for index, row in df.iterrows():
country_reserved |= set(row[row > 0].sort_values(ascending=False).head(10).index)
df = df[list(country_reserved)]
df.shape
(350, 30)
#!pip install bar-chart-race
import bar_chart_race as bcr
bcr.bar_chart_race(
df=df,
filename='video.mp4',
n_bars=10,
period_fmt='%B %d, %Y',
title='COVID-19 Confirmed Cases by Country'
)
C:\Users\Pb\anaconda3\envs\Franckeale04\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\Pb\anaconda3\envs\Franckeale04\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()))
import matplotlib.animation as manimation; manimation.writers.list()
['pillow', 'ffmpeg', 'ffmpeg_file', 'html']