{"id":405687,"date":"2024-06-29T18:29:00","date_gmt":"2024-06-29T18:29:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=405687"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T18:29:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=405687","title":{"rendered":"<span>\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043c\u0435\u0442\u0435\u043e\u0441\u0430\u0439\u0442\u043e\u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430 \u0438 \u041c\u0435\u0442\u0435\u043e\u0438\u043d\u0444\u043e (\u0413\u0438\u0434\u0440\u043e\u043c\u0435\u0442\u0446\u0435\u043d\u0442\u0440) \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0pandas\u00a0(\u0427\u0430\u0441\u0442\u044c 1)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u0445 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e! \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\u00a0pandas\u00a0\u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 <strong>\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b<\/strong>. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f\u00a0Habr, \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u0430\u044f \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f.<\/strong> \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0435\u0441\u0442\u0438\u00a0telegram-\u043a\u0430\u043d\u0430\u043b \u043e \u043f\u043e\u0433\u043e\u0434\u0435, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0451\u00a0<strong>just-in-time\u00a0<\/strong>\u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0431\u044b\u043b\u0430 \u0446\u0435\u043b\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e.\u00a0<\/p>\n<h3>\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430<\/h3>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0430\u0439\u0442\u0430 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0<em>requests<\/em>), \u043d\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c\u00a0<em>read_html()<\/em> \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0pandas\u00a0\u0438 \u00ab\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\u00bb HTML-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0440\u0430\u0437\u0443 \u0432 DataFrame, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u00a0Jupiter Notebook.<\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">df = pd.read_html('\u0441\u0441\u044b\u043b\u043a\u0430')<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7c\/853\/9ed\/f7c8539edeea7bb59c2f5af42e0ac8ce.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 read_html() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 pandas\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 read_html() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 pandas\" width=\"474\" height=\"293\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7c\/853\/9ed\/f7c8539edeea7bb59c2f5af42e0ac8ce.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 read_html() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 pandas<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c read_html() \u043d\u0435 \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>try &#8212; except<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0430\u043c \u0441\u0430\u0439\u0442 \u042f.\u041f\u043e\u0433\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0430, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u043b\u0438\u0448\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u0442\u0430\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445 [1]-[9]. \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445 \u0432 DataFrame, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>concat():<\/em><\/p>\n<pre><code class=\"python\">ya_new=pd.concat([ya_df[0],ya_df[1],ya_df[2],ya_df[3],ya_df[4],ya_df[5],ya_df[6],ya_df[7],ya_df[8],ya_df[9]],ignore_index=True)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u00ab\u0441\u044b\u0440\u044b\u043c\u0438\u00bb \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0c0\/c20\/de0\/0c0c20de0a05c36657644d24a40bcc69.png\" alt=\"\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 &quot;\u0441\u044b\u0440\u044b\u043c\u0438&quot; \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b\" title=\"\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 &quot;\u0441\u044b\u0440\u044b\u043c\u0438&quot; \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b\" width=\"591\" height=\"254\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c0\/c20\/de0\/0c0c20de0a05c36657644d24a40bcc69.png\"\/><\/p>\n<div><figcaption>\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 &#171;\u0441\u044b\u0440\u044b\u043c\u0438&#187; \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u043b\u0443\u0447\u0448\u0435! \u0411\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439\u00a0<strong>temp<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0438\u0436\u043d\u044e\u044e \u0438 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<strong>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/strong>\u00a0(\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u0433\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446\u00a0<strong>wind<\/strong>\u00a0\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<strong>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 (\u0431\u0435\u0437 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439 \u043f\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c (\u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0435\u0435)\u00a0<strong>t_eff<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>temp<\/strong>\u00a0\u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0434\u044f \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430, \u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 <em>&#8216;[+ -]\\d{1,2}\\\u2026[+ -]\\d{1,2}&#8217;<\/em>. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u0445 \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u044d\u0442\u043e <a href=\"https:\/\/youtu.be\/ozFNilK4qrc\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0434\u0435\u043e<\/a>.<\/p>\n<pre><code class=\"python\">for i in range(0,ya_new.shape[0]):     t_str=ya_new['temp'][i]     temp_str=re.search(r'[+ -]\\d{1,2}\\\u2026[+ -]\\d{1,2}',t_str) #\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 search() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 re     temp_clean.append(temp_str.group(0))<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>wind<\/strong>:<\/p>\n<pre><code class=\"python\">for i in range(0,ya_new.shape[0]):     w_str=ya_new['wind'][i]     wind_str=re.search(r'\\d{1,2},\\d',w_str) #\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 search() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 re     wind_clean.append(wind_str.group(0))<\/code><\/pre>\n<p>\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>t_eff.<\/strong>\u00a0\u0421\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u043e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u044f\u0442\u044c \u00ab+\u00bb, \u00ab-\u00bb \u043b\u0438\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e (\u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b 0). \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">t_eff=[] for i in range(0,ya_new.shape[0]):     string=ya_new['t_eff'][i]                 #\u0438\u0434\u0451\u043c \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0430          if string[0]=='\u2212':                        #\u0435\u0441\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0435\u0442 \u00ab-\u00bb         s_1=re.sub('[^0-9]','', string)       #\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0435 \u0446\u0438\u0444\u0440\u0430            s_fin='\u2212'+s_1[:len(s_1)\/\/2]           #\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u00ab\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443\u00bb \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u00ab-\u00bb     if string[0] != '\u2212':                      #\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043b\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043d\u0435 \u00ab-\u00bb, \u0430 \u00ab+\u00bb \u0438\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e.         s_1=re.sub('[^0-9]','', string)         s_fin=s_1[:len(s_1)\/\/2]     t_eff.append(s_fin) <\/code><\/pre>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u0437\u043d\u0430\u043a % \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code class=\"python\">#\u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 ya_full[['t_down','t_up','wet']]=ya_full[['t_down','t_up','wet']].astype('int') ya_full['wind']=ya_full['wind'].astype('float') ya_full['t_eff']=ya_full['t_eff'].astype('int')  #\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 ya_full['t_mean']=(ya_full['t_up']+ya_full['t_down'])\/2<\/code><\/pre>\n<p>&#8230;\u0438 \u0441\u043e\u0431\u0440\u0430\u043d \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>concat()<\/em>:<\/p>\n<pre><code class=\"python\">ya_full=pd.concat([list_days,temp_fin,ya_new[['press','wet']],wind_fin,temp_eff,ya_new['weather']],axis=1)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bde\/062\/50b\/bde06250b264613297a285ec555c4bab.png\" alt=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430\" title=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430\" width=\"762\" height=\"366\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bde\/062\/50b\/bde06250b264613297a285ec555c4bab.png\"\/><\/p>\n<div><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421 \u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u043e\u0439 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e: \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0430\u0439\u0442\u0430\u043c, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0442.\u0434. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/meteoinfo.ru\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0434\u0440\u043e\u043c\u0435\u0442\u0446\u0435\u043d\u0442\u0440\u0430<\/a> (\u0442\u0430\u043c \u0432\u0441\u0451 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435), \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043c\u043e\u0451\u043c\u00a0<a href=\"https:\/\/github.com\/JWscientist\/Weather\/blob\/main\/%D0%AF%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%D0%9F%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0%20%D0%BF%D0%B0%D1%80%D1%81%D0%B5%D1%80%20pandas.ipynb\" rel=\"noopener noreferrer nofollow\">github<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/733462\/\"> https:\/\/habr.com\/ru\/articles\/733462\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u0445 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e! \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\u00a0pandas\u00a0\u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 <strong>\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b<\/strong>. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f\u00a0Habr, \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u0430\u044f \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f.<\/strong> \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0435\u0441\u0442\u0438\u00a0telegram-\u043a\u0430\u043d\u0430\u043b \u043e \u043f\u043e\u0433\u043e\u0434\u0435, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0451\u00a0<strong>just-in-time\u00a0<\/strong>\u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0431\u044b\u043b\u0430 \u0446\u0435\u043b\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e.\u00a0<\/p>\n<h3>\u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430<\/h3>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0430\u0439\u0442\u0430 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0<em>requests<\/em>), \u043d\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c\u00a0<em>read_html()<\/em> \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0pandas\u00a0\u0438 \u00ab\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\u00bb HTML-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0440\u0430\u0437\u0443 \u0432 DataFrame, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u00a0Jupiter Notebook.<\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">df = pd.read_html('\u0441\u0441\u044b\u043b\u043a\u0430')<\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 read_html() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 pandas<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c read_html() \u043d\u0435 \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>try &#8212; except<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0430\u043c \u0441\u0430\u0439\u0442 \u042f.\u041f\u043e\u0433\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0430, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u043b\u0438\u0448\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u0442\u0430\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445 [1]-[9]. \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445 \u0432 DataFrame, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>concat():<\/em><\/p>\n<pre><code class=\"python\">ya_new=pd.concat([ya_df[0],ya_df[1],ya_df[2],ya_df[3],ya_df[4],ya_df[5],ya_df[6],ya_df[7],ya_df[8],ya_df[9]],ignore_index=True)<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u00ab\u0441\u044b\u0440\u044b\u043c\u0438\u00bb \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 &#171;\u0441\u044b\u0440\u044b\u043c\u0438&#187; \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u043b\u0443\u0447\u0448\u0435! \u0411\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043b\u0430\u043d \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439\u00a0<strong>temp<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0438\u0436\u043d\u044e\u044e \u0438 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<strong>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/strong>\u00a0(\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u0433\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446\u00a0<strong>wind<\/strong>\u00a0\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438\u00a0<strong>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 (\u0431\u0435\u0437 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439 \u043f\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c (\u043c\u0435\u0442\u0435\u043e\u0440\u043e\u043b\u043e\u0433\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0435\u0435)\u00a0<strong>t_eff<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>temp<\/strong>\u00a0\u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0434\u044f \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430, \u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 <em>&#8216;[+ -]\\d{1,2}\\\u2026[+ -]\\d{1,2}&#8217;<\/em>. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u0445 \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u044d\u0442\u043e <a href=\"https:\/\/youtu.be\/ozFNilK4qrc\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0434\u0435\u043e<\/a>.<\/p>\n<pre><code class=\"python\">for i in range(0,ya_new.shape[0]):     t_str=ya_new['temp'][i]     temp_str=re.search(r'[+ -]\\d{1,2}\\\u2026[+ -]\\d{1,2}',t_str) #\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 search() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 re     temp_clean.append(temp_str.group(0))<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>wind<\/strong>:<\/p>\n<pre><code class=\"python\">for i in range(0,ya_new.shape[0]):     w_str=ya_new['wind'][i]     wind_str=re.search(r'\\d{1,2},\\d',w_str) #\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 search() \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 re     wind_clean.append(wind_str.group(0))<\/code><\/pre>\n<p>\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u00a0<strong>t_eff.<\/strong>\u00a0\u0421\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u043e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u044f\u0442\u044c \u00ab+\u00bb, \u00ab-\u00bb \u043b\u0438\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e (\u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b 0). \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">t_eff=[] for i in range(0,ya_new.shape[0]):     string=ya_new['t_eff'][i]                 #\u0438\u0434\u0451\u043c \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0430          if string[0]=='\u2212':                        #\u0435\u0441\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0435\u0442 \u00ab-\u00bb         s_1=re.sub('[^0-9]','', string)       #\u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0435 \u0446\u0438\u0444\u0440\u0430            s_fin='\u2212'+s_1[:len(s_1)\/\/2]           #\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u00ab\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443\u00bb \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u00ab-\u00bb     if string[0] != '\u2212':                      #\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043b\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043d\u0435 \u00ab-\u00bb, \u0430 \u00ab+\u00bb \u0438\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e.         s_1=re.sub('[^0-9]','', string)         s_fin=s_1[:len(s_1)\/\/2]     t_eff.append(s_fin) <\/code><\/pre>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u0437\u043d\u0430\u043a % \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code class=\"python\">#\u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 ya_full[['t_down','t_up','wet']]=ya_full[['t_down','t_up','wet']].astype('int') ya_full['wind']=ya_full['wind'].astype('float') ya_full['t_eff']=ya_full['t_eff'].astype('int')  #\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 ya_full['t_mean']=(ya_full['t_up']+ya_full['t_down'])\/2<\/code><\/pre>\n<p>&#8230;\u0438 \u0441\u043e\u0431\u0440\u0430\u043d \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <em>concat()<\/em>:<\/p>\n<pre><code class=\"python\">ya_full=pd.concat([list_days,temp_fin,ya_new[['press','wet']],wind_fin,temp_eff,ya_new['weather']],axis=1)<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441.\u041f\u043e\u0433\u043e\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421 \u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u043e\u0439 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e: \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0441\u0430\u0439\u0442\u0430\u043c, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0442.\u0434. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/meteoinfo.ru\" rel=\"noopener noreferrer nofollow\">\u0413\u0438\u0434\u0440\u043e\u043c\u0435\u0442\u0446\u0435\u043d\u0442\u0440\u0430<\/a> (\u0442\u0430\u043c \u0432\u0441\u0451 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435), \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043c\u043e\u0451\u043c\u00a0<a href=\"https:\/\/github.com\/JWscientist\/Weather\/blob\/main\/%D0%AF%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%D0%9F%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0%20%D0%BF%D0%B0%D1%80%D1%81%D0%B5%D1%80%20pandas.ipynb\" rel=\"noopener noreferrer nofollow\">github<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/733462\/\"> https:\/\/habr.com\/ru\/articles\/733462\/<\/a><br \/><\/br><\/br><\/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-405687","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405687","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=405687"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/405687\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=405687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=405687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}