{"id":310313,"date":"2020-09-22T15:00:30","date_gmt":"2020-09-22T15:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=310313"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=310313","title":{"rendered":"\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0438 \u043f\u043e\u0439\u043c\u0435\u043c Decision Tree \u043d\u0430 Python \u0441 \u043d\u0443\u043b\u044f! \u0427\u0430\u0441\u0442\u044c 3. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Pandas"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/520204\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 &quot;<a href=\"https:\/\/qiita.com\/toyohisa\/items\/180c0b1df42fb188f920\" rel=\"nofollow\">Python\u30670\u304b\u3089\u30c7\u30a3\u30b7\u30b8\u30e7\u30f3\u30c4\u30ea\u30fc\u3092\u4f5c\u3063\u3066\u7406\u89e3\u3059\u308b\u3000\uff083. \u30c7\u30fc\u30bf\u5206\u6790\u30e9\u30a4\u30d6\u30e9\u30eaPandas\u7de8\uff09<\/a>&quot;.<\/p>\n<p>  <i>\u042d\u0442\u043e \u0442\u0440\u0435\u0442\u044c\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"https:\/\/habr.com\/ru\/post\/517556\/\">\u043f\u0435\u0440\u0432\u0430\u044f<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/518768\/\">\u0432\u0442\u043e\u0440\u0430\u044f<\/a><\/i><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Pandas, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Decision Tree.<\/p>\n<h2>3.1 \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c pandas \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a pd import pandas as pd<\/code><\/pre>\n<h2>3.2 Data frame \u0438 Series<\/h2>\n<p>  \u0412 pandas \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u0430\u043a Data frame \u0438 Series. <br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0435\u0439 Excel.<br \/>  \u041e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Series, \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u2014 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u2014 Data frame-\u043e\u043c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zg\/d4\/cv\/zgd4cvbtvfjkffypyewgpcyfvyc.jpeg\"><a name=\"habracut\"><\/a>  <\/p>\n<h2>3.3 \u0421\u043e\u0437\u0434\u0430\u0435\u043c Data frame<\/h2>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Excel-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.read_excel.html\" rel=\"nofollow\">read_excel<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.ExcelWriter.html\" rel=\"nofollow\">ExcelWriter<\/a>  <\/p>\n<pre><code class=\"python\"># \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c Excel \u0444\u0430\u0439\u043b \u0442\u0443\u0434\u0430 \u0436\u0435, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u0444\u0430\u0439\u043b ipynb df0 = pd.read_excel(&quot;data_golf.xlsx&quot;)   # \u0432\u044b\u0432\u043e\u0434\u0438\u043c DataFrame \u043a\u0430\u043a HTML \u0442\u0430\u0431\u043b\u0438\u0446\u0443  from IPython.display import HTML html = &quot;&lt;div style='font-family:\\&quot;\u30e1\u30a4\u30ea\u30aa\\&quot;;'&gt;&quot;+df0.to_html()+&quot;&lt;\/div&gt;&quot; HTML(html)   # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 Excel \u0444\u0430\u0439\u043b (with \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 f.close) with pd.ExcelWriter(&quot;data_golf2.xlsx&quot;) as f:         df0.to_excel(f)<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Data Frame \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f (\u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430): \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.html\" rel=\"nofollow\">DataFrame<\/a>  <\/p>\n<pre><code class=\"python\"># \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f: \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432   d = {     &quot;\u041f\u043e\u0433\u043e\u0434\u0430&quot;:[&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0414\u043e\u0436\u0434\u044c&quot;],     &quot;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430&quot;:[&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;],      &quot;\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c&quot;:[&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;],     &quot;\u0412\u0435\u0442\u0435\u0440&quot;:[&quot;\u041d\u0435\u0442&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u0415\u0441\u0442\u044c&quot;],   &quot;\u0413\u043e\u043b\u044c\u0444&quot;:[&quot;\u00d7&quot;,&quot;\u00d7&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u00d7&quot;,&quot;\u25cb&quot;,&quot;\u00d7&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u25cb&quot;,&quot;\u00d7&quot;], } df0 = pd.DataFrame(d)<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Data Frame \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432: \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.html\" rel=\"nofollow\">DataFrame<\/a>  <\/p>\n<pre><code class=\"python\"># \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432: \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a  d = [[&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u00d7&quot;],      [&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u00d7&quot;],      [&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u00d7&quot;],      [&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u25cb&quot;],      [&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u00d7&quot;],      [&quot;\u042f\u0441\u043d\u043e&quot;,&quot;\u0425\u043e\u043b\u043e\u0434\u043d\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u044f\u0441\u043d\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u25cb&quot;],      [&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u25cb&quot;],      [&quot;\u041e\u0431\u043b\u0430\u0447\u043d\u043e&quot;,&quot;\u0416\u0430\u0440\u043a\u043e&quot;,&quot;\u041d\u043e\u0440\u043c&quot;,&quot;\u041d\u0435\u0442&quot;,&quot;\u25cb&quot;],      [&quot;\u0414\u043e\u0436\u0434\u044c&quot;,&quot;\u0422\u0435\u043f\u043b\u043e&quot;,&quot;\u0412\u044b\u0441\u043e\u043a\u0430\u044f&quot;,&quot;\u0415\u0441\u0442\u044c&quot;,&quot;\u00d7&quot;],     ] # \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438 \u0441\u0442\u0440\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a columns \u0438 index \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0438\u0445 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0438\u043c \u043d\u043e\u043c\u0435\u0440. df0 = pd.DataFrame(d,columns=[&quot;\u041f\u043e\u0433\u043e\u0434\u0430&quot;,&quot;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430&quot;,&quot;\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c&quot;,&quot;\u0412\u0435\u0442\u0435\u0440&quot;,&quot;\u0413\u043e\u043b\u044c\u0444&quot;],index=range(len(d)))<\/code><\/pre>\n<h2>3.4 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b   # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 print(df0.shape) # \u0432\u044b\u0432\u043e\u0434 (14, 5)   #  \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a print(df0.shape[0]) # \u0432\u044b\u0432\u043e\u0434 14   # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 print(df0.columns) # \u0432\u044b\u0432\u043e\u0434 Index(['\u041f\u043e\u0433\u043e\u0434\u0430', '\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430', '\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c', '\u0412\u0435\u0442\u0435\u0440', '\u0413\u043e\u043b\u044c\u0444'], dtype='object')   # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a (\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 df0 - \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441\uff09 print(df0.index) # \u0432\u044b\u0432\u043e\u0434 RangeIndex(start=0, stop=14, step=1)<\/code><\/pre>\n<h2>3.5 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.loc.html#pandas.DataFrame.loc\" rel=\"nofollow\">loc<\/a> <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.iloc.html#pandas.DataFrame.iloc\" rel=\"nofollow\">iloc<\/a> <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.values.html#pandas.DataFrame.values\" rel=\"nofollow\">values<\/a><\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439   # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u043e\u0434 \u21161 (\u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0432\u0435\u0440\u0445\u0443) print(df0.loc[1,&quot;\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c&quot;]) # \u0432\u044b\u0432\u043e\u0434 \u0412\u044b\u0441\u043e\u043a\u0430\u044f  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0443\u043a\u0430\u0437\u0430\u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u041f\u043e\u0433\u043e\u0434\u044b \u0438 \u0413\u043e\u043b\u044c\u0444\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a 1,2,4, \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 Data Frame-\u043e\u043c   df = df0.loc[[1,2,4],[&quot;\u043f\u043e\u0433\u043e\u0434\u0430&quot;,&quot;\u0413\u043e\u043b\u044c\u0444&quot;]] print(df) # \u0432\u044b\u0432\u043e\u0434 #    \u041f\u043e\u0433\u043e\u0434\u0430    \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430    \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c    \u0412\u0435\u0442\u0435\u0440    \u0413\u043e\u043b\u044c\u0444 # 1    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f     \u0415\u0441\u0442\u044c      \u00d7 # 2    \u041e\u0431\u043b\u0430\u0447\u043d\u043e    \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u25cb # 3    \u0414\u043e\u0436\u0434\u044c        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u25cb # 4    \u0414\u043e\u0436\u0434\u044c        \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb  # iloc \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u0418\u043d\u0434\u0435\u043a\u0441\u044b \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442 0. # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a \u0441 1 \u043f\u043e 3, \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0413\u043e\u043b\u044c\u0444. \u0422\u0430\u043a \u043a\u0430\u043a iloc \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441, \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c 1:4, \u0442\u043e 4-\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.  df = df0.iloc[1:4,:-1] print(df) # \u0432\u044b\u0432\u043e\u0434 #    \u041f\u043e\u0433\u043e\u0434\u0430    \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430    \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c    \u0412\u0435\u0442\u0435\u0440 # 1    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f     \u0415\u0441\u0442\u044c      # 2    \u041e\u0431\u043b\u0430\u0447\u043d\u043e    \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442 # 3    \u0414\u043e\u0436\u0434\u044c        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442   # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (Series) # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0430\u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. s \u044d\u0442\u043e Series s = df0.iloc[0,:] # \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e s[&quot;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430&quot;] print(s[&quot;\u041f\u043e\u0433\u043e\u0434\u0430&quot;]) # \u0432\u044b\u0432\u043e\u0434 \u042f\u0441\u043d\u043e  # \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (numpy.ndarray). print(df0.values)<\/code><\/pre>\n<h2>3.6 \u0426\u0438\u043a\u043b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.iterrows.html\" rel=\"nofollow\">iterrows<\/a> <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.iteritems.html\" rel=\"nofollow\">iteritems<\/a><\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0446\u0438\u043a\u043b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 # \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435. for i,row in df0.iterrows():     # i \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u0442\u0440\u043e\u043a\u0438), row \u044d\u0442\u043e Series     print(i,row)     pass  # \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438. for i,col in df0.iteritems():     # i \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, col \u044d\u0442\u043e Series     print(i,col)     pass<\/code><\/pre>\n<h2>3.7 \u0427\u0430\u0441\u0442\u043e\u0442\u0430 <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.Series.value_counts.html#pandas.Series.value_counts\" rel=\"nofollow\">value_counts<\/a><\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u041f\u043e\u0433\u043e\u0434\u0430. s \u044d\u0442\u043e Series s = df0.loc[:,&quot;\u041f\u043e\u0433\u043e\u0434\u0430&quot;]  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 print(s.value_counts()) # \u0432\u044b\u0432\u043e\u0434 # \u042f\u0441\u043d\u043e    5 # \u0414\u043e\u0436\u0434\u044c    5 # \u041e\u0431\u043b\u0430\u0447\u043d\u043e    4 # Name: \u041f\u043e\u0433\u043e\u0434\u0430, dtype: int64  # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u201c\u042f\u0441\u043d\u043e\u201d print(s.value_counts()[&quot;\u042f\u0441\u043d\u043e&quot;]) # \u0412\u044b\u0432\u043e\u0434 5<\/code><\/pre>\n<h2>3.8 \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <a href=\"https:\/\/pandas.pydata.org\/pandas-docs\/stable\/reference\/api\/pandas.DataFrame.query.html#pandas.DataFrame.query\" rel=\"nofollow\">query<\/a><\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u041f\u043e\u0433\u043e\u0434\u0430 - \u042f\u0441\u043d\u043e. print(df0.query(&quot;\u041f\u043e\u0433\u043e\u0434\u0430=='\u042f\u0441\u043d\u043e'&quot;)) # \u0432\u044b\u0432\u043e\u0434 #    \u041f\u043e\u0433\u043e\u0434\u0430    \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430    \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c    \u0412\u0435\u0442\u0435\u0440    \u0413\u043e\u043b\u044c\u0444 # 0    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u00d7 # 1    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u0415\u0441\u0442\u044c    \u00d7 # 7    \u042f\u0441\u043d\u043e        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u00d7 # 8    \u042f\u0441\u043d\u043e        \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb # 10    \u042f\u0441\u043d\u043e        \u0422\u0435\u043f\u043b\u043e        \u041d\u043e\u0440\u043c        \u0415\u0441\u0442\u044c    \u25cb  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u041f\u043e\u0433\u043e\u0434\u0430 - \u044f\u0441\u043d\u043e, \u0438 \u0438\u0434\u0443 \u043d\u0430 \u0433\u043e\u043b\u044c\u0444  print(df0.query(&quot;\u041f\u043e\u0433\u043e\u0434\u0430=='\u042f\u0441\u043d\u043e' and \u0413\u043e\u043b\u044c\u0444=='\u25cb'&quot;)) # \u0432\u044b\u0432\u043e\u0434 #    \u041f\u043e\u0433\u043e\u0434\u0430    \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430    \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c    \u0412\u0435\u0442\u0435\u0440    \u0413\u043e\u043b\u044c\u0444 # 8    \u042f\u0441\u043d\u043e        \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb # 10    \u042f\u0441\u043d\u043e        \u0422\u0435\u043f\u043b\u043e        \u041d\u043e\u0440\u043c        \u0415\u0441\u0442\u044c    \u25cb  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0433\u0434\u0430 \u041f\u043e\u0433\u043e\u0434\u0430 - \u044f\u0441\u043d\u043e, \u0438\u043b\u0438 \u0438\u0434\u0443 \u043d\u0430 \u0433\u043e\u043b\u044c\u0444  print(df0.query(&quot;\u041f\u043e\u0433\u043e\u0434\u0430=='\u042f\u0441\u043d\u043e' or \u0413\u043e\u043b\u044c\u0444=='\u25cb'&quot;)) # \u0432\u044b\u0432\u043e\u0434 #    \u041f\u043e\u0433\u043e\u0434\u0430    \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430    \u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c    \u0412\u0435\u0442\u0435\u0440    \u0413\u043e\u043b\u044c\u0444 # 0    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u00d7 # 1    \u042f\u0441\u043d\u043e        \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u0415\u0441\u0442\u044c    \u00d7 # 2    \u041e\u0431\u043b\u0430\u0447\u043d\u043e    \u0416\u0430\u0440\u043a\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u25cb # 3    \u0414\u043e\u0436\u0434\u044c        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u25cb # 4    \u0414\u043e\u0436\u0434\u044c        \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb # 6    \u041e\u0431\u043b\u0430\u0447\u043d\u043e    \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u0415\u0441\u0442\u044c    \u25cb # 7    \u042f\u0441\u043d\u043e        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u041d\u0435\u0442    \u00d7 # 8    \u042f\u0441\u043d\u043e        \u0425\u043e\u043b\u043e\u0434\u043d\u043e    \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb # 9    \u0414\u043e\u0436\u0434\u044c        \u0422\u0435\u043f\u043b\u043e        \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb # 10    \u042f\u0441\u043d\u043e        \u0422\u0435\u043f\u043b\u043e        \u041d\u043e\u0440\u043c        \u0415\u0441\u0442\u044c    \u25cb # 11    \u0414\u043e\u0436\u0434\u044c        \u0422\u0435\u043f\u043b\u043e        \u0412\u044b\u0441\u043e\u043a\u0430\u044f    \u0415\u0441\u0442\u044c    \u25cb # 12    \u0414\u043e\u0436\u0434\u044c        \u0416\u0430\u0440\u043a\u043e        \u041d\u043e\u0440\u043c        \u041d\u0435\u0442    \u25cb<\/code><\/pre>\n<p>  <i>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!<\/p>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0434\u044b, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u043d\u0430\u043c, \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043b\u0438 \u0432\u0430\u043c \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043f\u043e\u043d\u044f\u0442\u0435\u043d \u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434, \u0431\u044b\u043b\u0430 \u043b\u0438 \u043e\u043d\u0430 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430?<\/i><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/520204\/\"> https:\/\/habr.com\/ru\/post\/520204\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/520204\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 &quot;<a href=\"https:\/\/qiita.com\/toyohisa\/items\/180c0b1df42fb188f920\" rel=\"nofollow\">Python\u30670\u304b\u3089\u30c7\u30a3\u30b7\u30b8\u30e7\u30f3\u30c4\u30ea\u30fc\u3092\u4f5c\u3063\u3066\u7406\u89e3\u3059\u308b\u3000\uff083. \u30c7\u30fc\u30bf\u5206\u6790\u30e9\u30a4\u30d6\u30e9\u30eaPandas\u7de8\uff09<\/a>&quot;.<\/p>\n<p>  <i>\u042d\u0442\u043e \u0442\u0440\u0435\u0442\u044c\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"https:\/\/habr.com\/ru\/post\/517556\/\">\u043f\u0435\u0440\u0432\u0430\u044f<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/518768\/\">\u0432\u0442\u043e\u0440\u0430\u044f<\/a><\/i><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Pandas, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Decision Tree.<\/p>\n<h2>3.1 \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c pandas \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a pd import pandas as pd<\/code><\/pre>\n<h2>3.2 Data frame \u0438 Series<\/h2>\n<p>  \u0412 pandas \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u0430\u043a Data frame \u0438 Series. <br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0435\u0439 Excel.<br \/>  \u041e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Series, \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u2014 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u2014 Data frame-\u043e\u043c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zg\/d4\/cv\/zgd4cvbtvfjkffypyewgpcyfvyc.jpeg\"><\/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-310313","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310313","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=310313"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310313\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=310313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=310313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}