{"id":347998,"date":"2023-05-29T09:00:51","date_gmt":"2023-05-29T09:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347998"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347998","title":{"rendered":"<span>\u0427\u0442\u043e \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 Python \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c: 5 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u044e\u0449\u0435\u0439 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u043e\u0435-\u0447\u0442\u043e \u0435\u0449\u0451<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0442\u0430\u043a \u0438 \u0441\u0430\u043c\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0438\u0434\u043e\u0432, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u041e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u044b\u0445 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0445 \u0441 Python, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0439 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u2013 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u0434 \u043a\u0430\u0442. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 (\u0438\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451), \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043e\u0431\u0441\u0443\u0434\u0438\u043c. \u0427\u0442\u043e \u0436\u0435 \u2013 \u043f\u043e\u0435\u0445\u0430\u043b\u0438!  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/12d\/e13\/256\/12de13256afdf4c6d1a3653b7883f13c.png\" width=\"1920\" height=\"1080\"><\/figure>\n<h2>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a, \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435!<\/h2>\n<p>\u0418 \u043e\u043d\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c. \u0414\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0430\u043c\u044b\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0442\u0435\u043c\u0430\u043c \u0435\u0441\u0442\u044c \u043d\u0430 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438<a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_countries_by_carbon_dioxide_emissions\"><u> &#171;\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u0430\u043d \u043f\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u043e\u0433\u043e \u0433\u0430\u0437\u0430&#187;<\/u><\/a>.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0430\u0440\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438<a href=\"https:\/\/towardsdatascience.com\/9-visualizations-that-catch-more-attention-than-a-bar-chart-72d3aeb2e091\"><u> \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/u><\/a>:<\/p>\n<pre><code class=\"python\">import requests from bs4 import BeautifulSoup wikiurl='https:\/\/en.wikipedia.org\/wiki\/List_of_countries_by_carbon_dioxide_emissions' table_class='wikitable sortable jquery-tablesorter' response=requests.get(wikiurl) #status 200: \u0421\u0435\u0440\u0432\u0435\u0440 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 http print(response.status_code) <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c BeautifulSoup \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">soup = BeautifulSoup(response.text, 'html.parser') table = soup.find('table',{'class':\"wikitable\"}) df2018 = pd.read_html(str(table))[0] df2018<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c \u00ab\u0412\u044b\u0431\u0440\u043e\u0441\u044b \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u043e\u0433\u043e \u0433\u0430\u0437\u0430 \u0432 2018 \/ \u041e\u0431\u0449\u0438\u0435\u00bb \u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u044b \u0441 \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u043e\u0442 200 \u0434\u043e 1000 MT CO2e.<\/p>\n<pre><code class=\"python\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445  emi_ = df2018[('2018 CO2 emissions[21]', 'Total excluding LUCF[23]')] country_ = list(df2018[('Country[20]', 'Country[20]')]) country_mod = [i.replace('\\xa0',' ') for i in country_]  # \u0421\u043e\u0437\u0434\u0430\u0451\u043c DataFrame  df = pd.DataFrame(zip(country_mod,emi_), columns = ['countries', 'emission_2018'])  # \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043e \u0441\u0442\u0440\u0430\u043d\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c  df = df[df['countries']!='Serbia &amp; Montenegro']  df.iloc[:,1] = df.iloc[:,1].astype('float') df = df[(df['emission_2018']&gt;200) &amp; (df['emission_2018']&lt;1000)] df['percentage'] = [i*100\/sum(df['emission_2018']) for i in df['emission_2018']] df.head(9)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/044\/a4c\/0f9\/044a4c0f9cd2093e069146bcc3fd5315.png\" width=\"446\" height=\"404\"><\/figure>\n<h2>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439 \u044d\u0442\u043e<\/h2>\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0438 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u0415\u0441\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u2013 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0435 \u0441\u0442\u0430\u0442\u044c\u044f, \u0430 \u0441\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u043d\u043e\u0433\u0438\u0445 \u0442\u043e\u043c\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0431\u0435\u0440\u0435\u043c \u043f\u044f\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u044e\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e (\u0432\u0441\u0451 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e \u043d\u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445):<\/p>\n<ul>\n<li>\n<p>\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u041a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e (\u0432\u043e\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0440\u0443\u0433 \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u043c\u0438 \u043d\u0430 \u043d\u0435\u0439. \u0415\u0441\u0442\u044c \u0443 \u044d\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432-\u00ab\u0434\u043e\u0440\u043e\u0436\u0435\u043a\u00bb. \u0422\u0435, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u043b\u0438\u0436\u0435 \u043a \u0446\u0435\u043d\u0442\u0440\u0443 \u043a\u0440\u0443\u0433\u0430, \u043a\u043e\u0440\u043e\u0447\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e\u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0435\u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0441\u0442\u0430\u0434\u0438\u043e\u043d\u0430 \u0441 \u0431\u0435\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u043c\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0435\u0433\u0443\u0442 \u0430\u0442\u043b\u0435\u0442\u044b. <\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0432\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0441\u043f\u0430\u0440\u0441\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">import math plt.gcf().set_size_inches(12, 12) sns.set_style('darkgrid')  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f  max_val = max(df['emission_2018'])*1.01 ax = plt.subplot(projection='polar')  # \u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a  ax.set_theta_zero_location('N') ax.set_theta_direction(1) ax.set_rlabel_position(0) ax.set_thetagrids([], labels=[]) ax.set_rgrids(range(len(df)), labels= df['countries']) <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b7\/25e\/5cd\/3b725e5cd2bb287b372815028ae977b4.png\" width=\"602\" height=\"480\"><\/figure>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0451\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u044b\u043c \u0433\u0430\u0437\u043e\u043c (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438).<\/p>\n<h4>\u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u041e\u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u0435\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432.&nbsp; \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e. \u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"https:\/\/plotly.com\/python\/\">Plotly<\/a>.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.treemap(df, path=[px.Constant('Countries'), 'countries'],               values=df['emission_2018'],               color=df['emission_2018'],                  color_continuous_scale='Spectral_r',                  color_continuous_midpoint=np.average(df['emission_2018'])               ) fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) fig.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b2\/105\/aea\/8b2105aeac8a6a5be45cea6c99b1ab09.png\" width=\"602\" height=\"321\"><\/figure>\n<h4>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Plotly. \u041e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u0412\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.bar(df, x='countries', y='emission_2018', text='emission_2018',            color ='countries', color_discrete_sequence=pal_vi) fig.update_traces(texttemplate='%{text:.3s}', textposition='outside') fig.update_layout({'plot_bgcolor': 'white',                           'paper_bgcolor': 'white'}) fig.update_layout(width=1100, height=500,                margin = dict(t=15, l=15, r=15, b=15)) fig.show()<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/313\/793\/fdb\/313793fdb6e68a58e21f1ab16996641a.png\" width=\"602\" height=\"421\"><\/figure>\n<h4>\u041b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u0432\u0438\u0434 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0440\u044f\u0434\u043e\u043c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443, \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp; <\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.line_polar(df, r='emission_2018',                           theta='countries', line_close=True) fig.update_traces(fill='toself', line = dict(color=pal_spec[5])) fig.show()<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d24\/594\/aef\/d24594aef71098654648a1ab3eb8903f.png\" width=\"602\" height=\"452\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 DataFrame, \u0442\u043e \u0432\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.line_polar(df_s, r='emission_2018',                           theta='countries', line_close=True) fig.update_traces(fill='toself', line = dict(color=pal_spec[-5])) fig.show()<\/code><\/pre>\n<p>\u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:   <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb9\/1a7\/2c7\/cb91a72c780d508873871bca09d44c03.png\" width=\"602\" height=\"452\"><\/figure>\n<h4>\u041f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c. \u0420\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u0438\u0434\u0435 \u2014 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e, \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0440\u0443\u0436\u043a\u043e\u043c, \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0438 \u0442.\u043f. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 X, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Y \u0438 \u043c\u0435\u0442\u043e\u043a. <\/p>\n<pre><code class=\"python\"># \u0421\u0442\u043e\u043b\u0431\u0446\u044b \u043f\u043e \u043e\u0441\u044f\u043c X \u0438 Y  df_s['X'] = [1]*len(df_s) list_y = list(range(0,len(df_s))) list_y.reverse() df_s['Y'] = list_y  # \u0421\u0442\u043e\u043b\u0431\u0435\u0446 \u043c\u0435\u0442\u043e\u043a  df_s['labels'] = ['&lt;b&gt;'+i+'&lt;br&gt;'+format(j, \",\") for i,j in zip(df_s['countries'], df_s['emission_2018'])] df_s <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/719\/034\/d43\/719034d43af39180a882de1b2117c31b.png\" width=\"602\" height=\"287\"><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.scatter(df_s, x='X', y='Y',               color='countries', color_discrete_sequence=pal_vi,               size='emission_2018', text='labels', size_max=30) fig.update_layout(width=500, height=1100,                margin = dict(t=0, l=0, r=0, b=0),                showlegend=False               ) fig.update_traces(textposition='middle right') fig.update_xaxes(showgrid=False, zeroline=False, visible=False) fig.update_yaxes(showgrid=False, zeroline=False, visible=False) fig.update_layout({'plot_bgcolor': 'white',                           'paper_bgcolor': 'white'}) fig.show()<\/code><\/pre>\n<p>\u0418 \u0441\u0430\u043c\u0430 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/16d\/60c\/828\/16d60c82868f919d72e8ea862bbca666.png\" width=\"369\" height=\"1010\"><\/figure>\n<h2>\u0411\u043e\u043d\u0443\u0441. \u0410 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0451\u0442 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c?<\/h2>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 Python \u0435\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f FuncAnimation \u0438 \u0447\u0430\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0430 Animation \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Matplotlib \u0432 Python. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">import matplotlib.animation as ani animator = ani.FuncAnimation(fig, chartfunc, interval = 100)<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p>fig&nbsp; \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0438\u0441\u0443\u043d\u043a\u0430, \u0433\u0434\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>chartfunc\u200a \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443.<\/p>\n<\/li>\n<li>\n<p>Interval \u2014 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 \u0432 \u043c\u0441 (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u2014 \u0434\u043e 200).<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u0442\u043e <a href=\"https:\/\/matplotlib.org\/3.1.1\/api\/_as_gen\/matplotlib.animation.FuncAnimation.html#matplotlib.animation.FuncAnimation\">\u0432\u043e\u0442 \u043e\u043d\u0430<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0442\u0440\u0430\u043d\u0430\u043c.<\/p>\n<pre><code class=\"python\">import matplotlib.animation as ani import matplotlib.pyplot as plt import numpy as np import pandas as pd url = 'https:\/\/raw.githubusercontent.com\/CSSEGISandData\/COVID-19\/master\/csse_covid_19_data\/csse_covid_19_time_series \/time_series_covid19_deaths_global.csv' df = pd.read_csv(url, delimiter=',', header='infer') df_interest = df.loc[             df['Country\/Region'].isin(['United Kingdom', 'US', 'Italy', 'Germany'])             &amp; df['Province\/State'].isna()] df_interest.rename(             index=lambda x: df_interest.at[x, 'Country\/Region'], inplace=True) df1 = df_interest.transpose() df1 = df1.drop(['Province\/State', 'Country\/Region', 'Lat', 'Long']) df1 = df1.loc[(df1 != 0).any(1)] df1.index = pd.to_datetime(df1.index)<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d6\/097\/e7f\/1d6097e7f0a9ffd22f56c8d9ac490f09.png\" width=\"348\" height=\"240\"><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0438\u0441\u0443\u043d\u043a\u0430, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b x \u0438 y, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442\u0430 \u043b\u0438\u043d\u0438\u0439 \u0438 \u043f\u043e\u043b\u044f.<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt color = ['red', 'green', 'blue', 'orange'] fig = plt.figure() plt.xticks(rotation=45, ha=\"right\", rotation_mode=\"anchor\") #\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u0441\u0438 x plt.subplots_adjust(bottom = 0.2, top = 0.9) #\u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0434\u0430\u0442\u044b (\u043f\u043e \u043e\u0441\u0438 x) \u0443\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 plt.ylabel('No of Deaths') plt.xlabel('Dates')<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 &#8212; \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0440\u0438\u0432\u043e\u0439 \u0438 \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<pre><code class=\"python\">def buildmebarchart(i=int):             plt.legend(df1.columns)             p = plt.plot(df1[:i].index, df1[:i].values) #\u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0442\u043e\u0447\u043a\u0438 i             for i in range(0,4):            p[i].set_color(color[i]) #\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 importmatplotlib.animation as ani animator = ani.FuncAnimation(fig, buildmebarchart, interval = 100) plt.show()<\/code><\/pre>\n<p>\u0412\u043e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/e3\/jk\/-h\/e3jk-h13uemb3tmsce1f_chqzqk.gif\" width=\"640\" height=\"480\"><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u043d\u0435\u0447\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u043e\u0435. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0430\u0441\u044b \u0437\u0430 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/738208\/\"> https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/738208\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0442\u0430\u043a \u0438 \u0441\u0430\u043c\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0438\u0434\u043e\u0432, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u041e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u044b\u0445 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0445, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0445 \u0441 Python, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0439 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u2013 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u0434 \u043a\u0430\u0442. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 (\u0438\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451), \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043e\u0431\u0441\u0443\u0434\u0438\u043c. \u0427\u0442\u043e \u0436\u0435 \u2013 \u043f\u043e\u0435\u0445\u0430\u043b\u0438!  <\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a, \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435!<\/h2>\n<p>\u0418 \u043e\u043d\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c. \u0414\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0430\u043c\u044b\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0442\u0435\u043c\u0430\u043c \u0435\u0441\u0442\u044c \u043d\u0430 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438<a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_countries_by_carbon_dioxide_emissions\"><u> &#171;\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u0430\u043d \u043f\u043e \u0432\u044b\u0431\u0440\u043e\u0441\u0430\u043c \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u043e\u0433\u043e \u0433\u0430\u0437\u0430&#187;<\/u><\/a>.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0430\u0440\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438<a href=\"https:\/\/towardsdatascience.com\/9-visualizations-that-catch-more-attention-than-a-bar-chart-72d3aeb2e091\"><u> \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/u><\/a>:<\/p>\n<pre><code class=\"python\">import requests from bs4 import BeautifulSoup wikiurl='https:\/\/en.wikipedia.org\/wiki\/List_of_countries_by_carbon_dioxide_emissions' table_class='wikitable sortable jquery-tablesorter' response=requests.get(wikiurl) #status 200: \u0421\u0435\u0440\u0432\u0435\u0440 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 http print(response.status_code) <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c BeautifulSoup \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0440\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">soup = BeautifulSoup(response.text, 'html.parser') table = soup.find('table',{'class':\"wikitable\"}) df2018 = pd.read_html(str(table))[0] df2018<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c \u00ab\u0412\u044b\u0431\u0440\u043e\u0441\u044b \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u043e\u0433\u043e \u0433\u0430\u0437\u0430 \u0432 2018 \/ \u041e\u0431\u0449\u0438\u0435\u00bb \u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u044b \u0441 \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u0432 \u043e\u0442 200 \u0434\u043e 1000 MT CO2e.<\/p>\n<pre><code class=\"python\"># \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445  emi_ = df2018[('2018 CO2 emissions[21]', 'Total excluding LUCF[23]')] country_ = list(df2018[('Country[20]', 'Country[20]')]) country_mod = [i.replace('\\xa0',' ') for i in country_]  # \u0421\u043e\u0437\u0434\u0430\u0451\u043c DataFrame  df = pd.DataFrame(zip(country_mod,emi_), columns = ['countries', 'emission_2018'])  # \u0423\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043e \u0441\u0442\u0440\u0430\u043d\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c  df = df[df['countries']!='Serbia &amp; Montenegro']  df.iloc[:,1] = df.iloc[:,1].astype('float') df = df[(df['emission_2018']&gt;200) &amp; (df['emission_2018']&lt;1000)] df['percentage'] = [i*100\/sum(df['emission_2018']) for i in df['emission_2018']] df.head(9)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<figure class=\"\"><\/figure>\n<h2>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439 \u044d\u0442\u043e<\/h2>\n<p>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0438 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u0415\u0441\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u2013 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0435 \u0441\u0442\u0430\u0442\u044c\u044f, \u0430 \u0441\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u043d\u043e\u0433\u0438\u0445 \u0442\u043e\u043c\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0431\u0435\u0440\u0435\u043c \u043f\u044f\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u044e\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e (\u0432\u0441\u0451 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Python, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e \u043d\u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445):<\/p>\n<ul>\n<li>\n<p>\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043a\u0442\u043e\u0440\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u041a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e (\u0432\u043e\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u0440\u0443\u0433 \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u043c\u0438 \u043d\u0430 \u043d\u0435\u0439. \u0415\u0441\u0442\u044c \u0443 \u044d\u0442\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432-\u00ab\u0434\u043e\u0440\u043e\u0436\u0435\u043a\u00bb. \u0422\u0435, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u043b\u0438\u0436\u0435 \u043a \u0446\u0435\u043d\u0442\u0440\u0443 \u043a\u0440\u0443\u0433\u0430, \u043a\u043e\u0440\u043e\u0447\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e\u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0435\u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0441\u0442\u0430\u0434\u0438\u043e\u043d\u0430 \u0441 \u0431\u0435\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u043c\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0435\u0433\u0443\u0442 \u0430\u0442\u043b\u0435\u0442\u044b. <\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0432\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0441\u043f\u0430\u0440\u0441\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">import math plt.gcf().set_size_inches(12, 12) sns.set_style('darkgrid')  # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f  max_val = max(df['emission_2018'])*1.01 ax = plt.subplot(projection='polar')  # \u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a  ax.set_theta_zero_location('N') ax.set_theta_direction(1) ax.set_rlabel_position(0) ax.set_thetagrids([], labels=[]) ax.set_rgrids(range(len(df)), labels= df['countries']) <\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0451\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 \u0443\u0433\u043b\u0435\u043a\u0438\u0441\u043b\u044b\u043c \u0433\u0430\u0437\u043e\u043c (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438).<\/p>\n<h4>\u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u041e\u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u0435\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432.&nbsp; \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e. \u0414\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"https:\/\/plotly.com\/python\/\">Plotly<\/a>.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.treemap(df, path=[px.Constant('Countries'), 'countries'],               values=df['emission_2018'],               color=df['emission_2018'],                  color_continuous_scale='Spectral_r',                  color_continuous_midpoint=np.average(df['emission_2018'])               ) fig.update_layout(margin = dict(t=50, l=25, r=25, b=25)) fig.show()<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0418\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Plotly. \u041e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u0412\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.bar(df, x='countries', y='emission_2018', text='emission_2018',            color ='countries', color_discrete_sequence=pal_vi) fig.update_traces(texttemplate='%{text:.3s}', textposition='outside') fig.update_layout({'plot_bgcolor': 'white',                           'paper_bgcolor': 'white'}) fig.update_layout(width=1100, height=500,                margin = dict(t=15, l=15, r=15, b=15)) fig.show()<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u041b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u0432\u0438\u0434 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0440\u044f\u0434\u043e\u043c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0435\u043f\u0435\u0441\u0442\u043a\u043e\u0432\u0443\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443, \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u043c\u043d\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp; <\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.line_polar(df, r='emission_2018',                           theta='countries', line_close=True) fig.update_traces(fill='toself', line = dict(color=pal_spec[5])) fig.show()<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 DataFrame, \u0442\u043e \u0432\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.line_polar(df_s, r='emission_2018',                           theta='countries', line_close=True) fig.update_traces(fill='toself', line = dict(color=pal_spec[-5])) fig.show()<\/code><\/pre>\n<p>\u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:   <\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u041f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430<\/h4>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c. \u0420\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u0438\u0434\u0435 \u2014 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e, \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0440\u0443\u0436\u043a\u043e\u043c, \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0438 \u0442.\u043f. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 X, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Y \u0438 \u043c\u0435\u0442\u043e\u043a. <\/p>\n<pre><code class=\"python\"># \u0421\u0442\u043e\u043b\u0431\u0446\u044b \u043f\u043e \u043e\u0441\u044f\u043c X \u0438 Y  df_s['X'] = [1]*len(df_s) list_y = list(range(0,len(df_s))) list_y.reverse() df_s['Y'] = list_y  # \u0421\u0442\u043e\u043b\u0431\u0435\u0446 \u043c\u0435\u0442\u043e\u043a  df_s['labels'] = ['&lt;b&gt;'+i+'&lt;br&gt;'+format(j, \",\") for i,j in zip(df_s['countries'], df_s['emission_2018'])] df_s <\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">import plotly.express as px fig = px.scatter(df_s, x='X', y='Y',               color='countries', color_discrete_sequence=pal_vi,               size='emission_2018', text='labels', size_max=30) fig.update_layout(width=500, height=1100,                margin = dict(t=0, l=0, r=0, b=0),                showlegend=False               ) fig.update_traces(textposition='middle right') fig.update_xaxes(showgrid=False, zeroline=False, visible=False) fig.update_yaxes(showgrid=False, zeroline=False, visible=False) fig.update_layout({'plot_bgcolor': 'white',                           'paper_bgcolor': 'white'}) fig.show()<\/code><\/pre>\n<p>\u0418 \u0441\u0430\u043c\u0430 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<h2>\u0411\u043e\u043d\u0443\u0441. \u0410 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0451\u0442 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c?<\/h2>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 Python \u0435\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f FuncAnimation \u0438 \u0447\u0430\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0430 Animation \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Matplotlib \u0432 Python. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">import matplotlib.animation as ani animator = ani.FuncAnimation(fig, chartfunc, interval = 100)<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p>fig&nbsp; \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0438\u0441\u0443\u043d\u043a\u0430, \u0433\u0434\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>chartfunc\u200a \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u0440\u044f\u0434\u0443.<\/p>\n<\/li>\n<li>\n<p>Interval \u2014 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 \u0432 \u043c\u0441 (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u2014 \u0434\u043e 200).<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u0442\u043e <a href=\"https:\/\/matplotlib.org\/3.1.1\/api\/_as_gen\/matplotlib.animation.FuncAnimation.html#matplotlib.animation.FuncAnimation\">\u0432\u043e\u0442 \u043e\u043d\u0430<\/a>.<\/p>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0442\u0440\u0430\u043d\u0430\u043c.<\/p>\n<pre><code class=\"python\">import matplotlib.animation as ani import matplotlib.pyplot as plt import numpy as np import pandas as pd url = 'https:\/\/raw.githubusercontent.com\/CSSEGISandData\/COVID-19\/master\/csse_covid_19_data\/csse_covid_19_time_series \/time_series_covid19_deaths_global.csv' df = pd.read_csv(url, delimiter=',', header='infer') df_interest = df.loc[             df['Country\/Region'].isin(['United Kingdom', 'US', 'Italy', 'Germany'])             &amp; df['Province\/State'].isna()] df_interest.rename(             index=lambda x: df_interest.at[x, 'Country\/Region'], inplace=True) df1 = df_interest.transpose() df1 = df1.drop(['Province\/State', 'Country\/Region', 'Lat', 'Long']) df1 = df1.loc[(df1 != 0).any(1)] df1.index = pd.to_datetime(df1.index)<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0438\u0441\u0443\u043d\u043a\u0430, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b x \u0438 y, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442\u0430 \u043b\u0438\u043d\u0438\u0439 \u0438 \u043f\u043e\u043b\u044f.<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt color = ['red', 'green', 'blue', 'orange'] fig = plt.figure() plt.xticks(rotation=45, ha=\"right\", rotation_mode=\"anchor\") #\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u0441\u0438 x plt.subplots_adjust(bottom = 0.2, top = 0.9) #\u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0434\u0430\u0442\u044b (\u043f\u043e \u043e\u0441\u0438 x) \u0443\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 plt.ylabel('No of Deaths') plt.xlabel('Dates')<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 &#8212; \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0440\u0438\u0432\u043e\u0439 \u0438 \u0430\u043d\u0438\u043c\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<pre><code class=\"python\">def buildmebarchart(i=int):             plt.legend(df1.columns)             p = plt.plot(df1[:i].index, df1[:i].values) #\u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0442\u043e\u0447\u043a\u0438 i             for i in range(0,4):            p[i].set_color(color[i]) #\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 importmatplotlib.animation as ani animator = ani.FuncAnimation(fig, buildmebarchart, interval = 100) plt.show()<\/code><\/pre>\n<p>\u0412\u043e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u043d\u0435\u0447\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u043e\u0435. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0447\u0430\u0441\u044b \u0437\u0430 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/738208\/\"> https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/738208\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-347998","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347998"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347998\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}