{"id":162893,"date":"2012-12-17T20:14:03","date_gmt":"2012-12-17T16:14:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=162893"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=162893","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e Pivot tables \u0432 PostgreSQL \u0438 Python<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435, \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0443-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u00ab\u043f\u043e\u043b\u0443\u00bb \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0440\u0430\u0441\u043f\u0438\u0445\u0430\u043d\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043f\u043a\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u0432 .xls, .txt \u0438\u043b\u0438 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432( \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u0435\u0447\u0435\u043d\u0438\u0439, \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0434\u043e 20-30 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432). \u0412\u0441\u0435 \u043f\u0440\u0438\u0431\u043e\u0440\u044b \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435: \u043b\u0438\u0431\u043e \u0432 ascii \u043b\u0438\u0431\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f ascii. \u041d\u0443 \u0432\u043e\u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0432\u044b \u0438 \u0441\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u0445\u0430\u043e\u0441.<\/p>\n<p>  \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u043e\u0431\u0449\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435, \u0447\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0433\u0435\u043e-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445) \u0438\u043c\u0435\u0435\u0442\u0441\u044f. \u041d\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u043e \u0432 \u0441\u0435\u0431\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0434 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0430\u043c\u0438\u0445 \u0441\u0435\u0431\u044f \u043d\u0435 \u0431\u044b\u043b\u043e.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u0430 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0432\u0435\u0449\u044c, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u043d\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c(\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u2013 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f), \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u0443\u0447\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439(\u0441\u043d\u043e\u0432\u0430 \u043a\u0443\u0447\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432), \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438. \u041e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u044f \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430<\/h4>\n<p>  \u0412\u0441\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435 \u0442\u0430\u043a \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438(\u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0441\u0440\u0435\u0434\u043d\u0435\u0435, \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435), \u043d\u043e \u0435\u0449\u0435 \u0438 \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (Pivot tables) \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432. <\/p>\n<h5>\u041f\u0440\u043e\u0441\u0442\u043e\u0435<\/h5>\n<p>  \u0423 \u043d\u0430\u0441 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0438\u0434\u0430:   <\/p>\n<table>\n<tr>\n<th>\u0413\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0441\u043c\/\u0441<\/th>\n<th>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c, %<\/th>\n<\/tr>\n<tr>\n<td>0-10<\/td>\n<td>60%<\/td>\n<\/tr>\n<tr>\n<td>10-20<\/td>\n<td>30%<\/td>\n<\/tr>\n<tr>\n<td>20-30<\/td>\n<td>10%<\/td>\n<\/tr>\n<\/table>\n<p>  \u0421\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0440\u044f\u0434 \u2013 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 10\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. \u042f \u043d\u0435 \u0433\u0443\u0440\u0443 Excel \u0438, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043d\u0430 VBA, \u043d\u0435 \u0437\u043d\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c (\u043d\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b, \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u0430\u043c\u043e\u043c excel, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0431\u043e\u0440\u0430 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440).<br \/>  \u0412 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e PostgresSQL) \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">\u0421REATE TABLE tbldata (   dataid serial NOT NULL,   measurementdate timestamp without time zone,   velocity double precision,   direction double precision ); Select 100*(count(velocity)\/(select count(*) from tbldata)::float) from tbldata velocity&gt;0 and measurement&lt;10; <\/code><\/pre>\n<p>  \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0439 \u2013 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u0435\u0433\u043a\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00ab\u043e\u0442\u00bb,\u00ab\u0448\u0430\u0433\u00bb, \u00ab\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432\u00bb \u0438 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c SETOF RECORDS. \u0412 \u0446\u0435\u043b\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0435\u043d\u0430.<\/p>\n<h5>\u041f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435<\/h5>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0432\u0438\u0434\u0430:  <\/p>\n<table>\n<tr>\n<th rowspan=\"2\">\u0413\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0441\u043c\/\u0441<\/th>\n<th colspan=\"8\">\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u043f\u043e \u0420\u0443\u043c\u0431\u0430\u043c, %<\/th>\n<\/tr>\n<tr>\n<th>\u0421<\/th>\n<th>\u0421\u0412<\/th>\n<th>\u0412<\/th>\n<th>\u042e\u0412<\/th>\n<th>\u042e<\/th>\n<th>\u042e\u0417<\/th>\n<th>\u0417<\/th>\n<th>\u0421\u0417<\/th>\n<\/tr>\n<tr>\n<td>0 \u2014 10<\/td>\n<td>10.8<\/td>\n<td>8.2<\/td>\n<td>1.3<\/td>\n<td>1.3<\/td>\n<td>2.1<\/td>\n<td>10.1<\/td>\n<td>6.9<\/td>\n<td>25.4<\/td>\n<\/tr>\n<tr>\n<td>10 \u2014 20<\/td>\n<td>4.0<\/td>\n<td>0.1<\/td>\n<td>0.1<\/td>\n<td>1.6<\/td>\n<td>3.3<\/td>\n<td>0.6<\/td>\n<td>0.1<\/td>\n<td>10.9<\/td>\n<\/tr>\n<tr>\n<td>20 \u2014 30<\/td>\n<td>1.8<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>1.2<\/td>\n<td>3.4<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>2.2<\/td>\n<\/tr>\n<tr>\n<td>30 \u2014 40<\/td>\n<td>0.7<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.8<\/td>\n<td>1.2<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.3<\/td>\n<\/tr>\n<tr>\n<td>40 \u2014 50<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.3<\/td>\n<td>0.2<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<\/tr>\n<tr>\n<td>50 \u2014 60<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.2<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<\/tr>\n<tr>\n<td>60 \u2014 70<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<\/tr>\n<tr>\n<td>70 \u2014 80<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<\/tr>\n<\/table>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u043e \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f\u043c \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"sql\">Select 100*(count(*)\/(select count(*) from tbldata)::float) from tbldata where velocity &gt;0 and velocity&lt;10 and (direction&gt;337.5 or direction&lt;22.5); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c\u0438 <a href=\"http:\/\/www.postgresql.org\/docs\/current\/static\/tablefunc.html\">crosstab<\/a>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c SQL \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u043c \u043d\u043e\u043c\u0435\u0440\u0435 \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u043c \u043d\u043e\u043c\u0435\u0440\u0435 \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e:  <\/p>\n<pre><code class=\"sql\">select 1 as VelGrd,1 as DirGrid, 100*(count(*)\/(select count(*) from tbldata)::float) from tbldata where velocity &gt;0 and velocity&lt;10 and (direction&gt;337.5 or direction&lt;22.5); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u043e, \u0448\u0430\u0433 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432 \u043a\u0430\u043a \u0434\u043b\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0434\u0430\u0441\u0442 UNION ALL \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br \/>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c   <\/p>\n<pre><code class=\"sql\">select * from crosstab(\u2018fnMakePercentageByTwoVariables(0,10,10,22.5,45,8)\u2019) as tbldata(velGrid int,dirGrid1 double precision, \u2026,dirGrid8 double precision); <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0421\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e<\/h5>\n<p>  <\/p>\n<table>\n<tr>\n<th rowspan=\"2\">\u0413\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0441\u043c\/\u0441<\/th>\n<th colspan=\"8\">\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u043f\u043e \u0420\u0443\u043c\u0431\u0430\u043c, %<\/th>\n<th rowspan=\"2\">\u0421\u0443\u043c\u043c\u0430<\/th>\n<th rowspan=\"2\">\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c, %<\/th>\n<\/tr>\n<tr>\n<th>\u0421<\/th>\n<th>\u0421\u0412<\/th>\n<th>\u0412<\/th>\n<th>\u042e\u0412<\/th>\n<th>\u042e<\/th>\n<th>\u042e\u0417<\/th>\n<th>\u0417<\/th>\n<th>\u0421\u0417<\/th>\n<\/tr>\n<tr>\n<td>0 \u2014 10<\/td>\n<td>10.8<\/td>\n<td>8.2<\/td>\n<td>1.3<\/td>\n<td>1.3<\/td>\n<td>2.1<\/td>\n<td>10.1<\/td>\n<td>6.9<\/td>\n<td>25.4<\/td>\n<td>66.1<\/td>\n<td>100.0<\/td>\n<\/tr>\n<tr>\n<td>10 \u2014 20<\/td>\n<td>4.0<\/td>\n<td>0.1<\/td>\n<td>0.1<\/td>\n<td>1.6<\/td>\n<td>3.3<\/td>\n<td>0.6<\/td>\n<td>0.1<\/td>\n<td>10.9<\/td>\n<td>20.6<\/td>\n<td>33.9<\/td>\n<\/tr>\n<tr>\n<td>20 \u2014 30<\/td>\n<td>1.8<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>1.2<\/td>\n<td>3.4<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>2.2<\/td>\n<td>8.8<\/td>\n<td>13.3<\/td>\n<\/tr>\n<tr>\n<td>30 \u2014 40<\/td>\n<td>0.7<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.8<\/td>\n<td>1.2<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.3<\/td>\n<td>3.1<\/td>\n<td>4.5<\/td>\n<\/tr>\n<tr>\n<td>40 \u2014 50<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.3<\/td>\n<td>0.2<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.7<\/td>\n<td>1.4<\/td>\n<\/tr>\n<tr>\n<td>50 \u2014 60<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.2<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.4<\/td>\n<td>0.7<\/td>\n<\/tr>\n<tr>\n<td>60 \u2014 70<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.2<\/td>\n<td>0.3<\/td>\n<\/tr>\n<tr>\n<td>70 \u2014 80<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.0<\/td>\n<td>0.1<\/td>\n<td>0.1<\/td>\n<\/tr>\n<tr>\n<td>\u0421\u0443\u043c\u043c\u0430<\/td>\n<td>17.6<\/td>\n<td>8.3<\/td>\n<td>1.4<\/td>\n<td>5.5<\/td>\n<td>10.3<\/td>\n<td>10.9<\/td>\n<td>7.1<\/td>\n<td>39.0<\/td>\n<td>100.0<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0441\u043c\/\u0441<\/td>\n<td>10.7<\/td>\n<td>2.6<\/td>\n<td>2.9<\/td>\n<td>22.6<\/td>\n<td>19.9<\/td>\n<td>4.3<\/td>\n<td>3.3<\/td>\n<td>9.2<\/td>\n<td>9.7<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0441\u043c\/\u0441<\/td>\n<td>76.2<\/td>\n<td>57.8<\/td>\n<td>50.2<\/td>\n<td>78.3<\/td>\n<td>61.1<\/td>\n<td>48.8<\/td>\n<td>42.9<\/td>\n<td>62.5<\/td>\n<td>78.3<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<\/table>\n<p>  \u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u0442\u0443\u0442 \u043c\u043e\u0435 \u0442\u0435\u0440\u043f\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c, \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0440\u0438 union \u0438 \u043e\u0434\u0438\u043d join. \u0410 \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0438 \u0435\u0449\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c? \u0415\u0449\u0435 \u043e\u0434\u0438\u043d union \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u043a\u0430 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0441\u043d\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445) \u044f \u0442\u0430\u043a \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0438 \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0440\u0443\u0447\u043a\u0430\u043c\u0438. \u0412 \u0446\u0435\u043b\u043e\u043c \u0435\u0441\u043b\u0438 \u0432\u0438\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u044d\u0442\u0438\u043c. <\/p>\n<h5>\u041a\u0443\u0434\u0430 \u0443\u0436 \u0445\u0443\u0436\u0435<\/h5>\n<p>  \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0435\u0449\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0435\u0449\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430 \u0434\u0432\u0435:  <\/p>\n<table>\n<tr>\n<th rowspan=\"3\">\u0413\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0441\u043c\/\u0441<\/th>\n<th colspan=\"5\">\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u043f\u043e \u0420\u0443\u043c\u0431\u0430\u043c, %<\/th>\n<\/tr>\n<tr>\n<th colspan=\"2\">\u0421<\/th>\n<th>&#8230;<\/th>\n<th colspan=\"2\">\u0421\u0417<\/th>\n<\/tr>\n<tr>\n<th>\u041f\u0440\u0438\u0431\u043e\u0440 1<\/th>\n<th>\u041f\u0440\u0438\u0431\u043e\u0440 2<\/th>\n<th>&#8230;<\/th>\n<th>\u041f\u0440\u0438\u0431\u043e\u0440 1<\/th>\n<th>\u041f\u0440\u0438\u0431\u043e\u0440 2<\/th>\n<\/tr>\n<tr>\n<td>0 \u2014 10<\/td>\n<td>10.8<\/td>\n<td>8.2<\/td>\n<td>&#8230;<\/td>\n<td>1.3<\/td>\n<td>1.3<\/td>\n<\/tr>\n<tr>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<td>&#8230;<\/td>\n<\/tr>\n<\/table>\n<p>  \u041d\u0430\u043c \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432 \u0441\u0445\u043e\u0434\u0443? \u041c\u043d\u0435 \u2013 \u0434\u0430. \u041a\u043e\u0433\u0434\u0430 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u043e \u0442\u0430\u043a\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0433\u0440\u0443\u0441\u0442\u043d\u043e. \u0422\u0443\u0442 \u0443\u0436 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 SPSS, \u043f\u0435\u0440\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u043c\u0435\u043d\u043d\u043e, \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0437 \u0442\u043e\u043d\u043d \u043d\u0435\u043d\u0430\u0432\u0438\u0441\u0442\u0438. \u0410 \u0435\u0449\u0435 \u0432\u0430\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0433\u0434\u0435 \u043f\u043e \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0442\u043e\u0436\u0435 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0432 Excel \u0440\u0443\u043a\u0430\u043c\u0438.<\/p>\n<h5>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u041c\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u2013 python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Django \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0418 \u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u0440\u0435\u0448\u0438\u043b \u2013 \u043a \u0447\u0435\u0440\u0442\u0443 \u0432\u0441\u0435, \u0445\u0432\u0430\u0442\u0438\u0442 \u0431\u043e\u043b\u0438 \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u043d\u0438\u0439. \u0425\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0442\u044f\u0436\u043a\u043e. \u041f\u043b\u044e\u0441 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c \u043b\u0438\u0431\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u2013 \u043b\u044e\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u043b\u0438 \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u043e \u0434\u043e \u043c\u0435\u043d\u044f, \u0434\u0430\u0439 \u0431\u043e\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0432\u0441\u0435 \u0440\u0443\u043a\u0430\u043c\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043c\u0438\u043d\u0443\u0442\u0443 \u2013 \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432 \u043b\u043e\u043f\u0430\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0439\u0441\u043a\u043e\u0435 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0418 \u0442\u0430\u043a \u0441\u043f\u0430\u0441\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u043b\u0438\u0446\u0435 <a href=\"http:\/\/pandas.pydata.org\/\">Pandas<\/a>, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u00ab\u043f\u0430\u043d\u0434\u044b\u00bb \u0432 \u0438\u0445 \u0442\u0438\u043f\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u2013 <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/dev\/dsintro.html#series\">Series<\/a>. \u041f\u043e \u0441\u0443\u0442\u0438 \u0432 \u0441\u0435\u0440\u0438\u044f\u0445 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u043e, \u0447\u0435\u0433\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0432 dict. \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432, \u0447\u0442\u043e \u0431\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0438 \u044d\u0442\u043e \u0432\u0441\u0435 \u043e\u0442 \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043f\u0430\u043d\u0434\u0435. <br \/>  \u041e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043a \u0441\u043b\u043e\u0432\u0430\u0440\u044e \u043f\u043e \u043a\u043b\u044e\u0447\u0443 s[&#8216;a&#8217;], \u0442\u0430\u043a \u0438 \u043a\u0430\u043a s.a. \u041a\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0447\u0435\u043c\u0443, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043d\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043e\u0442 numpy (\u0431\u0435\u0437 numpy.where \u0436\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443). Series \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/dev\/dsintro.html#dataframe\">DataFrame <\/a>\u2013 \u0443\u0436\u0435 \u0434\u0432\u0443\u0445 \u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. DataFrame \u0432 <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/dev\/dsintro.html#panel\">Panel<\/a>. \u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u043b\u0430\u0439\u0441\u0430\u043c\u0438, \u0441\u0430\u0431\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438, \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u0441\u043e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u2013 \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e! <\/p>\n<p>  \u0418 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043c\u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a \u043f\u043e\u0441\u0442\u0433\u0440\u0435\u0441\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430  <\/p>\n<pre><code class=\"python\">import psycopg2 import pandas as pd import numpy as np from pandas.io.sql import frame_query  conn_string = &quot;host='localhost' dbname='test' user='postgres' password='**********'&quot; conn = psycopg2.connect(conn_string) #frame_query \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 sql \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u0432\u043e\u0432\u0437\u0440\u0430\u0449\u0430\u0435\u0442 DataFrame df = frame_query('select velocity,direction from tbldata', con=conn) <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0438 \u043b\u0435\u0439\u0431\u043b\u044b \u0434\u043b\u044f \u043d\u0438\u0445<\/p>\n<pre><code class=\"python\">def makeVelocityLabels(c):     ret = dict()     for levidx in xrange(len(c.levels)):         lev=c.levels[levidx]         ret[levidx]=str(lev).replace('(',&quot;&quot;).replace(&quot;, &quot;,&quot;-&quot;).replace(']',&quot;&quot;)     return ret velGrid = np.linspace(0,100,11) dirGrid = np.linspace(-22.5,337.5,9) dirLabels=['\u0421','\u0421\u0412',&quot;\u0412&quot;,&quot;\u042e\u0412&quot;,&quot;\u042e&quot;,&quot;\u042e\u0417&quot;,&quot;\u0417&quot;,&quot;\u0421\u0417&quot;] velLabels = makeVelocityLabels(pd.cut(velGrid,velGrid)).values() <\/code><\/pre>\n<p>  \u041f\u044b\u0442\u043b\u0438\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"http:\/\/pandas.pydata.org\/pandas-docs\/dev\/basics.html?highlight=cut#discretization-and-quantiling\">cut<\/a>. \u041e\u043d\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u0437 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0433\u043e \u0440\u044f\u0434\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0439, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u0442\u0438\u043f \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438. \u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <a href=\"http:\/\/docs.scipy.org\/doc\/numpy\/reference\/generated\/numpy.where.html\">numpy.where<\/a>, \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430:  <\/p>\n<pre><code class=\"python\">for i in xrange(len(velGrid)-1):     velo\u0441ity[np.where((velocity&gt;velGrid[i]) & (velocity&lt;velGrid[i+1]))]=velGrid[i] <\/code><\/pre>\n<p>  \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c, \u044f \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u044e  <\/p>\n<pre><code class=\"python\">pd.cut(velocity,velGrid) <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 DataFrame, \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:  <\/p>\n<pre><code class=\"python\">resultDf = pd.DataFrame(index=df.index,columns=df.columns) #df[df.direction&gt;337.5].direction - \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. #\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u043e\u0441\u0442\u044b\u043b\u044c, \u0447\u0442\u043e \u0431\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. df.direction[df.direction&gt;337.5]-=360 resultDf.velocity = pd.cut(df.velocity,velGrid,labels=velLabels,include_lowest=True) resultDf.direction = pd.cut(df.direction,dirGrid,labels=dirLabels,include_lowest=True) <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u0448\u0430\u043f\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f ( \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044f \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f), \u0442\u043e \u0447\u0442\u043e \u0431\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 ( \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0438 \u0442\u043f), \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<br \/>  \u041f\u043e\u0439\u043c\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"python\">totalDir = resultDf.groupby(&quot;direction&quot;).size() direction \u0412              97 \u0417             503 \u0421            1251 \u0421\u0412            592 \u0421\u0417           2773 \u042e             736 \u042e\u0412            388 \u042e\u0417            773 <\/code><\/pre>\n<p>  \u042f \u0431\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e size() \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 count(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 missing. <br \/>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u0442\u0430\u043a \u0436\u0435 \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c, \u0434\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430, \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<pre><code class=\"python\"> dfDGr = df.copy() dfDGr.direction = resultDf.direction  meanVel = dfDGr.groupby(&quot;direction&quot;).mean() maxVel = dfDGr.groupby(&quot;direction&quot;).max() totalVel = resultDf.groupby(&quot;velocity&quot;).size() pivot = 100 * pd.pivot_table(resultDf,rows='velocity',cols='direction',aggfunc=len, fill_value=0)\/totalDir.sum()  direction         \u0412         \u0417          \u0421        \u0421\u0412         \u0421\u0417         \u042e        \u042e\u0412         \u042e\u0417 velocity                                                                                     0-10       1.279348  6.916913  10.839308  8.224378  25.432307  2.066639  1.265289  10.066076 10-20      0.056235  0.126529   3.992689  0.070294  10.881485  3.303810  1.560523   0.632644 20-30      0.000000  0.014059   1.813581  0.014059   2.235344  3.388163  1.223113   0.112470 30-40      0.014059  0.000000   0.674821  0.000000   0.323352  1.237171  0.801350   0.014059 40-50      0.000000  0.014059   0.140588  0.000000   0.056235  0.224940  0.253058   0.042176 50-60      0.014059  0.000000   0.084353  0.014059   0.042176  0.112470  0.168705   0.000000 60-70      0.000000  0.000000   0.028118  0.000000   0.014059  0.014059  0.126529   0.000000 70-80      0.000000  0.000000   0.014059  0.000000   0.000000  0.000000  0.056235   0.000000  <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0435, \u043e\u043a\u0440\u0443\u0433\u043b\u0438\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.  <\/p>\n<pre><code class=\"python\"> def getCumulate(s):     ns = s.copy()     for val in xrange(s.size):         ns[ns.index[val]]=np.sum(s[s.index[val]:s.index[s.size-1]])     return ns  pivot[&quot;\u0421\u0443\u043c\u043c\u0430&quot;] = 100 * np.round(totalVel\/float(np.sum(totalVel)),3) pivot['\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c,%']=getCumulate(pivot[&quot;\u0421\u0443\u043c\u043c\u0430&quot;])  totalDirFr = pd.DataFrame(100*totalDir\/float(np.sum(totalDir))).T totalDirFr.index= [&quot;\u0421\u0443\u043c\u043c\u0430&quot;] pivot = pivot.append(totalDirFr) meanVelFr = meanVel.T meanVelFr.index=[&quot;\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c&quot;] pivot = pivot.append(meanVelFr) maxVelFr = maxVel.T maxVelFr.index=[&quot;\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c&quot;] pivot = pivot.append(maxVelFr) #\u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 - \u0435\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e\u044e, \u0442\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432\u0435\u0437\u0434\u0435 \u0441 NA pivot=pivot.reindex(columns=np.append(dirLabels,[&quot;\u0421\u0443\u043c\u043c\u0430&quot;,&quot;\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c,%&quot;])) pivot = np.round(pivot,1).fillna(0)                           \u0421    \u0421\u0412     \u0412    \u042e\u0412     \u042e    \u042e\u0417     \u0417    \u0421\u0417  \u0421\u0443\u043c\u043c\u0430  \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c,% 0-10                   10.8   8.2   1.3   1.3   2.1  10.1   6.9  25.4   66.1             100.0 10-20                   4.0   0.1   0.1   1.6   3.3   0.6   0.1  10.9   20.6              33.9 20-30                   1.8   0.0   0.0   1.2   3.4   0.1   0.0   2.2    8.8              13.3 30-40                   0.7   0.0   0.0   0.8   1.2   0.0   0.0   0.3    3.1               4.5 40-50                   0.1   0.0   0.0   0.3   0.2   0.0   0.0   0.1    0.7               1.4 50-60                   0.1   0.0   0.0   0.2   0.1   0.0   0.0   0.0    0.4               0.7 60-70                   0.0   0.0   0.0   0.1   0.0   0.0   0.0   0.0    0.2               0.3 70-80                   0.0   0.0   0.0   0.1   0.0   0.0   0.0   0.0    0.1               0.1 \u0421\u0443\u043c\u043c\u0430                  17.6   8.3   1.4   5.5  10.3  10.9   7.1  39.0    0.0               0.0 \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c       10.7   2.6   2.9  22.6  19.9   4.3   3.3   9.2    0.0               0.0 \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c  76.2  57.8  50.2  78.3  61.1  48.8  42.9  62.5    0.0               0.0  <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0420\u0435\u0437\u044e\u043c\u0435:<\/h5>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u041c\u0435\u043d\u044c\u0448\u0435\u0439 \u043a\u0440\u043e\u0432\u044c\u044e? \u2014 \u0414\u0430. \u041f\u0440\u043e\u0449\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c? \u2014 \u0414\u0430.<br \/>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0435\u0441\u044c \u0433\u0435\u043c\u043e\u0440\u0440\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u0435\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u043e\u043d\u0438, \u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u0441\u0435 \u043d\u0430 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041d\u0430 \u043c\u043e\u0435\u043c \u0441\u043b\u0430\u0431\u0435\u043d\u044c\u043a\u043e\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u0432\u0435\u0441\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u0430 0.2 \u0441\u0435\u043a \u0434\u043b\u044f 7113 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/162893\/\"> http:\/\/habrahabr.ru\/post\/162893\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435, \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0443-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430 \u00ab\u043f\u043e\u043b\u0443\u00bb \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0440\u0430\u0441\u043f\u0438\u0445\u0430\u043d\u044b \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043f\u043a\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u0432 .xls, .txt \u0438\u043b\u0438 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u0431\u043e\u0440\u043e\u0432( \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u0440\u043e\u0432\u043d\u044f, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u0435\u0447\u0435\u043d\u0438\u0439, \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0434\u043e 20-30 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432). \u0412\u0441\u0435 \u043f\u0440\u0438\u0431\u043e\u0440\u044b \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435: \u043b\u0438\u0431\u043e \u0432 ascii \u043b\u0438\u0431\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f ascii. \u041d\u0443 \u0432\u043e\u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0432\u044b \u0438 \u0441\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u0445\u0430\u043e\u0441.<\/p>\n<p>  \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u043e\u0431\u0449\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435, \u0447\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0433\u0435\u043e-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445) \u0438\u043c\u0435\u0435\u0442\u0441\u044f. \u041d\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u043e \u0432 \u0441\u0435\u0431\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0434 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0430\u043c\u0438\u0445 \u0441\u0435\u0431\u044f \u043d\u0435 \u0431\u044b\u043b\u043e.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u0430 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0432\u0435\u0449\u044c, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u043d\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c(\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u2013 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f), \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u0443\u0447\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439(\u0441\u043d\u043e\u0432\u0430 \u043a\u0443\u0447\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432), \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438. \u041e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u044f \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/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-162893","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162893","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=162893"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162893\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}