{"id":746,"date":"2019-01-31T12:15:13","date_gmt":"2019-01-31T11:15:13","guid":{"rendered":"http:\/\/35.180.88.53\/?p=746"},"modified":"2019-10-28T13:39:54","modified_gmt":"2019-10-28T12:39:54","slug":"interactive-data-visualization-with-python-using-bokeh","status":"publish","type":"post","link":"https:\/\/www.sergilehkyi.com\/uk\/2019\/01\/interactive-data-visualization-with-python-using-bokeh\/","title":{"rendered":"\u0406\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044f \u0434\u0430\u043d\u0438\u0445 \u0437 Python \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Bokeh"},"content":{"rendered":"\n<p>\u041d\u0435\u0449\u043e\u0434\u0430\u0432\u043d\u043e \u044f \u0432\u0456\u0434\u043a\u0440\u0438\u0432 \u0434\u043b\u044f \u0441\u0435\u0431\u0435 \u0446\u044e \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443, \u0442\u0440\u043e\u0445\u0438 \u0434\u0456\u0437\u043d\u0430\u0432\u0441\u044f \u043f\u0440\u043e \u043d\u0435\u0457, \u0441\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u0432, \u0437\u0432\u0438\u0447\u0430\u0439\u043d\u043e, \u0456 \u0432\u0438\u0440\u0456\u0448\u0438\u0432 \u043f\u043e\u0434\u0456\u043b\u0438\u0442\u0438\u0441\u044f \u0441\u0432\u043e\u0457\u043c\u0438 \u0434\u0443\u043c\u043a\u0430\u043c\u0438.<\/p>\n\n\n\n<p>\u0417 \u043e\u0444\u0456\u0446\u0456\u0439\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0443: &#8220;Bokeh &#8211; \u0446\u0435 \u0456\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0430 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457, \u044f\u043a\u0430 \u0441\u043f\u0440\u044f\u043c\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0456\u044e \u0441\u0443\u0447\u0430\u0441\u043d\u0438\u0445 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456\u0432. \u0419\u043e\u0433\u043e \u043c\u0435\u0442\u0430 \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e\u0431 \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0438\u0442\u0438 \u0435\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u0443, \u043b\u0430\u043a\u043e\u043d\u0456\u0447\u043d\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044e \u0440\u0456\u0437\u043d\u043e\u043c\u0430\u043d\u0456\u0442\u043d\u043e\u0457 \u0433\u0440\u0430\u0444\u0456\u043a\u0438, \u0430 \u0442\u0430\u043a\u043e\u0436 \u0440\u043e\u0437\u0448\u0438\u0440\u0438\u0442\u0438 \u0446\u044e \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u0437\u0430\u0432\u0434\u044f\u043a\u0438 \u0432\u0438\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u0456\u0439 \u0456\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0456 \u043d\u0430\u0434 \u0434\u0443\u0436\u0435 \u0432\u0435\u043b\u0438\u043a\u0438\u043c\u0438 \u0430\u0431\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0438\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u0438\u0445. Bokeh \u043c\u043e\u0436\u0435 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u0442\u0438 \u0432\u0441\u0456\u043c, \u0445\u0442\u043e \u0445\u043e\u0447\u0435 \u0448\u0432\u0438\u0434\u043a\u043e \u0456 \u043b\u0435\u0433\u043a\u043e \u0441\u0442\u0432\u043e\u0440\u044e\u0432\u0430\u0442\u0438 \u0456\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0456 \u0433\u0440\u0430\u0444\u0456\u043a\u0438, \u043f\u0430\u043d\u0435\u043b\u0456 \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0456\u0432 \u0456 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u0438\u0445.&#8221; \u042f \u0434\u0443\u043c\u0430\u044e, \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f \u0434\u043e\u0441\u0438\u0442\u044c \u0447\u0456\u0442\u043a\u0435, \u0430\u043b\u0435 \u0431\u0443\u043b\u043e \u0431 \u043a\u0440\u0430\u0449\u0435 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438 \u0439\u043e\u0433\u043e \u0432 \u0434\u0456\u0457, \u0447\u0438 \u043d\u0435 \u0442\u0430\u043a?<\/p>\n\n\n\n<p>\u041f\u0435\u0440\u0448 \u043d\u0456\u0436 \u0440\u043e\u0437\u043f\u043e\u0447\u0430\u0442\u0438, \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0430\u0439\u0441\u044f, \u0449\u043e Bokeh \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0443 \u0442\u0432\u043e\u0454\u043c\u0443 \u0441\u0435\u0440\u0435\u0434\u043e\u0432\u0438\u0449\u0456, \u044f\u043a\u0449\u043e \u0436 \u043d\u0456, \u0434\u043e\u0442\u0440\u0438\u043c\u0443\u0439\u0441\u044f \u0456\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u0439 \u0437 \u0456\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0456\u0457 <a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/installation.html\">\u0442\u0443\u0442<\/a>.<\/p>\n\n\n\n<p>\u041e\u0442\u0436\u0435 \u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0432 \u0434\u043b\u044f \u0441\u0435\u0431\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0435 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f. \u0412\u0438\u0440\u0456\u0448\u0438\u0432 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0437\u043c\u0456\u043d\u0438 \u0443 \u0432\u0438\u043a\u0438\u0434\u0430\u0445 CO2 \u0432 \u0447\u0430\u0441\u0456 \u0442\u0430 \u0443 \u0441\u043f\u0456\u0432\u0432\u0456\u0434\u043d\u043e\u0448\u0435\u043d\u043d\u0456 \u0434\u043e \u0412\u0412\u041f (\u0456 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438, \u0447\u0438 \u0456\u0441\u043d\u0443\u0454 \u0432\u0437\u0430\u0433\u0430\u043b\u0456 \u043a\u043e\u0440\u0435\u043b\u044f\u0446\u0456\u044f \u043c\u0456\u0436 \u043d\u0438\u043c\u0438, \u0442\u043e\u043c\u0443 \u0449\u043e \u0445\u0442\u043e \u0439\u043e\u0433\u043e \u0437\u043d\u0430 :|).<\/p>\n\n\n\n<p>\u0422\u043e\u043c\u0443 \u044f \u0432\u0437\u044f\u0432 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0438: \u043e\u0434\u0438\u043d \u0437 \u0432\u0438\u043a\u0438\u0434\u0430\u043c\u0438 CO2 \u0432\u0456\u0434 <a href=\"https:\/\/www.gapminder.org\/data\/\">Gapminder.org<\/a> \u0442\u0430 \u0456\u043d\u0448\u0438\u0439 \u0437 \u043a\u0443\u0440\u0441\u0443 DataCamp (\u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0446\u0435\u0439 \u0444\u0430\u0439\u043b \u0432\u0436\u0435 \u0431\u0443\u0432 \u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u044c\u043e \u043e\u0431\u0440\u043e\u0431\u043b\u0435\u043d\u0438\u0439 &#8211; \u0442\u0430\u0430\u0430\u0430\u0430\u0430\u0430\u0430\u043a, \u044f \u043b\u0435\u0434\u0430\u0447\u0438\u0439 \u0449\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u0435). \u0422\u0430\u043a\u043e\u0436 \u043c\u043e\u0436\u0435\u0448 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0446\u0456 \u0444\u0430\u0439\u043b\u0438 \u0437\u0432\u0456\u0434\u0441\u0438.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/35.180.88.53\/wp-content\/uploads\/2019\/01\/co2_emissions_tonnes_per_person.csv\">co2_emissions_tonnes_per_person<\/a><a href=\"http:\/\/35.180.88.53\/wp-content\/uploads\/2019\/01\/co2_emissions_tonnes_per_person.csv\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/35.180.88.53\/wp-content\/uploads\/2019\/01\/gapminder_tidy.csv\">gapminder_tidy<\/a><a href=\"http:\/\/35.180.88.53\/wp-content\/uploads\/2019\/01\/gapminder_tidy.csv\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<p>\u042f\u043a \u043c\u0438 \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u043c\u043e \u0430\u043d\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u043d\u0456? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u044e\u0447\u0438 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0456 \u043f\u0430\u043a\u0435\u0442\u0438 \u0456 \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u044e\u0447\u0438 \u0441\u0430\u043c\u0456 \u0434\u0430\u043d\u0456 (\u0434\u0443\u0436\u0435 \u0432\u0430\u0436\u043b\u0438\u0432\u043e: D). \u041f\u043e\u0442\u0456\u043c \u043c\u0438 \u0432\u0438\u043a\u043e\u043d\u0443\u0454\u043c\u043e \u0434\u0435\u044f\u043a\u0438\u0439 EDA (\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439\/\u0440\u043e\u0437\u0432\u0456\u0434\u0443\u0432\u0430\u043b\u044c\u043d\u0438\u0439 \u0430\u043d\u0430\u043b\u0456\u0437 \u0434\u0430\u043d\u0438\u0445), \u0449\u043e\u0431 \u0437\u0440\u043e\u0437\u0443\u043c\u0456\u0442\u0438, \u0437 \u0447\u0438\u043c \u043c\u0438 \u043c\u0430\u0454\u043c\u043e \u0441\u043f\u0440\u0430\u0432\u0443, \u0456 \u043f\u0456\u0441\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u044f \u0442\u0430 \u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445 \u0443 \u0444\u043e\u0440\u043c\u0430\u0442, \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0438\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0456\u0437\u0443. \u0414\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0441\u0442\u0430\u0442\u0442\u044f \u043d\u0435 \u0437\u043e\u0441\u0435\u0440\u0435\u0434\u0436\u0443\u0454\u0442\u044c\u0441\u044f \u043d\u0430 \u0446\u0438\u0445 \u043a\u0440\u043e\u043a\u0430\u0445, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044e \u043a\u043e\u0434 \u043d\u0438\u0436\u0447\u0435 \u0437 \u0443\u0441\u0456\u043c\u0430 \u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f\u043c\u0438, \u044f\u043a\u0456 \u044f \u0437\u0440\u043e\u0431\u0438\u0432.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pandas as pd<br>import numpy as np<br><br># Data cleaning and preparation<br>data = pd.read_csv('data\/co2_emissions_tonnes_per_person.csv')<br>data.head()<br><br>gapminder = pd.read_csv('data\/gapminder_tidy.csv')<br>gapminder.head()<br><br>df = gapminder[['Country', 'region']].drop_duplicates()<br>data_with_regions = pd.merge(data, df, left_on='country', right_on='Country', how='inner')<br>data_with_regions = data_with_regions.drop('Country', axis='columns')<br>data_with_regions.head()<br><br>new_df = pd.melt(data_with_regions, id_vars=['country', 'region'])<br>new_df.head()<br><br>columns = ['country', 'region', 'year', 'co2']<br>new_df.columns = columns<br><br>upd_new_df = new_df[new_df['year'].astype('int64') > 1963]<br>upd_new_df.info()<br>upd_new_df = upd_new_df.sort_values(by=['country', 'year'])<br>upd_new_df['year'] = upd_new_df['year'].astype('int64')<br><br>df_gdp = gapminder[['Country', 'Year', 'gdp']]<br>df_gdp.columns = ['country', 'year', 'gdp']<br>df_gdp.info()<br><br>final_df = pd.merge(upd_new_df, df_gdp, on=['country', 'year'], how='left')<br>final_df = final_df.dropna()<br>final_df.head()<br><br>np_co2 = np.array(final_df['co2'])<br>np_gdp = np.array(final_df['gdp'])<br>np.corrcoef(np_co2, np_gdp)<\/pre>\n\n\n\n<p>\u0414\u043e \u0440\u0435\u0447\u0456, \u0432\u0438\u043a\u0438\u0434\u0438 \u0421\u041e2 \u0442\u0430 \u0412\u0412\u041f \u043a\u043e\u0440\u0435\u043b\u044e\u044e\u0442\u044c, \u0456 \u0434\u043e\u0441\u0438\u0442\u044c \u0456\u0441\u0442\u043e\u0442\u043d\u043e &#8211; 0,78.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">np.corrcoef(np_co2, np_gdp)<br> Out[138]: <br> array([[1.        , 0.78219731],<br>        [0.78219731, 1.        ]])<\/pre>\n\n\n\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c\u043e \u0434\u043e \u0447\u0430\u0441\u0442\u0438\u043d\u0438 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457. \u0406 \u0437\u043d\u043e\u0432\u0443 \u043c\u0438 \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u043c\u043e \u0437 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u043e\u0433\u043e \u0456\u043c\u043f\u043e\u0440\u0442\u0443. \u042f \u0432\u0441\u0435 \u0434\u0430\u043b\u0456 \u043f\u043e\u044f\u0441\u043d\u044e. \u0417\u0430\u0440\u0430\u0437 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u043e\u0437\u0441\u043b\u0430\u0431\u0441\u044f \u0442\u0430 \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u0439.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from bokeh.io import curdoc<br>from bokeh.plotting import figure<br>from bokeh.models import HoverTool, ColumnDataSource, CategoricalColorMapper, Slider<br>from bokeh.palettes import Spectral6<br>from bokeh.layouts import widgetbox, row<\/pre>\n\n\n\n<p>\u041c\u0438 \u043f\u043e\u0447\u043d\u0435\u043c\u043e \u0437 \u043f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0440\u0456\u0437\u043d\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u043e\u0457 \u0456\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457. \u041f\u043e-\u043f\u0435\u0440\u0448\u0435, \u043c\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u043a\u043e\u043b\u0456\u0440\u043d\u0438\u0439 \u043c\u0430\u043f\u043f\u0435\u0440 \u0434\u043b\u044f \u0440\u0456\u0437\u043d\u0438\u0445 \u0440\u0435\u0433\u0456\u043e\u043d\u0456\u0432 \u0441\u0432\u0456\u0442\u0443, \u0442\u043e\u043c\u0443 \u043a\u043e\u0436\u043d\u0430 \u043a\u0440\u0430\u0457\u043d\u0430 \u043c\u0430\u0442\u0438\u043c\u0435 \u0456\u043d\u0448\u0438\u0439 \u043a\u043e\u043b\u0456\u0440, \u0437\u0430\u043b\u0435\u0436\u043d\u043e \u0432\u0456\u0434 \u0440\u0435\u0433\u0456\u043e\u043d\u0443, \u0432 \u044f\u043a\u043e\u043c\u0443 \u0432\u043e\u043d\u0430 \u0440\u043e\u0437\u0442\u0430\u0448\u043e\u0432\u0430\u043d\u0430. \u041c\u0438 \u0432\u0438\u0431\u0438\u0440\u0430\u0454\u043c\u043e \u0443\u043d\u0456\u043a\u0430\u043b\u044c\u043d\u0456 \u0440\u0435\u0433\u0456\u043e\u043d\u0438 \u0456 \u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u0457\u0445 \u0443 \u0441\u043f\u0438\u0441\u043e\u043a. \u041f\u043e\u0442\u0456\u043c \u043c\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u043c\u043e CategoricalColorMapper \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0440\u0456\u0437\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u043e\u0440\u0443 \u0434\u043b\u044f \u043a\u043e\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0456\u043e\u043d\u0443.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">regions_list = final_df.region.unique().tolist()<br>color_mapper = CategoricalColorMapper(factors=regions_list, palette=Spectral6)<\/pre>\n\n\n\n<p>\u0414\u0430\u043b\u0456 \u043c\u0438 \u043f\u0456\u0434\u0433\u043e\u0442\u0443\u0454\u043c\u043e \u0434\u0436\u0435\u0440\u0435\u043b\u043e \u0434\u0430\u043d\u0438\u0445 \u0434\u043b\u044f \u043d\u0430\u0448\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438. Bokeh \u043f\u0440\u0438\u0439\u043c\u0430\u0454 \u0431\u0430\u0433\u0430\u0442\u043e \u0440\u0456\u0437\u043d\u0438\u0445 \u0442\u0438\u043f\u0456\u0432 \u0434\u0430\u043d\u0438\u0445 \u044f\u043a \u0434\u0436\u0435\u0440\u0435\u043b\u043e \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0456\u043a\u0456\u0432 \u0456 \u0432\u0456\u0437\u0443\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434: \u043d\u0430\u0434\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445 \u0431\u0435\u0437\u043f\u043e\u0441\u0435\u0440\u0435\u0434\u043d\u044c\u043e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0441\u043f\u0438\u0441\u043a\u0456\u0432, \u0444\u0440\u0435\u0439\u043c\u0456\u0432 \u0434\u0430\u043d\u0438\u0445 \u0456 \u0441\u0435\u0440\u0456\u0439 \u0456\u0437 pandas, \u0446\u0438\u0444\u0440\u043e\u0432\u0438\u0445 \u043c\u0430\u0441\u0438\u0432\u0456\u0432 numpy \u0456 \u0442\u0430\u043a \u0434\u0430\u043b\u0456. \u0410\u043b\u0435 \u044f\u0434\u0440\u043e\u043c \u0434\u043b\u044f \u0431\u0456\u043b\u044c\u0448\u043e\u0441\u0442\u0456 Bokeh \u043e\u0431&#8217;\u0454\u043a\u0442\u0456\u0432 \u0454 ColumnDataSource.<\/p>\n\n\n\n<p>\u041d\u0430 \u043d\u0430\u0439\u0431\u0430\u0437\u043e\u0432\u0456\u0448\u043e\u043c\u0443 \u0440\u0456\u0432\u043d\u0456 ColumnDataSource &#8211; \u0446\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0446\u0456\u044f \u043c\u0456\u0436 \u0456\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u0432\u043f\u0446\u0456\u0432 \u0456 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u0438\u0445. ColumnDataSource \u043f\u0440\u0438\u0439\u043c\u0430\u0454 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>data<\/code> , \u044f\u043a\u0438\u0439 \u0454 \u0441\u043b\u043e\u0432\u043d\u0438\u043a\u043e\u043c, \u0437 \u0456\u043c\u0435\u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u0432\u043f\u0446\u0456\u0432 \u044f\u043a \u043a\u043b\u044e\u0447\u0456 \u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0438 (\u0430\u0431\u043e \u043c\u0430\u0441\u0438\u0432\u0438) \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0434\u0430\u043d\u0438\u0445 \u044f\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f. \u042f\u043a\u0449\u043e \u043e\u0434\u0438\u043d \u043f\u043e\u0437\u0438\u0446\u0456\u0439\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0454\u0442\u044c\u0441\u044f \u0432 \u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0430\u0442\u043e\u0440 ColumnDataSource, \u0432\u0456\u043d \u0431\u0443\u0434\u0435 \u043f\u0440\u0438\u0439\u043d\u044f\u0442\u0438\u0439 \u044f\u043a <code>data<\/code>  (\u0437 \u043e\u0444\u0456\u0446\u0456\u0439\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0443).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Make the ColumnDataSource: source<br>source = ColumnDataSource(data={<br>    'x': final_df.gdp[final_df['year'] == 1964],<br>    'y': final_df.co2[final_df['year'] == 1964],<br>    'country': final_df.country[final_df['year'] == 1964],<br>    'region': final_df.region[final_df['year'] == 1964],<br>})<\/pre>\n\n\n\n<p>\u041c\u0438 \u043f\u043e\u0447\u0438\u043d\u0430\u0454\u043c\u043e \u0437 \u0432\u0438\u0431\u0456\u0440\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u043b\u0438\u0448\u0435 \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0456\u043a \u0456 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u0441\u043b\u043e\u0432\u043d\u0438\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u044c \u0434\u043b\u044f x, y, \u043a\u0440\u0430\u0457\u043d\u0438 \u0442\u0430 \u0440\u0435\u0433\u0456\u043e\u043d\u0443.<\/p>\n\n\n\n<p>\u041d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u043c \u043a\u0440\u043e\u043a\u043e\u043c \u0454 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u043b\u0456\u043c\u0456\u0442\u0456\u0432 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043e\u0441\u0435\u0439. \u041c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0446\u0435 \u0437\u0440\u043e\u0431\u0438\u0442\u0438, \u0437\u043d\u0430\u0439\u0448\u043e\u0432\u0448\u0438 \u043c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0456 \u0442\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0434\u043b\u044f &#8220;X&#8221; \u0456 &#8220;Y&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Save the minimum and maximum values of the gdp column: xmin, xmax<br>xmin, xmax = min(final_df.gdp), max(final_df.gdp)<br><br># Save the minimum and maximum values of the co2 column: ymin, ymax<br>ymin, ymax = min(final_df.co2), max(final_df.co2)<\/pre>\n\n\n\n<p>\u041f\u0456\u0441\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u043c\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u043d\u0430\u0448\u0443 \u0444\u0456\u0433\u0443\u0440\u0443, \u0434\u0435 \u043c\u0438 \u0431\u0443\u0434\u0435\u043c\u043e \u0440\u043e\u0437\u043c\u0456\u0449\u0443\u0432\u0430\u0442\u0438 \u0432\u0441\u0456 \u043d\u0430\u0448\u0456 \u043e\u0431&#8217;\u0454\u043a\u0442\u0438 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457. \u0414\u0430\u0454\u043c\u043e \u0439\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0443, \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0454\u043c\u043e \u0448\u0438\u0440\u0438\u043d\u0443 \u0456 \u0432\u0438\u0441\u043e\u0442\u0443, \u0430 \u0442\u0430\u043a\u043e\u0436 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0454\u043c\u043e \u043e\u0441\u0456. (\u0412\u0456\u0441\u044c &#8220;Y&#8221; \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0442\u0438\u043f &#8220;log&#8221; \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u043a\u0440\u0430\u0449\u043e\u0433\u043e \u0432\u0438\u0433\u043b\u044f\u0434\u0443 &#8211; \u043a\u0456\u043b\u044c\u043a\u0430 \u0442\u0438\u043f\u0456\u0432 \u0431\u0443\u043b\u043e \u0432\u0438\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u043d\u043e, \u0456 \u0446\u0435\u0439 \u0434\u0430\u0432 \u043d\u0430\u0439\u043a\u0440\u0430\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Create the figure: plot<br>plot = figure(title='Gapminder Data for 1964', <br>              plot_height=600, plot_width=1000,<br>              x_range=(xmin, xmax),<br>              y_range=(ymin, ymax), y_axis_type='log')<\/pre>\n\n\n\n<p>Bokeh \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0433\u043b\u0456\u0444\u0443 \u0434\u043b\u044f \u0432\u0441\u0456\u0445 \u0432\u0456\u0437\u0443\u0430\u043b\u044c\u043d\u0438\u0445 \u0444\u0456\u0433\u0443\u0440, \u044f\u043a\u0456 \u043c\u043e\u0436\u0443\u0442\u044c \u0437&#8217;\u044f\u0432\u0438\u0442\u0438\u0441\u044f \u043d\u0430 \u0433\u0440\u0430\u0444\u0456\u043a\u0443. \u041f\u043e\u0432\u043d\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432, \u0432\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0445 \u0432 Bokeh \u043d\u0430\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0438\u0436\u0447\u0435 (\u043d\u0435 \u0432\u0438\u0433\u0430\u0434\u0443\u044e\u0447\u0438 \u043d\u0456\u0447\u043e\u0433\u043e &#8211; \u0432\u0441\u044f \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u044f \u0437 \u043e\u0444\u0456\u0446\u0456\u0439\u043d\u043e\u0457 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0438):<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/annular_wedge.html#bokeh.models.glyphs.AnnularWedge\"><code>AnnularWedge<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/annulus.html#bokeh.models.glyphs.Annulus\"><code>Annulus<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/arc.html#bokeh.models.glyphs.Arc\"><code>Arc<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/bezier.html#bokeh.models.glyphs.Bezier\"><code>Bezier<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/ellipse.html#bokeh.models.glyphs.Ellipse\"><code>Ellipse<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/hbar.html#bokeh.models.glyphs.HBar\"><code>HBar<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/hex_tile.html#bokeh.models.glyphs.HexTile\"><code>HexTile<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/image.html#bokeh.models.glyphs.Image\"><code>Image<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/image_rgba.html#bokeh.models.glyphs.ImageRGBA\"><code>ImageRGBA<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/image_url.html#bokeh.models.glyphs.ImageURL\"><code>ImageURL<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/line.html#bokeh.models.glyphs.Line\"><code>Line<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/multi_line.html#bokeh.models.glyphs.MultiLine\"><code>MultiLine<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/multi_polygons.html#bokeh.models.glyphs.MultiPolygons\"><code>MultiPolygons<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/oval.html#bokeh.models.glyphs.Oval\"><code>Oval<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/patch.html#bokeh.models.glyphs.Patch\"><code>Patch<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/patches.html#bokeh.models.glyphs.Patches\"><code>Patches<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/quad.html#bokeh.models.glyphs.Quad\"><code>Quad<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/quadratic.html#bokeh.models.glyphs.Quadratic\"><code>Quadratic<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/ray.html#bokeh.models.glyphs.Ray\"><code>Ray<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/rect.html#bokeh.models.glyphs.Rect\"><code>Rect<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/segment.html#bokeh.models.glyphs.Segment\"><code>Segment<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/step.html#bokeh.models.glyphs.Step\"><code>Step<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/text.html#bokeh.models.glyphs.Text\"><code>Text<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/vbar.html#bokeh.models.glyphs.VBar\"><code>VBar<\/code><\/a><\/li><li><a href=\"https:\/\/bokeh.pydata.org\/en\/latest\/docs\/reference\/models\/glyphs\/wedge.html#bokeh.models.glyphs.Wedge\"><code>Wedge<\/code><\/a><\/li><\/ul>\n\n\n\n<p>\u0412\u0441\u0456 \u0446\u0456 \u0433\u043b\u0456\u0444\u0438 \u043c\u0430\u044e\u0442\u044c \u0441\u043f\u0456\u043b\u044c\u043d\u0438\u0439 \u043c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0456\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0435\u0440\u0435\u0437 \u0431\u0430\u0437\u043e\u0432\u0438\u0439 \u043a\u043b\u0430\u0441\u00a0<code>Glyph.<\/code><\/p>\n\n\n\n<p>\u041c\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c\u043e \u043d\u0430\u0434\u0442\u043e \u0437\u0430\u0433\u043b\u0438\u0431\u043b\u044e\u0432\u0430\u0442\u0438\u0441\u044f \u0437 \u0443\u0441\u0456\u043c\u0430 \u0446\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438 \u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0454\u043c\u043e \u043a\u043e\u043b\u043e \u044f\u043a \u043e\u0434\u0438\u043d \u0437 \u043d\u0430\u0439\u043f\u0440\u043e\u0441\u0442\u0456\u0448\u0438\u0445 \u0433\u043b\u0456\u0444\u0456\u0432. \u042f\u043a\u0449\u043e \u0432\u0438 \u0445\u043e\u0442\u0456\u043b\u0438 \u0431 \u043f\u043e\u0433\u0440\u0430\u0442\u0438\u0441\u044f \u0431\u0456\u043b\u044c\u0448\u0435 \u0437 \u0456\u043d\u0448\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438, \u0443 \u0432\u0430\u0441 \u0454 \u0432\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0456\u044f \u0442\u0430 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Add circle glyphs to the plot<br>plot.circle(x='x', y='y', fill_alpha=0.8, source=source, legend='region',<br>            color=dict(field='region', transform=color_mapper),<br>            size=7)<\/pre>\n\n\n\n<p>\u042f\u043a \u0436\u0435 \u0434\u043e\u0434\u0430\u0442\u0438 \u0446\u0456 \u043a\u043e\u043b\u0430? \u0417\u0430\u0434\u0430\u0454\u043c\u043e \u043d\u0430\u0448\u0435 \u0434\u0436\u0435\u0440\u0435\u043b\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0456 \u00absource\u00bb \u0433\u043b\u0456\u0444\u0430 \u043a\u043e\u043b\u043e, \u0432\u043a\u0430\u0437\u0443\u0454\u043c\u043e \u0434\u0430\u043d\u0456 \u0434\u043b\u044f \u00abX\u00bb \u0456 \u00abY\u00bb, \u0434\u043e\u0434\u0430\u0454\u043c\u043e \u0443\u043c\u043e\u0432\u043d\u0456 \u043f\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0434\u043b\u044f \u043a\u043e\u043b\u044c\u043e\u0440\u0456\u0432 \u0456 \u0437\u0430\u0441\u0442\u043e\u0441\u043e\u0432\u0443\u0454\u043c\u043e \u0440\u0430\u043d\u0456\u0448\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0439 ColorMapper \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u00abcolor\u00bb, \u00abfill_alpha\u00bb \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0454 \u043d\u0435\u0437\u043d\u0430\u0447\u043d\u0443 \u043f\u0440\u043e\u0437\u043e\u0440\u0456\u0441\u0442\u044c \u0456 &#8220;size&#8221; &#8211; \u0446\u0435 \u0440\u043e\u0437\u043c\u0456\u0440 \u043a\u0456\u043b, \u044f\u043a\u0456 \u0437&#8217;\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0444\u0456\u0433\u0443\u0440\u0456. <\/p>\n\n\n\n<p>\u0414\u0430\u043b\u0456 \u043c\u0438 \u043f\u043e\u043a\u0440\u0430\u0449\u0443\u0454\u043c\u043e \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0456\u0439 \u0432\u0438\u0433\u043b\u044f\u0434 \u043d\u0430\u0448\u043e\u0457 \u0444\u0456\u0433\u0443\u0440\u0438, \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u044e\u0447\u0438 \u043c\u0456\u0441\u0446\u0435 \u0440\u043e\u0437\u0442\u0430\u0448\u0443\u0432\u0430\u043d\u043d\u044f \u043b\u0435\u0433\u0435\u043d\u0434\u0438 \u0456 \u0434\u0430\u044e\u0447\u0438 \u0434\u0435\u044f\u043a\u0456 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f \u043d\u0430\u0448\u0438\u043c \u043e\u0441\u044f\u043c.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Set the legend.location attribute of the plot<br>plot.legend.location = 'bottom_right'<br><br># Set the x-axis label<br>plot.xaxis.axis_label = 'Income per person (Gross domestic product per person adjusted for differences in purchasing power in international dollars, fixed 2011 prices, PPP based on 2011 ICP)'<br><br># Set the y-axis label<br>plot.yaxis.axis_label = 'CO2 emissions (tonnes per person)'<\/pre>\n\n\n\n<p>\u041d\u0430 \u0434\u0430\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043d\u0430\u0441 \u0454 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u0439 \u0456 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u0438\u0439 \u0433\u0440\u0430\u0444\u0456\u043a \u0437\u0430 1964 \u0440\u0456\u043a, \u0430\u043b\u0435 \u0432 \u043d\u0430\u0437\u0432\u0456 \u0441\u0442\u0430\u0442\u0442\u0456 \u0454 \u0441\u043b\u043e\u0432\u043e, \u044f\u043a\u0435 \u043d\u0435 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u0434\u0430\u043d\u0456\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0456\u0457 &#8220;\u0406\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0438\u0439&#8221; O_O. \u041e\u0442\u0436\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0434\u0430\u043c\u043e \u0442\u0440\u043e\u0445\u0438 \u0456\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0456!<\/p>\n\n\n\n<p>\u0414\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u043c\u0438 \u0434\u043e\u0434\u0430\u043c\u043e \u043f\u043e\u0432\u0437\u0443\u043d\u043e\u043a \u0437 \u0440\u043e\u043a\u0430\u043c\u0438, \u0442\u043e\u043c\u0443 \u0432 \u043a\u0456\u043d\u0446\u0456 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044f \u0434\u043b\u044f \u043a\u043e\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u044f\u0432\u043d\u043e\u0433\u043e \u0440\u043e\u043a\u0443. Cool! \u0447\u0438 \u043d\u0435 \u0442\u0430\u043a?<\/p>\n\n\n\n<p>\u0420\u0430\u043d\u0456\u0448\u0435 \u043c\u0438 \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u0432\u0430\u043b\u0438 \u043a\u043b\u0430\u0441 Slider, \u0442\u0435\u043f\u0435\u0440 \u043d\u0430\u0441\u0442\u0430\u0432 \u0447\u0430\u0441 \u0439\u043e\u0433\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438! \u0422\u0430\u043a\u0438\u043c \u0447\u0438\u043d\u043e\u043c, \u043c\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u043e\u0431&#8217;\u0454\u043a\u0442 \u0446\u044c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443 \u0437 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438: &#8216;start&#8217; &#8211; \u043c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u0456\u043a, &#8216;end&#8217; &#8211; \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439, &#8216;value&#8217; (\u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f) &#8211; \u043c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u0456\u043a \u0437\u043d\u043e\u0432\u0443, &#8216;step&#8217; (\u044f\u043a \u0448\u0432\u0438\u0434\u043a\u043e \u0437\u043c\u0456\u043d\u044e\u044e\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043d\u0430 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0456) &#8211; 1 \u0440\u0456\u043a \u0456 &#8220;title&#8221;.<\/p>\n\n\n\n<p>\u0422\u0430\u043a\u043e\u0436 \u043c\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u0437\u0432\u043e\u0440\u043e\u0442\u043d\u0438\u0439 \u0432\u0438\u043a\u043b\u0438\u043a \u0434\u043b\u044f \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0445 \u0437\u043c\u0456\u043d, \u044f\u043a\u0456 \u0432\u0456\u0434\u0431\u0443\u0432\u0430\u044e\u0442\u044c\u0441\u044f \u043d\u0430 \u0446\u044c\u043e\u043c\u0443 \u043f\u043e\u0432\u0437\u0443\u043d\u043a\u0443. \u0417\u0432\u043e\u0440\u043e\u0442\u043d\u0456 \u0432\u0438\u043a\u043b\u0438\u043a\u0438 \u0432 Bokeh \u0437\u0430\u0432\u0436\u0434\u0438 \u043c\u0430\u044e\u0442\u044c \u043e\u0434\u043d\u0430\u043a\u043e\u0432\u0456 \u0432\u0445\u0456\u0434\u043d\u0456 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438: attr, old, new. \u041c\u0438 \u0431\u0443\u0434\u0435\u043c\u043e \u043e\u043d\u043e\u0432\u043b\u044e\u0432\u0430\u0442\u0438 \u043d\u0430\u0448\u0435 \u0434\u0436\u0435\u0440\u0435\u043b\u043e \u0434\u0430\u043d\u0438\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043f\u043e\u0432\u0437\u0443\u043d\u043a\u0430. \u0422\u043e\u043c\u0443 \u043c\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u043d\u043e\u0432\u0438\u0439 \u0441\u043b\u043e\u0432\u043d\u0438\u043a, \u044f\u043a\u0438\u0439 \u0431\u0443\u0434\u0435 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0442\u0438 \u0440\u043e\u043a\u0443 \u0437 \u043f\u043e\u0432\u0437\u0443\u043d\u043a\u0430 \u0456 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0456 \u0446\u044c\u043e\u0433\u043e \u043c\u0438 \u043e\u043d\u043e\u0432\u043b\u044e\u0432\u0430\u0442\u0438\u043c\u0435\u043c\u043e \u043d\u0430\u0448 \u0433\u0440\u0430\u0444\u0456\u043a. \u0422\u0430\u043a\u043e\u0436 \u043c\u0438 \u043e\u043d\u043e\u0432\u043b\u044e\u0454\u043c\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0433\u0440\u0430\u0444\u0456\u043a\u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u043e.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Make a slider object: slider<br>slider = Slider(start=min(final_df.year), end=max(final_df.year), step=1, value=min(final_df.year), title='Year')<br><br><br>def update_plot(attr, old, new):<br>    # set the `yr` name to `slider.value` and `source.data = new_data`<br>    yr = slider.value<br><br>    new_data = {<br>        'x': final_df.gdp[final_df['year'] == yr],<br>        'y': final_df.co2[final_df['year'] == yr],<br>        'country': final_df.country[final_df['year'] == yr],<br>        'region': final_df.region[final_df['year'] == yr],<br>    }<br>    source.data = new_data<br><br>    # Add title to figure: plot.title.text<br>    plot.title.text = 'Gapminder data for %d' % yr<br><br><br># Attach the callback to the 'value' property of slider<br>slider.on_change('value', update_plot)<\/pre>\n\n\n\n<p>\u0417 \u0442\u0430\u043a\u043e\u044e \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044e \u0442\u043e\u0447\u043e\u043a \u0434\u0430\u043d\u0438\u0445 \u0433\u0440\u0430\u0444\u0456\u043a \u0434\u0443\u0436\u0435 \u0448\u0432\u0438\u0434\u043a\u043e \u0441\u0442\u0430\u0454 \u0431\u0435\u0437\u043b\u0430\u0434\u043d\u0438\u043c. \u0422\u043e\u043c\u0443 \u0449\u043e\u0431 \u0434\u043e\u0434\u0430\u0442\u0438 \u0431\u0456\u043b\u044c\u0448\u0435 \u044f\u0441\u043d\u043e\u0441\u0442\u0456 \u0434\u043e \u043a\u043e\u0436\u043d\u043e\u0433\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043a\u043e\u043b\u0430, \u044f\u043a\u0435 \u0431\u0443\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0442\u0443\u0442, \u044f \u0432\u0438\u0440\u0456\u0448\u0438\u0432 \u0442\u0430\u043a\u043e\u0436 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0438 HoverTool \u0443 \u0446\u044e \u0444\u0456\u0433\u0443\u0440\u0443.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Create a HoverTool: hover<br>hover = HoverTool(tooltips=[('Country', '@country'), ('GDP', '@x'), ('CO2 emission', '@y')])<br><br># Add the HoverTool to the plot<br>plot.add_tools(hover)<\/pre>\n\n\n\n<p>HoverTool \u043f\u0440\u0438\u0439\u043c\u0430\u0454 \u0441\u043f\u0438\u0441\u043e\u043a \u0456\u0437 tuples \u0434\u0435 \u043f\u0435\u0440\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f\u043c \u0454 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0430 \u0434\u0440\u0443\u0433\u0438\u043c &#8211; \u0434\u0435\u0442\u0430\u043b\u0456 \u0437 \u0434\u0436\u0435\u0440\u0435\u043b\u0430 \u0434\u0430\u043d\u0438\u0445.<\/p>\n\n\n\n<p>\u041d\u0430 \u0446\u044c\u043e\u043c\u0443 \u043c\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438 \u0437 \u0443\u0441\u0456\u043c\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u043d\u0430\u0448\u043e\u0433\u043e \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u043e\u0433\u043e \u0434\u043e\u0434\u0430\u0442\u043a\u0430, \u043b\u0438\u0448\u0438\u043b\u043e\u0441\u044c \u043a\u0456\u043b\u044c\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043d\u0456\u0445 \u0440\u044f\u0434\u043a\u0456\u0432 \u043a\u043e\u0434\u0443, \u0449\u043e\u0431 \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043c\u0430\u043a\u0435\u0442 \u0456 \u0434\u043e\u0434\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0434\u043e \u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0443.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Make a row layout of widgetbox(slider) and plot and add it to the current document<br>layout = row(widgetbox(slider), plot)<br>curdoc().add_root(layout)<\/pre>\n\n\n\n<p>\u041c\u0438 \u0446\u0435 \u0437\u0440\u043e\u0431\u0438\u043b\u0438! \u0412\u0456\u0442\u0430\u044e! \u041c\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0454\u043c\u043e \u0446\u0435\u0439 \u043a\u043e\u0434 \u0456\u2026 \u041d\u0456\u0447\u043e\u0433\u043e. \u0416\u043e\u0434\u043d\u0438\u0445 \u043f\u043e\u043c\u0438\u043b\u043e\u043a (\u0430\u0431\u043e, \u043c\u043e\u0436\u043b\u0438\u0432\u043e, \u0434\u0435\u044f\u043a\u0456 \u043f\u043e\u043c\u0438\u043b\u043a\u0438, \u0430\u043b\u0435 \u043f\u043e\u0442\u0456\u043c \u0442\u0438 \u0457\u0445 \u0432\u0438\u043f\u0440\u0430\u0432\u043b\u044f\u0454\u0448, \u0456 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435\u043c\u0430\u0454 \u043f\u043e\u043c\u0438\u043b\u043e\u043a) \u0456 \u043d\u0456 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438, \u043d\u0456 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 O_o. \u0427\u043e\u043c\u0443, \u0447\u043e\u0440\u0442 \u0432\u0456\u0437\u044c\u043c\u0438, \u044f \u0432\u0438\u0442\u0440\u0430\u0442\u0438\u0432 \u0432\u0435\u0441\u044c \u0446\u0435\u0439 \u0447\u0430\u0441 \u043d\u0430 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u0440\u0443\u0442\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0456\u043a\u0443 \u0456 \u043d\u0456\u0447\u043e\u0433\u043e \u043d\u0435 \u0432\u0438\u0439\u0448\u043b\u043e? \u041d\u0430\u0432\u0456\u0442\u044c \u043d\u0435\u043c\u0430\u0454 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f, \u0449\u043e \u044f \u0437\u0440\u043e\u0431\u0438\u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. <\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0438\u043c\u0438 \u0431\u0443\u043b\u0438 \u043c\u043e\u0457 \u043f\u0435\u0440\u0448\u0456 \u0434\u0443\u043c\u043a\u0438, \u043a\u043e\u043b\u0438 \u044f \u043d\u0430\u043c\u0430\u0433\u0430\u0432\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443. \u0410\u043b\u0435 \u0442\u043e\u0434\u0456 \u044f \u0437\u0433\u0430\u0434\u0430\u0432 \u0442\u0440\u044e\u043a, \u0437\u0433\u0456\u0434\u043d\u043e \u0437 \u044f\u043a\u0438\u043c \u0442\u0438 \u0441\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440, \u044f\u043a\u0438\u0439 \u0431\u0443\u0434\u0435 backend\u043e\u043c \u0434\u043b\u044f \u0446\u0456\u0454\u0457 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457.<\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0438\u043c \u0447\u0438\u043d\u043e\u043c, \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0435 \u0456 \u043e\u0441\u0442\u0430\u043d\u043d\u0454, \u0449\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0437\u0440\u043e\u0431\u0438\u0442\u0438, \u0446\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0434 \u043d\u0438\u0436\u0447\u0435 \u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u043a\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">bokeh serve --show my_python_file.py<\/pre>\n\n\n\n<p>\u0406 \u0432\u0456\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0432\u0456\u0434\u043a\u0440\u0438\u0454 \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044e \u0432 \u043d\u043e\u0432\u0456\u0439 \u0432\u043a\u043b\u0430\u0434\u0446\u0456 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"http:\/\/35.180.88.53\/wp-content\/uploads\/2019\/01\/ezgif.com-video-to-gif.gif\" alt=\"\" class=\"wp-image-750\"\/><\/figure>\n\n\n\n<p>\u041d\u0435\u0437\u0432\u0430\u0436\u0430\u044e\u0447\u0438 \u043d\u0430 \u0442\u0435, \u0449\u043e matplotlib \u0454 \u043d\u0430\u0439\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0456\u0448\u0438\u043c, \u0432\u0456\u043d \u043d\u0435 \u0454 \u043d\u0430\u0439\u0431\u0456\u043b\u044c\u0448 \u0437\u0440\u0443\u0447\u043d\u0438\u043c \u0437\u0430\u0441\u043e\u0431\u043e\u043c \u0432\u0456\u0437\u0443\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0434\u0430\u043d\u0438\u0445 \u0456 \u043c\u0430\u0454 \u0441\u0432\u043e\u0457 \u0432\u043b\u0430\u0441\u043d\u0456 \u043e\u0431\u043c\u0435\u0436\u0435\u043d\u043d\u044f, \u0456 \u043c\u0435\u043d\u0456 \u0446\u0435 \u043d\u0435 \u0434\u0443\u0436\u0435 \u043f\u043e\u0434\u043e\u0431\u0430\u0454\u0442\u044c\u0441\u044f. \u041e\u0442\u0436\u0435, Bokeh &#8211; \u0446\u0435 \u043e\u0434\u043d\u0435 \u0437 \u043c\u043e\u0436\u043b\u0438\u0432\u0438\u0445 \u0440\u0456\u0448\u0435\u043d\u044c, \u044f\u043a\u0449\u043e \u0432\u0438 \u043d\u0430\u043b\u0435\u0436\u0438\u0442\u0435 \u0434\u043e \u0442\u0456\u0454\u0457 \u0436 \u043a\u043e\u0433\u043e\u0440\u0442\u0438 \u043b\u044e\u0434\u0435\u0439, \u044f\u043a \u0456 \u044f, \u0442\u0438\u0445, \u0449\u043e \u043d\u0435 \u0434\u0443\u0436\u0435 \u0432 \u0437\u0430\u0445\u0432\u0430\u0442\u0456 \u0432\u0456\u0434 matplotlib. \u0421\u043f\u0440\u043e\u0431\u0443\u0439 \u0442\u0430\u043a\u043e\u0436 \u0446\u044e \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443 \u0456 \u0434\u0430\u0439 \u043c\u0435\u043d\u0456 \u0437\u043d\u0430\u0442\u0438 \u0449\u043e \u0442\u0438 \u0434\u0443\u043c\u0430\u0454\u0448 \u043f\u0440\u043e \u0446\u0435\u0439 \u0456\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n\n\n\n<p>\u0414\u044f\u043a\u0443\u044e \u0437\u0430 \u0442\u0432\u043e\u044e \u0443\u0432\u0430\u0433\u0443, \u0441\u043f\u043e\u0434\u0456\u0432\u0430\u044e\u0441\u044f, \u0449\u043e \u0446\u0435\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0432\u0441\u0442\u0443\u043f \u0434\u043e Bokeh \u0431\u0443\u0434\u0435 \u043a\u043e\u0440\u0438\u0441\u043d\u0438\u043c \u0434\u043b\u044f \u0442\u0435\u0431\u0435 \u0456 \u0447\u0443\u0434\u043e\u0432\u043e\u0433\u043e \u0442\u043e\u0431\u0456 \u0434\u043d\u044f! (\u0430\u0431\u043e \u043d\u043e\u0447\u0456, \u044f\u043a\u0449\u043e \u0442\u0438 \u0447\u0438\u0442\u0430\u0454\u0448 \u0446\u0435 \u043f\u0435\u0440\u0435\u0434 \u0441\u043d\u043e\u043c :D)<\/p>\n\n\n\n<p>P.S. \u0425\u043e\u0447\u0443 \u0441\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u0442\u0438 \u0449\u0435 \u0439 plotly, \u0431\u0430\u0447\u0438\u0432 \u0431\u0430\u0433\u0430\u0442\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u0438\u0445 \u0432\u0456\u0434\u0433\u0443\u043a\u0456\u0432 \u043f\u0440\u043e \u043d\u044c\u043e\u0433\u043e.<\/p>\n\n\n\n<p>P.S.S. \u041a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/github.com\/slehkyi\/notebooks-for-articles\/blob\/master\/co2_world.py\">Github<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p style=\"text-align:center\">\u0424\u043e\u0442\u043e\u00a0<a href=\"https:\/\/unsplash.com\/photos\/e4usjv5lmhE?utm_source=unsplash&#038;utm_medium=referral&#038;utm_content=creditCopyText\">Yosh Ginsu<\/a>\u00a0\u043d\u0430\u00a0<a href=\"https:\/\/unsplash.com\/search\/photos\/smoke-landscape?utm_source=unsplash&#038;utm_medium=referral&#038;utm_content=creditCopyText\">Unsplash<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0449\u043e\u0434\u0430\u0432\u043d\u043e \u044f \u0432\u0456\u0434\u043a\u0440\u0438\u0432 \u0434\u043b\u044f \u0441\u0435\u0431\u0435 \u0446\u044e \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443, \u0442\u0440\u043e\u0445\u0438 \u0434\u0456\u0437\u043d\u0430\u0432\u0441\u044f \u043f\u0440\u043e \u043d\u0435\u0457, \u0441\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u0432, \u0437\u0432\u0438\u0447\u0430\u0439\u043d\u043e, \u0456 \u0432\u0438\u0440\u0456\u0448\u0438\u0432 \u043f\u043e\u0434\u0456\u043b\u0438\u0442\u0438\u0441\u044f \u0441\u0432\u043e\u0457\u043c\u0438 \u0434\u0443\u043c\u043a\u0430\u043c\u0438. \u0417 \u043e\u0444\u0456\u0446\u0456\u0439\u043d\u043e\u0433\u043e&hellip;<\/p>\n","protected":false},"author":1,"featured_media":752,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"translation":{"provider":"WPGlobus","version":"3.0.0","language":"uk","enabled_languages":["gb","es","uk"],"languages":{"gb":{"title":true,"content":true,"excerpt":false},"es":{"title":true,"content":true,"excerpt":false},"uk":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/posts\/746"}],"collection":[{"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/comments?post=746"}],"version-history":[{"count":19,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/posts\/746\/revisions"}],"predecessor-version":[{"id":800,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/posts\/746\/revisions\/800"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/media\/752"}],"wp:attachment":[{"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/media?parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/categories?post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sergilehkyi.com\/uk\/wp-json\/wp\/v2\/tags?post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}