{"id":271984,"date":"2016-01-12T14:26:02","date_gmt":"2016-01-12T11:26:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271984"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271984","title":{"rendered":"\u0413\u0440\u0430\u0444\u0438\u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044f \u0441 python, pandas \u0438 matplotlib"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/553\/f10\/7c5\/553f107c5c7a414187e431f96fe456bf.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0438\u043c\u0430 \u2014 \u044d\u0442\u043e \u043f\u043e \u0438\u0441\u0442\u0438\u043d\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0433\u043e\u0434\u0430. \u041d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0438\u043c\u043e\u0439 \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044e\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0430\u044e \u0438 \u0443\u0445\u043e\u0436\u0443 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0441\u044c \u0441 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u0435 \u0432\u0438\u0434\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u043e\u0441\u0445\u043e\u0434\u0435 \u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0441\u043e\u043b\u043d\u0446\u0430 \u0438 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0438\u0445 \u0441\u043e \u0441\u0442\u043e\u043b\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0434\u043d\u044f (\u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0447\u0430\u0441\u044b \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f). \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python (pandas + matplotlib). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042f \u043d\u0430\u0448\u0435\u043b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 <a href=\"http:\/\/voshod-solnca.ru\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0434\u0430\u0442\u0435, \u0432\u043e\u0441\u0445\u043e\u0434\u0435 \u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0441\u043e\u043b\u043d\u0446\u0430, \u0437\u0435\u043d\u0438\u0442\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u043a\u0438\u0445, \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0438 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0443\u043c\u0435\u0440\u043a\u0430\u0445. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0441\u0445\u043e\u0434\u0430 \u0438 \u0437\u0430\u0445\u043e\u0434\u0430 \u0441\u043e\u043b\u043d\u0446\u0430, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u043a\u0438\u0445 \u0441\u0443\u043c\u0435\u0440\u043a\u0430\u0445, \u0438, \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0434\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \/sumerki, \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0451 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \/input \u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f sumerki.py. \u0412 \u043f\u0430\u043f\u043a\u0443 input \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c 2 \u0444\u0430\u0439\u043b\u0430 sumerki_1.txt \u0438 sumerki_2.txt, \u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0441\u0430\u0439\u0442\u0430. \u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:<\/p>\n<pre>1 \u044f\u043d\u0432\u0430\u0440\u044f\t09:00:39\t12:33:54\t16:07:09\t07:06:29\t+1:16 08:14:08\t07:25:39\t06:40:27\t18:27:20\t17:42:09\t16:53:40<\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043d\u0430\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f. \u041d\u0435 \u043c\u0443\u0434\u0440\u0441\u0442\u0432\u0443\u044f \u043b\u0443\u043a\u0430\u0432\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b: 07:00:00 \u2014 20:00:00 \u0434\u043b\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0438 09:00:00 \u2014 18:00:00 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<p>  \u0421\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Python.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<pre><code class=\"python\">import os import datetime import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates from matplotlib import rc   # \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u0447\u0438\u0441\u043b\u043e def stn(dstr):     return mdates.datestr2num(dstr.tolist())   # \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u044b \u0432 matplotlib font = {'family': 'Verdana', 'weight': 'normal'} rc('font', **font)  DIR = os.path.dirname('__File__') <\/code><\/pre>\n<p>  \u0421\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 pandas (\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c 2 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u2014 S, W):<\/p>\n<pre><code class=\"python\"># \u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u0445 \u0432 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 s1 = open(os.path.join(DIR, 'input', 'sumerki_1.txt'), 'r').read().split('\\n') s2 = open(os.path.join(DIR, 'input', 'sumerki_2.txt'), 'r').read().split('\\n') oday = datetime.datetime.strptime('01.01.2016', '%d.%m.%Y') dates = [oday + datetime.timedelta(days=dt) for dt in range(len(s1))]  # \u041e\u0442 \u0441\u0435\u0431\u044f \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0434\u043d\u044f (0, 24) s = [[dates[i[0]]] + s1[i[0]].split('\\t') + s2[i[0]].split('\\t') + ['00:00:01', '23:59:59'] for i in enumerate(s1)] columns = ['datetime', 'date', 'voshod', 'zenit', 'zahod', 'dolgota', 'cng',            'sum1_from', 'sum2_from', 'sum3_from', 'sum3_to', 'sum2_to', 'sum1_to',            '0', '24'] S = pd.DataFrame(s, columns=columns)  # \u0421\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0443\u0435\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0434\u043d\u0435 \u0438 \u043d\u0430\u0447\u0430\u043b\u0435\/\u043a\u043e\u043d\u0446\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u043d\u044f (\u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f) w = [[dt, '07:00:00', '09:00:00', '18:00:00', '20:00:00'] for dt in dates] columns = ['datetime', 'life_from', 'work_from', 'work_to', 'life_to'] W = pd.DataFrame(w, columns=columns) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u0430 \u2014 \u0436\u0435\u043b\u0442\u044b\u0439 \u0434\u043b\u044f \u0441\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u044f, \u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439 \u0434\u043b\u044f \u0441\u0443\u043c\u0435\u0440\u0435\u043a, \u0430 \u0433\u043e\u043b\u0443\u0431\u043e\u0432\u0430\u0442\u044b\u0439 \u0441\u043e \u0437\u0432\u0451\u0437\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a.<\/p>\n<pre><code class=\"python\"># \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a fig, ax = plt.subplots()  plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m')) plt.gca().xaxis.set_major_locator(mdates.MonthLocator()) plt.gcf().autofmt_xdate()  # \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 l1, = ax.plot(S['datetime'], stn(S['voshod']), 'r-', label='\u0432\u043e\u0441\u0445\u043e\u0434') l2, = ax.plot(S['datetime'], stn(S['zahod']), 'b-', label='\u0437\u0430\u0445\u043e\u0434') l3, = ax.plot(S['datetime'], stn(S['sum1_from']), 'g-', label='\u0441\u0443\u043c\u0435\u0440\u043a\u0438 (\u043e\u0442)') l4, = ax.plot(S['datetime'], stn(S['sum1_to']), 'm-', label='\u0441\u0443\u043c\u0435\u0440\u043a\u0438 (\u0434\u043e)') l5, = ax.plot(W['datetime'], stn(W['work_from']), 'k-', label='\u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f') l6, = ax.plot(S['datetime'], stn(W['work_to']), 'k-', label='\u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f') l7, = ax.plot(S['datetime'], stn(W['life_from']), 'k-', label='\u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f') l8, = ax.plot(S['datetime'], stn(W['life_to']), 'k-', label='\u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f')   # \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 # \u0412\u043e\u0441\u0445\u043e\u0434-\u0437\u0430\u0445\u043e\u0434 plt.fill_between(S['datetime'].tolist(), stn(S['voshod']), stn(S['zahod']), alpha=0.4, color='yellow', hatch='.') # C\u0443\u043c\u0435\u0440\u043a\u0438 plt.fill_between(S['datetime'].tolist(), stn(S['sum1_from']), stn(S['voshod']), alpha=0.4, color='orange', hatch='.') plt.fill_between(S['datetime'].tolist(), stn(S['zahod']), stn(S['sum1_to']), alpha=0.4, color='orange', hatch='.') # \u041d\u043e\u0447\u044c plt.fill_between(S['datetime'].tolist(),  stn(S['0']), stn(S['sum1_from']), alpha=0.4, color='blue', hatch='*') plt.fill_between(S['datetime'].tolist(), stn(S['sum1_to']),  stn(S['24']), alpha=0.4, color='blue', hatch='*') # \u0420\u0430\u0431\u043e\u0447\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f plt.fill_between(W['datetime'].tolist(), stn(W['work_from']), stn(W['work_to']), alpha=0.1, color='blue', hatch='\/') plt.fill_between(W['datetime'].tolist(), stn(W['life_from']), stn(W['life_to']), alpha=0.1, color='blue', hatch='\/')  # \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438 \u043b\u0435\u0433\u0435\u043d\u0434\u0430 ax.yaxis_date() ax.xaxis_date() ax.set_xlabel(&quot;\u0414\u0430\u0442\u0430&quot;) ax.set_ylabel(&quot;\u0412\u0440\u0435\u043c\u044f&quot;) plt.title('\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f) \u043e\u0442 \u0441\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u044f.') plt.legend(handles=[l1, l2, l3, l4, l6, l8], loc=1, fontsize=11) fig.autofmt_xdate()  # \u041d\u0443 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a \u0443\u0436\u0435 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 plt.show() <\/code><\/pre>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274927\/\"> http:\/\/habrahabr.ru\/post\/274927\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/553\/f10\/7c5\/553f107c5c7a414187e431f96fe456bf.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0438\u043c\u0430 \u2014 \u044d\u0442\u043e \u043f\u043e \u0438\u0441\u0442\u0438\u043d\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0433\u043e\u0434\u0430. \u041d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0438\u043c\u043e\u0439 \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044e\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0430\u044e \u0438 \u0443\u0445\u043e\u0436\u0443 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0441\u044c \u0441 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u0435 \u0432\u0438\u0434\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u043e\u0441\u0445\u043e\u0434\u0435 \u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0441\u043e\u043b\u043d\u0446\u0430 \u0438 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0438\u0445 \u0441\u043e \u0441\u0442\u043e\u043b\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0434\u043d\u044f (\u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0447\u0430\u0441\u044b \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u0434\u0440\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f). \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python (pandas + matplotlib). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.  <\/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-271984","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271984","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=271984"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271984\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}