{"id":286952,"date":"2017-05-28T00:40:03","date_gmt":"2017-05-27T20:40:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286952"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286952","title":{"rendered":"\u0410\u043d\u0430\u043b\u0438\u0437 \u0440\u044b\u043d\u043a\u0430 \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043b\u0435\u0441\u0430"},"content":{"rendered":"<p>\u0420\u0435\u0448\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043c\u0438\u043d\u0441\u043a\u043e\u043c \u0440\u044b\u043d\u043a\u0435 \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u0432\u0430\u0440\u0442\u0438\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d <a href=\"http:\/\/www.t-s.by\">\u0441\u0430\u0439\u0442 <\/a>\u0440\u0438\u044d\u043b\u0442\u0435\u0440\u0441\u043a\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u0430 &quot;\u0422\u0432\u043e\u044f \u0441\u0442\u043e\u043b\u0438\u0446\u0430&quot;.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041f\u043b\u0430\u043d \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<\/ol>\n<p>  <\/p>\n<p><h2>1. \u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430\u043c \u0441 \u0441\u0430\u0439\u0442\u0430 \u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f Scrapy.<br \/>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u2014 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 <a href=\"https:\/\/docs.scrapy.org\/en\/latest\/intro\/tutorial.html\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u043c<\/a> <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>scrapy startproject tutorial<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432 .\/tutorial\/spiders \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c &#39;&#39;\u043f\u0430\u0443\u043a\u0430&#39;&#39;<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import scrapy  def extract_item_content(item, selection_expression, skip_chars=None):     content = item.css(selection_expression).extract_first()     if skip_chars and content:         return content.strip(skip_chars)     return content  class TvojaStolicaSpider(scrapy.Spider):     name = &quot;t-s&quot;     start_urls = ['http:\/\/www.t-s.by\/buy\/flats\/']      def parse(self, response):         for item in response.css('ul.apart_body li.apart_item'):             details_page_url = extract_item_content(item, 'div.item_descr h4 a::attr(href)')             yield response.follow(details_page_url, callback=self.parse_details)          next_page = response.css('li.arr a.page-lnk::attr(href)').extract_first()         if next_page is not None:             yield response.follow(next_page, callback=self.parse)      def parse_details(self, response):         params = {}         for item in response.css('ul.about_params li.about_param'):             key = item.css('div.param_name::text').extract_first()             value = extract_item_content(item, 'div.param_descr::text', '\\n\\t ')              if key == u'\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d':                 value = extract_item_content(item, 'div.param_descr a::text', '\\t')              params[key] = value          params[u'\u0426\u0435\u043d\u0430'] = response.css('div.about_price_ye::text').extract_first()         params[u'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435'] = response.css('div.about_descr p::text').extract_first()         return params<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u043d\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043b\u0438 &quot;t-s&quot; \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 &quot;\u043f\u0430\u0443\u043a\u0430&quot; \u0438 url \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0418\u0437-\u0437\u0430 \u043f\u0435\u0439\u0434\u0436\u0438\u043d\u0433\u0430 \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u0432\u0430\u0440\u0442\u0438\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u0435 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043e\u0434\u043d\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0435\u0439\u0434\u0436\u0438\u043d\u0433\u0430<\/li>\n<li>\u0434\u0440\u0443\u0433\u0443\u044e \u2014 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0443\u0441\u0441\u043a\u0438\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 settings.py:<\/p>\n<p>  <\/p>\n<pre><code>FEED_EXPORT_ENCODING = 'utf-8'<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<\/p>\n<p>  <\/p>\n<pre><code>scrapy crawl t-s -o result.json<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 t-s \u2014 \u0438\u043c\u044f &quot;\u043f\u0430\u0443\u043a\u0430&quot;, \u0430 result.json \u2014 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, &quot;\u0432 \u0441\u0438\u043b\u0443 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0447\u0438\u043d&quot; spyder \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u2014 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code>scrapy crawl t-s -t json --nolog -o - &gt; result.json<\/code><\/pre>\n<p>  <\/p>\n<p>\u043d\u043e \u043b\u0438\u0448\u0438\u043c\u0441\u044f \u043b\u043e\u0433\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u0442\u0430\u043f\u0443:<\/p>\n<p>  <\/p>\n<p><h2>2. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 DataFrame<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import json import pandas as pd import numpy as np  with open('result.json') as data_file:         data = json.load(data_file)  df = pd.io.json.json_normalize(data)  # \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432: pd.set_option('display.max_columns', 200) pd.set_option('display.max_rows', 25)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0430\u0437\u043c\u0435\u0440\u044b DataFrame:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>df.shape<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>(410, 20)<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u041d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0438\u043c\u0435\u0435\u043c 410 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 20 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c &#39;\u041a\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430&#39;, \u0430 \u0441\u0430\u043c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 &#8212; \u0443\u0434\u0430\u043b\u044f\u0435\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df.index = df[u'\u041a\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430'].apply(pd.to_numeric) del df[u'\u041a\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430']<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df.ix[818272]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>\u0410\u0434\u0440\u0435\u0441                                            \u0422\u0430\u0448\u043a\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0443\u043b., 24 \u043a\u043e\u0440\u043f\u0443\u0441 3 \u0411\u0430\u043b\u043a\u043e\u043d                                                    \u043b\u043e\u0434\u0436\u0438\u044f \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u0430\u044f \u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e                                                           NaN \u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430                                                    0 \u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438                                                            1977 \u0413\u043e\u0440\u043e\u0434                                                                   \u041c\u0438\u043d\u0441\u043a \u041a\u043e\u043c\u043d\u0430\u0442\u044b                                                                     3 \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d                                                    \u0431\u043b\u043e\u043a-\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d                                                            \u0427\u0438\u0436\u043e\u0432\u043a\u0430 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                    \u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0432 \u0442\u0440\u0435\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u0432 \u043c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d\u0435... \u041f\u043b\u043e\u0449\u0430\u0434\u0438                                                   71.4 \/ 13.95 \/ 9.16 \u041f\u043e\u043b\u044b                                                                 \u043b\u0438\u043d\u043e\u043b\u0435\u0443\u043c \u0420\u0430\u0439\u043e\u043d                                                         \u0417\u0430\u0432\u043e\u0434\u0441\u043a\u043e\u0439 \u0440\u0430\u0439\u043e\u043d \u0421\u0430\u043d\u0443\u0437\u0435\u043b                                                            \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0422\u0435\u043b\u0435\u0444\u043e\u043d                                                                  \u0435\u0441\u0442\u044c \u0422\u0438\u043f \u0434\u043e\u043c\u0430                                                          \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438                                                \u0447\u0438\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0430 \u0426\u0435\u043d\u0430                                                            15 500 \u0443. \u0435.  \u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c                                                          2\/9<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u0445 \u0447\u0430\u0441\u0442\u044c:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df.ix[818272][{u'\u0410\u0434\u0440\u0435\u0441',u'\u0426\u0435\u043d\u0430',u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'}]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>\u0426\u0435\u043d\u0430                               15 500 \u0443. \u0435.  \u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c                             2\/9 \u0410\u0434\u0440\u0435\u0441               \u0422\u0430\u0448\u043a\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0443\u043b., 24 \u043a\u043e\u0440\u043f\u0443\u0441 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0441\u0438\u043b\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u0430\u0439\u0442\u0430 t-s.by \u043a\u043e\u0434 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b 818272 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 url:<br \/>  <a href=\"http:\/\/www.t-s.by\/buy\/flats\/818272\/\">http:\/\/www.t-s.by\/buy\/flats\/818272\/<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0435\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df.columns<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>Index([u'\u0410\u0434\u0440\u0435\u0441', u'\u0411\u0430\u043b\u043a\u043e\u043d', u'\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e', u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430',        u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438', u'\u0413\u043e\u0440\u043e\u0434', u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b', u'\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d', u'\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d',        u'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435', u'\u041f\u043b\u043e\u0449\u0430\u0434\u0438', u'\u041f\u043e\u043b\u044b', u'\u0420\u0430\u0439\u043e\u043d', u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b', u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d',        u'\u0422\u0438\u043f \u0434\u043e\u043c\u0430', u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438', u'\u0426\u0435\u043d\u0430', u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'],       dtype='object')<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0427\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 &#39;\u0413\u043e\u0440\u043e\u0434&#39;<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0413\u043e\u0440\u043e\u0434'].value_counts()[:10]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>\u041c\u0438\u043d\u0441\u043a          354 \u041b\u0435\u0441\u043d\u043e\u0439           8 \u041f\u0440\u0438\u043b\u0443\u043a\u0438          6 \u0417\u0430\u0441\u043b\u0430\u0432\u043b\u044c         6 \u0414\u0437\u0435\u0440\u0436\u0438\u043d\u0441\u043a        6 \u0424\u0430\u043d\u0438\u043f\u043e\u043b\u044c         4 \u0411\u043e\u0440\u043e\u0432\u043b\u044f\u043d\u044b        4 \u041c\u0438\u0445\u0430\u043d\u043e\u0432\u0438\u0447\u0438       3 \u0420\u0430\u0434\u043e\u0448\u043a\u043e\u0432\u0438\u0447\u0438      2 \u0421\u0432\u0438\u0441\u043b\u043e\u0447\u044c         1<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u041c\u0438\u043d\u0441\u043a\u0430, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u043a \u043d\u0435\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df = df[df[u'\u0413\u043e\u0440\u043e\u0434'] == u'\u041c\u0438\u043d\u0441\u043a'] del df[u'\u0413\u043e\u0440\u043e\u0434']<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h2 id=\"razbiraemsya-s-propuskami-v-dannyh\">\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043c\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>  <\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0445 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0412 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044d\u0442\u043e\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b, \u0430 \u043d\u0435 \u0435\u0435 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c\/\u0440\u0438\u0435\u043b\u0442\u043e\u0440\u043e\u043c<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0410\u0434\u0440\u0435\u0441<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u043b\u0438\u0446\u044b \u0438 \u043d\u043e\u043c\u0435\u0440 \u0434\u043e\u043c\u0430, \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0446\u0435\u043d\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 &#8216;\u0420\u0430\u0439\u043e\u043d&#8217; \u0438 &#8216;\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d&#8217;<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u043b\u043a\u043e\u043d<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0411\u0430\u043b\u043a\u043e\u043d'].fillna(u'\u043d\u0435\u0442\u0443', inplace=True) df[u'\u0411\u0430\u043b\u043a\u043e\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043b\u043e\u0434\u0436\u0438\u044f \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u0430\u044f              167 \u0431\u0430\u043b\u043a\u043e\u043d \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0439               62 2 \u043b\u043e\u0434\u0436\u0438\u0438 \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0435             37 \u043d\u0435\u0442\u0443                              36 \u0431\u0430\u043b\u043a\u043e\u043d                            28 \u043b\u043e\u0434\u0436\u0438\u044f                             8 2 \u0431\u0430\u043b\u043a\u043e\u043d\u0430 \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0435             5 2 \u043b\u043e\u0434\u0436\u0438\u0438                           3 \u043b\u043e\u0434\u0436\u0438\u044f \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u0430\u044f + \u0432\u0430\u0433\u043e\u043d\u043a\u0430      3 3\u043b\u0437                                3 3\u043b                                 1 \u0431\u0430\u043b\u043a\u043e\u043d \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0439 + \u0432\u0430\u0433\u043e\u043d\u043a\u0430      1<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043a\u0440\u0430\u0442\u0438\u043c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def common_converter(mapping, param):     if param in mapping:         return mapping[param]     return param  balcony_mapping = {         u'\u0431\u0430\u043b\u043a\u043e\u043d \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0439':u'\u0431\u0430\u043b\u043a\u043e\u043d',         u'\u043b\u043e\u0434\u0436\u0438\u044f \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u0430\u044f':u'\u043b\u043e\u0434\u0436\u0438\u044f',         u'\u043b\u043e\u0434\u0436\u0438\u044f \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u0430\u044f + \u0432\u0430\u0433\u043e\u043d\u043a\u0430':u'\u043b\u043e\u0434\u0436\u0438\u044f',         u'\u0431\u0430\u043b\u043a\u043e\u043d \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0439 + \u0432\u0430\u0433\u043e\u043d\u043a\u0430':u'\u0431\u0430\u043b\u043a\u043e\u043d',         u'2 \u0431\u0430\u043b\u043a\u043e\u043d\u0430 \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0435':u'2 \u0431\u0430\u043b\u043a\u043e\u043d\u0430',         u'2 \u043b\u043e\u0434\u0436\u0438\u0438 \u0437\u0430\u0441\u0442\u0435\u043a\u043b\u0435\u043d\u043d\u044b\u0435':u'2 \u043b\u043e\u0434\u0436\u0438\u0438',         u'3\u043b\u0437':u'3 \u043b\u043e\u0434\u0436\u0438\u0438',         u'3\u043b':u'3 \u043b\u043e\u0434\u0436\u0438\u0438'             }  df[u'\u0411\u0430\u043b\u043a\u043e\u043d'] = df[u'\u0411\u0430\u043b\u043a\u043e\u043d'].map(lambda x: common_converter(balcony_mapping, x)) df[u'\u0411\u0430\u043b\u043a\u043e\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043b\u043e\u0434\u0436\u0438\u044f       178 \u0431\u0430\u043b\u043a\u043e\u043d        91 2 \u043b\u043e\u0434\u0436\u0438\u0438      40 \u043d\u0435\u0442\u0443          36 2 \u0431\u0430\u043b\u043a\u043e\u043d\u0430      5 3 \u043b\u043e\u0434\u0436\u0438\u0438       4<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e'].fillna(u'\u043d\u0435\u0442\u0443', inplace=True) df[u'\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043d\u0435\u0442\u0443                         156 \u0423\u0440\u0443\u0447\u044c\u0435                        22 \u041a\u0430\u043c\u0435\u043d\u043d\u0430\u044f \u0433\u043e\u0440\u043a\u0430                21 \u0413\u0440\u0443\u0448\u0435\u0432\u043a\u0430                      18 \u041a\u0443\u043d\u0446\u0435\u0432\u0449\u0438\u043d\u0430                    16 \u0410\u043a\u0430\u0434\u0435\u043c\u0438\u044f \u043d\u0430\u0443\u043a                 13 \u0421\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u0430\u044f                    10 \u041c\u043e\u0433\u0438\u043b\u0435\u0432\u0441\u043a\u0430\u044f                   10 \u041c\u0430\u043b\u0438\u043d\u043e\u0432\u043a\u0430                     10 \u041f\u043e\u0431\u0435\u0434\u044b \u043f\u043b.                    10 \u042f\u043a\u0443\u0431\u0430 \u041a\u043e\u043b\u0430\u0441\u0430 \u043f\u043b.               9 \u0412\u043e\u0441\u0442\u043e\u043a                         6                             ...  \u041f\u0443\u0448\u043a\u0438\u043d\u0441\u043a\u0430\u044f                     5 \u041f\u0435\u0442\u0440\u043e\u0432\u0449\u0438\u043d\u0430                     5 \u041c\u043e\u043b\u043e\u0434\u0435\u0436\u043d\u0430\u044f                     4 \u041f\u0430\u0440\u043a \u0427\u0435\u043b\u044e\u0441\u043a\u0438\u043d\u0446\u0435\u0432               4 \u041f\u0440\u043e\u043b\u0435\u0442\u0430\u0440\u0441\u043a\u0430\u044f                   3 \u041a\u0443\u043f\u0430\u043b\u043e\u0432\u0441\u043a\u0430\u044f (\u041e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0430\u044f)      3 \u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0430\u044f                     3 \u041c\u0438\u0445\u0430\u043b\u043e\u0432\u043e                       2 \u0422\u0440\u0430\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u0432\u043e\u0434               2 \u041f\u0435\u0440\u0432\u043e\u043c\u0430\u0439\u0441\u043a\u0430\u044f                   2 \u0424\u0440\u0443\u043d\u0437\u0435\u043d\u0441\u043a\u0430\u044f                    2 \u041d\u0435\u043c\u0438\u0433\u0430                         1<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e: \u0432 \u0423\u0440\u0443\u0447\u044c\u0435 \u0438 \u0413\u0440\u0443\u0448\u0435\u0432\u043a\u0435 \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0441\u0442\u0440\u043e\u0435\u043a, \u0430 \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 \u041a\u0430\u043c\u0435\u043d\u043d\u043e\u0439 \u0433\u043e\u0440\u043a\u0438 \u0438 \u041a\u0443\u043d\u0446\u0435\u0432\u0449\u0438\u043d\u044b \u043d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043b\u044c\u0433\u043e\u0442\u043d\u043e\u0433\u043e \u0436\u0438\u043b\u044c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0434\u0430\u044e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u043d\u0435\u043b\u044c\u0433\u043e\u0442\u043d\u0438\u043a\u0438 \ud83d\ude42<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432\u0432\u0435\u0434\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0435: '\u041b\u0435\u0442 \u0434\u043e\u043c\u0443' \u0438 '\u041b\u0435\u0442 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430': df[u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438'] = df[u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438'].apply(pd.to_numeric) df[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430'] = df[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430'].apply(pd.to_numeric)  import datetime current_year = datetime.datetime.now().year  def years_from_last_repair(row):     if row[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430'] == 0:         row[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430'] = row[u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438']     return current_year - row[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430']  df[u'\u041b\u0435\u0442 \u0434\u043e\u043c\u0443'] = df[u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438'].map(lambda x: current_year - x) df[u'\u041b\u0435\u0442 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043c\u043e\u043d\u0442\u0430'] = df.apply(lambda row: years_from_last_repair(row), axis=1) df[u'\u0411\u044b\u043b \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442'] = df[u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430']!=0  # \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0432\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u043c: df.drop({u'\u0413\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438', u'\u0413\u043e\u0434 \u043a\u0430\u043f\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043c\u043e\u043d\u0442\u0430'}, axis=1, inplace=True)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043c\u043d\u0430\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>1\/1    106 2\/2    101 3\/3     85 4\/4     14 3\/2     11 3\/1      9 2\/1      7 2        6 3        4 4\/1      3 4        2 4\/3      2 6\/6      1 4\/2      1 5\/5      1 1\/2      1<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u2014 \u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430, \u0430 \u043d\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430. \u041e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df = df[df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'] != '1\/2']<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u043a\u043e\u043c\u043d\u0430\u0442: df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'] = df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'].map(lambda x: x if x.find('\/') == -1 else x.split('\/')[0]) df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'] = df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'].apply(pd.to_numeric) df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>2    114 3    109 1    106 4     22 6      1 5      1<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u0435\u0442\u0441\u044f 2,3,1-\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u044b\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b-\u0432\u043e \u043a\u043e\u043c\u043d\u0430\u0442: np.mean(df[u'\u041a\u043e\u043c\u043d\u0430\u0442\u044b'])<\/code><\/pre>\n<p>  <\/p>\n<pre><code>2.1529745042492916<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043f\u0430\u043d\u0435\u043b\u044c\u043d\u044b\u0439            160 \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u044b\u0439            100 \u043a\u0430\u0440\u043a\u0430\u0441\u043d\u043e-\u0431\u043b\u043e\u0447\u043d\u044b\u0439      37 \u0431\u043b\u043e\u043a-\u043a\u043e\u043c\u043d\u0430\u0442\u044b          21 \u0441\u0438\u043b\u0438\u043a\u0430\u0442\u043d\u043e-\u0431\u043b\u043e\u0447\u043d\u044b\u0439     19 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u0439            16<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043d\u0435\u0442<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0430\u0439\u043e\u043d \u0438 \u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0420\u0430\u0439\u043e\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u0424\u0440\u0443\u043d\u0437\u0435\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d     85 \u041f\u0435\u0440\u0432\u043e\u043c\u0430\u0439\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d    55 \u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d      52 \u041b\u0435\u043d\u0438\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d       36 \u0417\u0430\u0432\u043e\u0434\u0441\u043a\u043e\u0439 \u0440\u0430\u0439\u043e\u043d       34 \u0421\u043e\u0432\u0435\u0442\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d       28 \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0439\u043e\u043d     26 \u041e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d     21 \u041f\u0430\u0440\u0442\u0438\u0437\u0430\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d    16<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0443\u043a\u0430\u0437\u0430\u043d \u0443 \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u041c\u0430\u043b\u0438\u043d\u043e\u0432\u043a\u0430                                                  18 \u0423\u0440\u0443\u0447\u044c\u0435                                                     18 \u0421\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u043a\u0430                                                 17 \u0421\u0443\u0445\u0430\u0440\u0435\u0432\u043e                                                   17 \u0420.\u041b\u044e\u043a\u0441\u0435\u043c\u0431\u0443\u0440\u0433, \u041a.\u041b\u0438\u0431\u043a\u043d\u0435\u0445\u0442\u0430                                  15 \u041a\u0443\u043d\u0446\u0435\u0432\u0449\u0438\u043d\u0430                                                 13 \u0410\u043d\u0433\u0430\u0440\u0441\u043a\u0430\u044f                                                  11 \u0427\u0438\u0436\u043e\u0432\u043a\u0430                                                    10 \u0427\u0435\u0440\u0432\u044f\u043a\u043e\u0432\u0430, \u0428\u0435\u0432\u0447\u0435\u043d\u043a\u043e                                        10 \u041a\u0430\u043c\u0435\u043d\u043d\u0430\u044f \u0433\u043e\u0440\u043a\u0430                                              9 \u041f\u0443\u0448\u043a\u0438\u043d\u0430, \u0413\u043b\u0435\u0431\u043a\u0438, \u041f\u0440\u0438\u0442\u044b\u0446\u043a\u043e\u0433\u043e, \u041e\u043b\u044c\u0448\u0435\u0432\u0441\u043a\u043e\u0433\u043e, \u041a\u0430\u043b\u044c\u0432\u0430\u0440\u0438\u0439\u0441\u043a\u0430\u044f     9 \u041c\u0430\u0441\u044e\u043a\u043e\u0432\u0449\u0438\u043d\u0430                                                 9                                                            .. \u0414\u0440\u0443\u0436\u0431\u0430, \u0411\u0440\u0438\u043b\u0435\u0432\u0438\u0447\u0438                                           2 \u0422\u0440\u0430\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0417\u0430\u0432\u043e\u0434                                            2 \u041a\u0438\u0436\u0435\u0432\u0430\u0442\u043e\u0432\u0430, \u0410\u0441\u0430\u043d\u0430\u043b\u0438\u0435\u0432\u0430                                      2 \u0414\u0437\u0435\u0440\u0436\u0438\u043d\u0441\u043a\u043e\u0433\u043e, \u0425\u043c\u0435\u043b\u0435\u0432\u0441\u043a\u043e\u0433\u043e, \u0429\u043e\u0440\u0441\u0430                            2 \u0412\u0430\u043d\u0435\u0435\u0432\u0430, \u041f\u0430\u0440\u0442\u0438\u0437\u0430\u043d\u0441\u043a\u0438\u0439                                       1 \u0421\u0435\u043b\u044c\u0445\u043e\u0437 \u043f\u043e\u0441\u0451\u043b\u043e\u043a                                             1 \u0420\u0430\u0439\u043e\u043d \u0414\u041a &quot;\u041c\u0410\u0417&quot;                                              1 \u0421\u0435\u0434\u044b\u0445, \u0422\u0438\u043a\u043e\u0446\u043a\u043e\u0433\u043e                                            1 \u0411\u0430\u0433\u0440\u0430\u0442\u0438\u043e\u043d\u0430, \u041c\u0435\u043d\u0434\u0435\u043b\u0435\u0435\u0432\u0430, \u0423\u0440\u0430\u043b\u044c\u0441\u043a\u0430\u044f                           1 \u0421\u043e\u0441\u043d\u044b                                                       1 \u041d\u0435\u043c\u0438\u0433\u0430, \u041a\u043e\u0440\u043e\u043b\u044f                                              1 \u0412\u0435\u0441\u043d\u044f\u043d\u043a\u0430                                                    1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0439 '\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d': df[u'\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d'].fillna(u'\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d', inplace=True)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043b\u043e\u0449\u0430\u0434\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c'] = df[u'\u041f\u043b\u043e\u0449\u0430\u0434\u0438'].map(lambda x: float(x.split(' \/ ')[0])) df[u'\u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c'] = df[u'\u041f\u043b\u043e\u0449\u0430\u0434\u0438'].map(lambda x: float(x.split(' \/ ')[1])) df[u'\u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438'] = df[u'\u041f\u043b\u043e\u0449\u0430\u0434\u0438'].map(lambda x: float(x.split(' \/ ')[2]))  # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 '\u041f\u043b\u043e\u0449\u0430\u0434\u0438': df = df.drop(u'\u041f\u043b\u043e\u0449\u0430\u0434\u0438', axis=1)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0421\u0440\u0435\u0434\u043d\u0438\u044f\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 np.mean(df[u'\u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c']), np.mean(df[u'\u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c']), np.mean(df[u'\u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438'])<\/code><\/pre>\n<p>  <\/p>\n<pre><code>(60.66762039660057, 35.14807365439093, 8.711161473087818)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u041f\u043e\u043b\u044b'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043b\u0430\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u044b\u0435        105 \u043b\u0438\u043d\u043e\u043b\u0435\u0443\u043c             104 \u043f\u0430\u0440\u043a\u0435\u0442                55 \u0434\u0435\u0440\u0435\u0432\u044f\u043d\u043d\u044b\u0435            36 \u0414\u0421\u041f                    3 \u043a\u043e\u0432\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435      2<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u041f\u043e\u043b\u044b'].fillna(u'\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e', inplace=True)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0430\u043d\u0443\u0437\u0435\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[df[u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b'].isnull()]<\/code><\/pre>\n<p>  <\/p>\n<p>\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0434\u0438\u043d \u0434\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0441\u0430\u043d\u0443\u0437\u043b\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0442\u0443, \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 \u0443\u043b\u0438\u0446\u0435 \u0440\u044f\u0434\u043e\u043c. \u0414\u043e\u043c 1949\u0433\u043e \u0433\u043e\u0434\u0430, \u0431\u0435\u0437 \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442\u0430, \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df.drop(821155, inplace=True)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">toilet_mapping = {     u'2 \u0441\u0430\u043d.\u0443\u0437\u043b\u0430':u'\u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439',     u'3 \u0441\u0430\u043d.\u0443\u0437\u043b\u0430':u'\u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439'     }  df[u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b'] = df[u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b'].map(lambda x: common_converter(toilet_mapping, x)) df[u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439     268 \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439     84<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u043b\u0435\u0444\u043e\u043d<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u0435\u0441\u0442\u044c          273 \u043d\u0435\u0442            78 2 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430      1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d'] = df[u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d'].map(lambda x: common_converter({u'2 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430':u'\u0435\u0441\u0442\u044c'}, x))<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0438\u043f \u0434\u043e\u043c\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0422\u0438\u043f \u0434\u043e\u043c\u0430'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u043d\u043e\u0432\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0430         78 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435         49 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442    45 \u0431\u0440\u0435\u0436\u043d\u0435\u0432\u043a\u0430           29 \u0445\u0440\u0443\u0449\u0435\u0432\u043a\u0430            21 \u0441\u0442\u0430\u043b\u0438\u043d\u043a\u0430            19 \u0447\u0435\u0448\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442      13<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u0422\u0438\u043f \u0434\u043e\u043c\u0430'].fillna(u'\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d', inplace=True)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df[u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u0447\u0438\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0430          234 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b     57 \u043e\u0431\u043c\u0435\u043d                     7 \u043e\u0431\u043c\u0435\u043d - \u0440\u0430\u0437\u044a\u0435\u0437\u0434           1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438'].fillna(u'\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d', inplace=True) df[u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438'] = df[u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438'].map(lambda x: common_converter({u'\u043e\u0431\u043c\u0435\u043d - \u0440\u0430\u0437\u044a\u0435\u0437\u0434':u'\u043e\u0431\u043c\u0435\u043d'}, x))<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0426\u0435\u043d\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 'price' \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c\u0443: # u'12 000 \u0443. \u0435. somestring' -&gt; u'12 000' -&gt; u'12000' -&gt; 12000.0 df[u'\u0426\u0435\u043d\u0430'] = df[u'\u0426\u0435\u043d\u0430'].map(lambda x: float(x[:x.find(u' \u0443. \u0435.')].replace(' ','')))<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">%matplotlib inline import seaborn as sns  # \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440 \u043f\u043e \u0446\u0435\u043d\u0435: sns.distplot(df[u'\u0426\u0435\u043d\u0430']\/1000);<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/7e9\/805\/029\/7e980502993a46818a3a4a19f46c6bb4.png\"\/><\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u041a\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 &quot;\u0445\u0432\u043e\u0441\u0442\u0430&quot; \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e. # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430\u043c\u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043d\u0438\u0436\u0435 \u043d\u0435\u043a\u043e\u0433\u043e \u043f\u043e\u0440\u043e\u0433\u0430, \u0441\u043a\u0430\u0436\u0435\u043c 150 \u0442\u044b\u0441 \u0443.\u0435.: df = df[df[u'\u0426\u0435\u043d\u0430'] &lt; 150000]<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0437\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u0430\u043c, \u0430 \u043d\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0443\u043b\u044c\u0442\u0440\u0430\u043d\u0438\u0437\u043a\u043e\u0439 \u0446\u0435\u043d\u043e\u0439. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0440\u043e\u0433\u0430 \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 35 \u0442\u044b\u0441 \u0443.\u0435.:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[df[u'\u0426\u0435\u043d\u0430'] &lt; 35000][u'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435']<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u041a\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 818272    \u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0432 \u0442\u0440\u0435\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u0432 \u043c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d\u0435... 822608    \u0414\u0432\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0432 \u0442\u0440\u0435\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435. \u0421\u0442\u0435\u043a\u043b\u043e\u043f\u0430... 847586    \u041e\u0434\u043d\u043e\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u0430\u044f \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430 \u0432 \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u043e\u043c \u0434\u043e\u043c\u0435. \u041a\u043e\u043c\u043d\u0430... 844689    \u0414\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d\u0435 \u0441 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0439 ... 834349     \u041e\u0434\u043d\u043e\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u0430\u044f \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430 \u043f\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d... 836501    \u041a\u043e\u043c\u043d\u0430\u0442\u0430 17.6 \u043c\u0435\u0442\u0440\u0430 \u0432 \u0434\u0432\u0443\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435 \u0441 ... 787265    \u0414\u0432\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b 16 \u0438 8.8 \u043c2 (46\/100 \u0434\u043e\u043b\u0438) \u0432 \u0447\u0435\u0442\u044b\u0440\u0435... 777826    27\/100 \u0434\u043e\u043b\u0438 \u0432 \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435. \u0412 \u043f\u0440\u0430... 829281    \u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0441 \u0431\u0430\u043b\u043a\u043e\u043d\u043e\u043c \u0432 \u0442\u0440\u0435\u0445\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435. \u041e... 846239    1-\u043d\u0430 \u043a\u043e\u043c\u043d\u0430\u0442\u043d\u0430\u044f \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430 \u043d\u0430 4-\u043e\u043c \u044d\u0442\u0430\u0436\u0435 5-\u0442\u0438 \u044d\u0442\u0430... 830075    \u041a\u0438\u0440\u043f\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c \u0432 \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0439\u043e\u043d\u0435. \u0412 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435...<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438\u0431\u043e \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u043b\u0438\u0431\u043e &#8216;\u043a\u0438\u0440\u043f\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c&#8217;, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0448\u0435 \u043f\u043e\u0440\u043e\u0433\u0430: df = df[df[u'\u0426\u0435\u043d\u0430'] &gt; 35000]<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: sns.distplot(df[u'\u0426\u0435\u043d\u0430']\/1000);<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/7c9\/9c6\/909\/7c99c69095ee45e0983249df4e09ed9f.png\"\/><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u042d\u0442\u0430\u0436\/\u044d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[df[u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].isnull()]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043a\u0432\u0430\u0440\u0442\u0438\u0440 \u044d\u0442\u0430\u0436 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d. \u0421\u0443\u0434\u044f \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0442\u0438\u043f \u0434\u043e\u043c\u0430 \u2014 \u0447\u0435\u0448\u0441\u043a\u0438\u0439, \u044d\u0442\u0430\u0436\u0435\u0439 \u0432 \u0434\u043e\u043c\u0435 9. \u042d\u0442\u0430\u0436 \u0443\u043a\u0430\u0436\u0435\u043c \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0434\u043e\u043c\u0430, \u0442.\u043a. \u0441\u0443\u0434\u044f \u0446\u0435\u043d\u0435 \u0432 52 \u0442\u044b\u0441. \u043e\u043d \u043d\u0435 \u043a\u0440\u0430\u0439\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df.loc[df[u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].isnull(), u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'] = u'5\/9'<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df.ix[847125]<\/code><\/pre>\n<p>  <\/p>\n<pre><code>\u0410\u0434\u0440\u0435\u0441                                                     \u041e\u0434\u0438\u043d\u0446\u043e\u0432\u0430 \u0443\u043b., 69 \u0411\u0430\u043b\u043a\u043e\u043d                                                            2 \u043b\u043e\u0434\u0436\u0438\u0438 \u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e                                             \u041a\u0430\u043c\u0435\u043d\u043d\u0430\u044f \u0433\u043e\u0440\u043a\u0430 \u041a\u043e\u043c\u043d\u0430\u0442\u044b                                                                  1 \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d                                                    \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u044b\u0439 \u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d                                                       \u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                 \u041e\u0434\u043d\u043e\u043a\u043e\u043c\u043d\u0430\u0442\u043d\u0430\u044f \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430 \u0432 \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u043e\u043c \u0434\u043e\u043c\u0435 1995 \u0433... \u041f\u043e\u043b\u044b                                                                \u043f\u0430\u0440\u043a\u0435\u0442 \u0420\u0430\u0439\u043e\u043d                                                    \u0424\u0440\u0443\u043d\u0437\u0435\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d \u0421\u0430\u043d\u0443\u0437\u0435\u043b                                                         \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0422\u0435\u043b\u0435\u0444\u043e\u043d                                                                \u043d\u0435\u0442 \u0422\u0438\u043f \u0434\u043e\u043c\u0430                                                    \u0447\u0435\u0448\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438                                             \u0447\u0438\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0430 \u0426\u0435\u043d\u0430                                                                 52000 \u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c                                                       5\/9 \u041b\u0435\u0442 \u0434\u043e\u043c\u0443                                                                22 \u041b\u0435\u0442 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043c\u043e\u043d\u0442\u0430                                                   22 \u0411\u044b\u043b \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442                                                        False \u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c                                                         43.9 \u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c                                                         18.3 \u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438                                                          8.8<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u042d\u0442\u0430\u0436'] = df[u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].map(lambda x: int(x.split('\/')[0])) df[u'\u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'] = df[u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].map(lambda x: int(x.split('\/')[1]))<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u042d\u0442\u0430\u0436'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>2     53 5     43 1     36 4     36 3     31 9     24 7     22 6     21 8     19 12     8 10     6 11     6 19     5 18     5 14     3 17     3 16     2 13     1 20     1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">sns.distplot(df[u'\u042d\u0442\u0430\u0436'], kde=False, bins=20);<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/ffa\/a25\/4dc\/ffaa254dcae948a0b649f927c9dfee84.png\"\/><\/p>\n<p>  <\/p>\n<p> \u2014 \u041f\u0440\u0435\u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u043d\u0430 \u043d\u0438\u0436\u043d\u0438\u0445 \u044d\u0442\u0430\u0436\u0430\u0445 \u043f\u043e 5\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>9     128 5      59 12     25 19     25 10     20 4      16 20     10 2       7 7       6 16      5 13      4 14      3 8       3 3       3 11      2 21      2 24      1 15      1 17      1 18      1 6       1 22      1 25      1<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">sns.distplot(df[u'\u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'], kde=False);<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/web\/94d\/e8a\/bc6\/94de8abc63ae4445b4c0efb56e524d5d.png\"\/><br \/>   \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 9 \u0438 5-\u044d\u0442\u0430\u0436\u043a\u0430\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">np.median(df[u'\u042d\u0442\u0430\u0436']), np.median(df[u'\u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'])<\/code><\/pre>\n<p>  <\/p>\n<pre><code>(5.0, 9.0)<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0442.\u0435. \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u043d\u0430 5 \u044d\u0442\u0430\u0436\u0435 9-\u044d\u0442\u0430\u0436\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u0436'] = df[u'\u042d\u0442\u0430\u0436'].map(lambda x: 1 if x==1 else 0)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u0436'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>0    289 1     36<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">df[u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u0442\u0430\u0436'] = df[u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c'].map(lambda x: 1 if x.split('\/')[0] == x.split('\/')[1] else 0) df[u'\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u0442\u0430\u0436'].value_counts()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>0    276 1     49<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 '\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c': df = df.drop(u'\u042d\u0442\u0430\u0436 \/ \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c', axis=1)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">df.info()<\/code><\/pre>\n<p>  <\/p>\n<pre><code>Data columns (total 24 columns): \u0410\u0434\u0440\u0435\u0441                    325 non-null object \u0411\u0430\u043b\u043a\u043e\u043d                   325 non-null object \u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e          325 non-null object \u041a\u043e\u043c\u043d\u0430\u0442\u044b                  325 non-null int64 \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d            325 non-null object \u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d               325 non-null object \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                 322 non-null object \u041f\u043e\u043b\u044b                     325 non-null object \u0420\u0430\u0439\u043e\u043d                    325 non-null object \u0421\u0430\u043d\u0443\u0437\u0435\u043b                  325 non-null object \u0422\u0435\u043b\u0435\u0444\u043e\u043d                  325 non-null object \u0422\u0438\u043f \u0434\u043e\u043c\u0430                 325 non-null object \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438          325 non-null object \u0426\u0435\u043d\u0430                     325 non-null float64 \u041b\u0435\u0442 \u0434\u043e\u043c\u0443                 325 non-null int64 \u041b\u0435\u0442 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043c\u043e\u043d\u0442\u0430    325 non-null int64 \u0411\u044b\u043b \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442            325 non-null bool \u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c            325 non-null float64 \u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c            325 non-null float64 \u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438            325 non-null float64 \u042d\u0442\u0430\u0436                     325 non-null int64 \u042d\u0442\u0430\u0436\u043d\u043e\u0441\u0442\u044c                325 non-null int64 \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u0436              325 non-null int64 \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u0442\u0430\u0436           325 non-null int64<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u0430 X \u0438 Y<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">X = df.drop({u'\u0426\u0435\u043d\u0430', u'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435', u'\u0410\u0434\u0440\u0435\u0441'}, axis=1) Y = df[u'\u0426\u0435\u043d\u0430']<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043d\u0430\u0447\u043d\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/p>\n<p>  <\/p>\n<p><h2>3. \u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0435\u043d\u043a\u043e\u0434\u0435\u0440\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 DataFrame df \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c column_name+'_le', \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439,  # \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0443 column_name. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 column_name \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f # def encode_with_LabelEncoder(df, column_name):     label_encoder = LabelEncoder()     label_encoder.fit(df[column_name])     df[column_name+'_le'] = label_encoder.transform(df[column_name])     df.drop([column_name], axis=1, inplace=True)     return label_encoder  # \u041a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e LabelEncoder # def encode_with_existing_LabelEncoder(df, column_name, label_encoder):     df[column_name+'_le'] = label_encoder.transform(df[column_name])     df.drop([column_name], axis=1, inplace=True)  # \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 column_name \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 LabelEncoder, \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 DataFrame df \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b  # \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 column_name=&lt;\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f_i&gt;. \u0421\u0442\u043e\u043b\u0431\u0446\u044b column_name \u0438 column_name+'_le' \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f # Usage: df, label_encoder = encode_with_OneHotEncoder_and_delete_column(df, column_name) # def encode_with_OneHotEncoder_and_delete_column(df, column_name):     le_encoder = encode_with_LabelEncoder(df, column_name)     return perform_dummy_coding_and_delete_column(df, column_name, le_encoder), le_encoder  # \u0422\u043e \u0436\u0435, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e LabelEncoder # def encode_with_OneHotEncoder_using_existing_LabelEncoder_and_delete_column(df, column_name, le_encoder):     encode_with_existing_LabelEncoder(df, column_name, le_encoder)     return perform_dummy_coding_and_delete_column(df, column_name, le_encoder)  # \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 Dummy-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 # def perform_dummy_coding_and_delete_column(df, column_name, le_encoder):     oh_encoder = OneHotEncoder(sparse=False)     oh_features = oh_encoder.fit_transform(df[column_name+'_le'].values.reshape(-1,1))     ohe_columns=[column_name + '=' + le_encoder.classes_[i] for i in range(oh_features.shape[1])]      df.drop([column_name+'_le'], axis=1, inplace=True)      df_with_features = pd.DataFrame(oh_features, columns=ohe_columns)     df_with_features.index = df.index     return pd.concat([df, df_with_features], axis=1)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Label \u0438 Dummy-\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">phone_le_converter = encode_with_LabelEncoder(X,u'\u0422\u0435\u043b\u0435\u0444\u043e\u043d') X, balcony_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0411\u0430\u043b\u043a\u043e\u043d') X, metro_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043c\u0435\u0442\u0440\u043e') X, wall_materials_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d') X, ground_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u041f\u043e\u043b\u044b') X, region_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0420\u0430\u0439\u043e\u043d') X, subregion_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d') X, toilet_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0421\u0430\u043d\u0443\u0437\u0435\u043b') X, house_type_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0422\u0438\u043f \u0434\u043e\u043c\u0430') X, sell_conditions_le_encoder = encode_with_OneHotEncoder_and_delete_column(X,u'\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u0430\u0436\u0438')<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code class=\"python\">X.shape<\/code><\/pre>\n<p>  <\/p>\n<pre><code>(325, 131)<\/code><\/pre>\n<p>  <\/p>\n<p> \u2014 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0445\u043e\u0442\u044c \u0438 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0442\u043d\u0438, \u043d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u0442\u0435\u0440\u043f\u0438\u043c\u043e<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from sklearn.ensemble import RandomForestRegressor from sklearn.cross_validation import KFold from sklearn.cross_validation import cross_val_score  records_count = Y.count() # \u041a\u0440\u043e\u0441\u0441-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u043e 5 \u0431\u043b\u043e\u043a\u0430\u043c \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435\u043c kf = KFold(n = records_count, n_folds=5, shuffle=True, random_state=1)  from sklearn.model_selection import GridSearchCV  # \u041c\u0435\u0440\u043e\u0439 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 def determine_forest_quality(trees_count):     clf = RandomForestRegressor(n_estimators = trees_count, random_state=1)     return cross_val_score(clf, X, Y, scoring='r2', cv=kf).mean()  for k in range(1,75,5):     quality = determine_forest_quality(k)     print (k, quality)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>(1, 0.52030399213798784) (6, 0.78408930021238521) (11, 0.77670005453090307) (16, 0.7768642836394235) (21, 0.78408041490733349) (26, 0.78620421428818033) (31, 0.78902652992194366) (36, 0.78733229366765278) (41, 0.78844165910326591) (46, 0.78772597694981916) (51, 0.79053299052554316) (56, 0.78934052514939657) (61, 0.78879625272969778) (66, 0.78759528635105114) (71, 0.7900711517951875)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u0440\u0430\u0432\u043d\u043e\u0435 51, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c 79%.<br \/>  \u041f\u043e\u0434\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043d\u0435 \u0434\u0430\u043b \u043e\u0449\u0443\u0442\u0438\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0435\u0433\u043e \u0434\u0430\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u0443\u0447\u0438\u043b\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u043e\u0440 \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">clf = RandomForestRegressor(n_estimators = 51, random_state=1) clf.fit(X, Y)<\/code><\/pre>\n<p>  <\/p>\n<pre><code>RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None,            max_features='auto', max_leaf_nodes=None,            min_impurity_split=1e-07, min_samples_leaf=1,            min_samples_split=2, min_weight_fraction_leaf=0.0,            n_estimators=51, n_jobs=1, oob_score=False, random_state=1,            verbose=0, warm_start=False)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u0443 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">features = X.columns.values importances = clf.feature_importances_ indices = np.argsort(importances)[::-1]  num_to_plot = 10 feature_indices = [ind+1 for ind in indices[:num_to_plot]]  for i in range(num_to_plot):     print i, features[feature_indices[i]], round(importances[indices[i]],2)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code>0 \u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c 0.66 1 \u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438 0.05 2 \u0420\u0430\u0439\u043e\u043d=\u0417\u0430\u0432\u043e\u0434\u0441\u043a\u043e\u0439 \u0440\u0430\u0439\u043e\u043d 0.03 3 \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d=\u0441\u0438\u043b\u0438\u043a\u0430\u0442\u043d\u043e-\u0431\u043b\u043e\u0447\u043d\u044b\u0439 0.02 4 \u042d\u0442\u0430\u0436 0.02 5 \u0411\u044b\u043b \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442 0.02 6 \u041c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d=\u0414\u0437\u0435\u0440\u0436\u0438\u043d\u0441\u043a\u043e\u0433\u043e, \u0425\u043c\u0435\u043b\u0435\u0432\u0441\u043a\u043e\u0433\u043e, \u0429\u043e\u0440\u0441\u0430 0.02 7 \u041f\u043e\u043b\u044b=\u043f\u0430\u0440\u043a\u0435\u0442 0.02 8 \u041b\u0435\u0442 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0440\u0435\u043c\u043e\u043d\u0442\u0430 0.01 9 \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u0436 0.01<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u0430\u043a &#8216;\u0416\u0438\u043b\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c&#8217;, &#8216;\u041f\u043b\u043e\u0449\u0430\u0434\u044c \u043a\u0443\u0445\u043d\u0438&#8217;, &#8216;\u042d\u0442\u0430\u0436&#8217; \u0438 &#8216;\u0411\u044b\u043b \u043a\u0430\u043f\u0440\u0435\u043c\u043e\u043d\u0442&#8217; \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u0430 \u0432\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432 \u0442\u043e\u043f-10 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u044d\u0442\u043e &#8216;\u0417\u0430\u0432\u043e\u0434\u0441\u043a\u043e\u0439 \u0440\u0430\u0439\u043e\u043d&#8217;, &#8216;\u043c\u0438\u043a\u0440\u043e\u0440\u0430\u0439\u043e\u043d=\u0414\u0437\u0435\u0440\u0436\u0438\u043d\u0441\u043a\u043e\u0433\u043e&#8217; \u0438 &#8216;\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441\u0442\u0435\u043d=\u0441\u0438\u043b\u0438\u043a\u0430\u0442\u043d\u043e-\u0431\u043b\u043e\u0447\u043d\u044b\u0439&#8217;.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">predictions = pd.Series(clf.predict(X), index=Y.index)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0442\u0435\u0440\u0435\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0448\u0438\u0431\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0443 \u0438\u043b\u0438 \u0438\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">res_info = pd.DataFrame(columns=[u'\u041e\u0448\u0438\u0431\u043a\u0430,%',u'\u041e\u0448\u0438\u0431\u043a\u0430,$',u'\u0426\u0435\u043d\u0430 \u043c.\u043a\u0432.']) for i in Y.index:     error = Y[i] - predictions[i]     rel_error = error\/predictions[i]*100     res_info.loc[i] = pd.Series({             u'\u041e\u0448\u0438\u0431\u043a\u0430,%':round(rel_error,1),             u'\u041e\u0448\u0438\u0431\u043a\u0430,$':int(error),             u'\u0426\u0435\u043d\u0430 \u043c.\u043a\u0432.':int(Y[i]\/X[u'\u041e\u0431\u0449\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c'][i])     })<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">res_info.sort_values(by=u'\u041e\u0448\u0438\u0431\u043a\u0430,%')[:5]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th><\/th>\n<th>\u041e\u0448\u0438\u0431\u043a\u0430,%<\/th>\n<th>\u041e\u0448\u0438\u0431\u043a\u0430,$<\/th>\n<th>\u0426\u0435\u043d\u0430 \u043c.\u043a\u0432.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>845979<\/th>\n<td>-15.6<\/td>\n<td>-9252.0<\/td>\n<td>906.0<\/td>\n<\/tr>\n<tr>\n<th>838613<\/th>\n<td>-15.4<\/td>\n<td>-7649.0<\/td>\n<td>961.0<\/td>\n<\/tr>\n<tr>\n<th>806952<\/th>\n<td>-15.1<\/td>\n<td>-9988.0<\/td>\n<td>896.0<\/td>\n<\/tr>\n<tr>\n<th>830893<\/th>\n<td>-13.7<\/td>\n<td>-10979.0<\/td>\n<td>891.0<\/td>\n<\/tr>\n<tr>\n<th>798393<\/th>\n<td>-13.1<\/td>\n<td>-13560.0<\/td>\n<td>1232.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0435\u0440\u0435\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">res_info.sort_values(by=u'\u041e\u0448\u0438\u0431\u043a\u0430,%', ascending=False)[:5]<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<table border=\"1\">\n<thead>\n<tr>\n<th><\/th>\n<th>\u041e\u0448\u0438\u0431\u043a\u0430,%<\/th>\n<th>\u041e\u0448\u0438\u0431\u043a\u0430,$<\/th>\n<th>\u0426\u0435\u043d\u0430 \u043c.\u043a\u0432.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>777692<\/th>\n<td>20.7<\/td>\n<td>23452.0<\/td>\n<td>2242.0<\/td>\n<\/tr>\n<tr>\n<th>795105<\/th>\n<td>18.1<\/td>\n<td>10582.0<\/td>\n<td>1703.0<\/td>\n<\/tr>\n<tr>\n<th>843263<\/th>\n<td>16.0<\/td>\n<td>18209.0<\/td>\n<td>1668.0<\/td>\n<\/tr>\n<tr>\n<th>812051<\/th>\n<td>15.4<\/td>\n<td>15362.0<\/td>\n<td>2065.0<\/td>\n<\/tr>\n<tr>\n<th>810427<\/th>\n<td>14.9<\/td>\n<td>16735.0<\/td>\n<td>2057.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, \u0434\u0435\u0442\u0430\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/www.t-s.by\/buy\/flats\/code\/\">http:\/\/www.t-s.by\/buy\/flats\/code\/<\/a>, \u0433\u0434\u0435 code \u2014 \u043a\u043e\u0434 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e \u0441\u0443\u043c\u043c\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u044b.<br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435!<\/p>\n<p>  <\/p>\n<p>P.S. \u041a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 <a href=\"http:\/\/www.t-s.by\">t-s.by<\/a> \u0434\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u0434\u0430\u043d\u043d\u043e\u0435 \u0430\u0433\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0435: \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u043b\u0435\u0439 \u0443\u0431\u0440\u0430\u043b\u0438, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u043c \u043f\u043e\u043c\u0435\u0448\u0430\u044e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043a\u043e\u0434 crawler-\u0430, \u043f\u0430\u0440\u0441\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0448\u043b\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0445 \u0441\u0430\u0439\u0442\u0430.<br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 json \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/bitbucket.org\/andrei_punko\/realty-analysis\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\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=\"https:\/\/habrahabr.ru\/post\/329504\/\"> https:\/\/habrahabr.ru\/post\/329504\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0435\u0448\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043c\u0438\u043d\u0441\u043a\u043e\u043c \u0440\u044b\u043d\u043a\u0435 \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u0432\u0430\u0440\u0442\u0438\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d <a href=\"http:\/\/www.t-s.by\">\u0441\u0430\u0439\u0442 <\/a>\u0440\u0438\u044d\u043b\u0442\u0435\u0440\u0441\u043a\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u0430 &quot;\u0422\u0432\u043e\u044f \u0441\u0442\u043e\u043b\u0438\u0446\u0430&quot;.<\/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-286952","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286952","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=286952"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286952\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}