{"id":337246,"date":"2022-08-18T21:00:08","date_gmt":"2022-08-18T21:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337246"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337246","title":{"rendered":"<span>\u0420\u0430\u0441\u0447\u0435\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Python<\/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<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u041f\u0440\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0440\u0430\u0441\u0447\u0435\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043a\u0430\u043a <strong>\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 (\u03b7)<\/strong>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043e\u0431\u043e\u0439\u0434\u0435\u043d \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 <strong>\u03b7<\/strong> \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <strong>Python<\/strong>.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043e\u0440\u0438\u044e (\u043f\u0440\u043e <strong>\u03b7<\/strong> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 [1, \u0441.73], [2, \u0441.412], [3, \u0441.609]), \u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>\u03b7<\/strong>:<\/p>\n<ol>\n<li>\n<p><strong>\u03b7<\/strong> \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0442\u0435\u0441\u043d\u043e\u0442\u044b <strong>\u043b\u044e\u0431\u043e\u0439<\/strong> \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 (\u043a\u0430\u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439), \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0438\u0440\u0441\u043e\u043d\u0430 <strong>r<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0442\u0435\u0441\u043d\u043e\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439<\/strong> \u0441\u0432\u044f\u0437\u0438. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 <strong>r=0<\/strong> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c (<strong>\u03b7>0<\/strong>).<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 1; \u043f\u0440\u0438 <strong>\u03b7=0<\/strong> \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u0440\u0438 <strong>\u03b7=1<\/strong> \u0441\u0432\u044f\u0437\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439; \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u0448\u043a\u0430\u043b\u0430\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0427\u0435\u0434\u0434\u043e\u043a\u0430 \u0438 \u0434\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u043b\u0438\u0447\u0438\u043d\u0430 <strong>\u03b7\u00b2<\/strong> \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0434\u043e\u043b\u044e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b <strong>r<\/strong>: <strong>\u03b7 \u2265 |r|<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c <strong>\u03b7<sub>XY<\/sub> \u2260 \u03b7<sub>YX<\/sub><\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 <strong>\u03b7<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0441\u0442\u044f\u043c\u0438; \u0435\u0441\u043b\u0438 \u0436\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <strong>X<\/strong> \u0438 <strong>Y<\/strong>, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e\u0442 \u0432\u044b\u0432\u043e\u0434, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d &#8212; \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c <strong>\u03b7<\/strong> \u043f\u043e \u043d\u0435\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <strong>\u03b7=1<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 <strong>\u03b7<\/strong> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <strong>X<\/strong> \u0438 <strong>Y<\/strong> \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b, \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <strong>\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/strong>.<\/p>\n<p><strong>\u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0435 \u0441\u0432\u044f\u0437\u0438, \u0431\u043b\u0438\u0437\u043a\u043e\u0439 \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439, \u0438 <strong>\u03b7<\/strong> \u0431\u043b\u0438\u0437\u043a\u043e\u043c \u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u0430\u0431\u0441\u0443\u0440\u0434\u043d\u044b\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u03b7 \u2265 |r|;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 <strong>r<\/strong> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u043c, \u0430 <strong>\u03b7<\/strong> \u043d\u0435\u0442;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0434\u043b\u044f <strong>\u03b7<\/strong> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 0 \u0438\u043b\u0438 \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 &#8212; \u0431\u043e\u043b\u044c\u0448\u0435 1.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0430 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 (\u043a\u043c) (Mileage)<\/strong>.<\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430 (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/github.com\/AANazarov\/Statistical-methods\" rel=\"noopener noreferrer nofollow\">\u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub<\/a>):<\/p>\n<pre><code class=\"python\">fuel_df = pd.read_csv(     filepath_or_buffer='data\/fuel_df.csv',     sep=';',     index_col='Number') dataset_df = fuel_df.copy()    # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b display(dataset_df.head())<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/3df\/11b\/582\/3df11b58242a6d9946f2a013c8446088.jpg\" width=\"420\" height=\"448\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3df\/11b\/582\/3df11b58242a6d9946f2a013c8446088.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 <strong>DataFrame<\/strong> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b:<\/p>\n<ul>\n<li>\n<p><strong>Month<\/strong> \u2014 \u043c\u0435\u0441\u044f\u0446 (\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel)<\/p>\n<\/li>\n<li>\n<p><strong>Mileage<\/strong> &#8212; \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>Temperature<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0C) <\/p>\n<\/li>\n<li>\n<p><strong>FuelFlow<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a\u043c)<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <strong>Mileage<\/strong> \u0438 <strong>FuelFlow<\/strong> \u0432 \u0432\u0438\u0434\u0435 <strong>numpy.ndarray<\/strong>.<\/p>\n<pre><code class=\"python\">X = np.array(dataset_df['Mileage']) Y = np.array(dataset_df['FuelFlow'])<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 &#8212; <strong>X<\/strong> \u0438 <strong>Y<\/strong>:<\/p>\n<pre><code class=\"python\">data_XY_df = pd.DataFrame({     'X': X,     'Y': Y})<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u043e\u0442\u0447\u0435\u0442\u0430 (\u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432):<\/p>\n<pre><code class=\"python\"># \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Project = \"\u0420\u0430\u0441\u0447\u0435\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Python\" # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 AsOfTheDate = \"\" # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Theme = \"\u0410\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f\" # \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 Title_String = f\"{Task_Project}\\n{AsOfTheDate}\" # \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Variable_Name_X = \"\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)\" Variable_Name_Y = \"\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c)\"<\/code><\/pre>\n<h3>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0435\u0435\u043c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0432\u044b\u0431\u0440\u043e\u0441\u044b). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435, \u043e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<pre><code class=\"python\">mask1 = data_XY_df['X'] > 200 mask2 = data_XY_df['X'] &lt; 2000 data_XY_df = data_XY_df[mask1 &amp; mask2]  X = np.array(data_XY_df['X']) Y = np.array(data_XY_df['Y'])<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">data_XY_df.describe()<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/9f9\/ae9\/6e2\/9f9ae96e24c2d058ccc312c2034aaf11.jpg\" width=\"213\" height=\"261\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f9\/ae9\/6e2\/9f9ae96e24c2d058ccc312c2034aaf11.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">fig, axes = plt.subplots(figsize=(297\/INCH, 210\/INCH)) fig.suptitle(Task_Theme) axes.set_title('\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u0433\u0430') data_df = data_XY_df sns.scatterplot(     data=data_df,     x='X', y='Y',     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435',     s=50,     ax=axes) axes.set_xlabel(Variable_Name_X) axes.set_ylabel(Variable_Name_Y) #axes.tick_params(axis=\"x\", labelsize=f_size+4) #axes.tick_params(axis=\"y\", labelsize=f_size+4) #axes.legend(prop={'size': f_size+6}) plt.show() fig.savefig('graph\/scatterplot_XY_sns.png', orientation = \"portrait\", dpi = 300)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2da\/ecd\/da0\/2daecdda04f9e4b425c63ed4dbbd7640.png\" width=\"706\" height=\"559\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2da\/ecd\/da0\/2daecdda04f9e4b425c63ed4dbbd7640.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u044b\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(420\/INCH, 297\/INCH)) ax1 = plt.subplot(2,2,1) ax2 = plt.subplot(2,2,2) ax3 = plt.subplot(2,2,3) ax4 = plt.subplot(2,2,4) fig.suptitle(Task_Theme) ax1.set_title('X') ax2.set_title('Y')  # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 data_df = data_XY_df X_mean = data_df['X'].mean() X_std = data_df['X'].std(ddof = 1) Y_mean = data_df['Y'].mean() Y_std = data_df['Y'].std(ddof = 1) bins_hist = 'sturges'    # \u0432\u044b\u0431\u043e\u0440 \u0447\u0438\u0441\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 ('auto', 'fd', 'doane', 'scott', 'stone', 'rice', 'sturges', 'sqrt')  # \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f X xmin = np.amin(data_df['X']) xmax = np.amax(data_df['X']) nx = 100 hx = (xmax - xmin)\/(nx - 1) x1 = np.linspace(xmin, xmax, nx) xnorm1 = sps.norm.pdf(x1, X_mean, X_std) kx = len(np.histogram(X, bins=bins_hist, density=False)[0]) xnorm2 = xnorm1*len(X)*(xmax-xmin)\/kx  # \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f Y ymin = np.amin(Y) ymax = np.amax(Y) ny = 100 hy = (ymax - ymin)\/(ny - 1) y1 = np.linspace(ymin, ymax, ny) ynorm1 = sps.norm.pdf(y1, Y_mean, Y_std) ky = len(np.histogram(Y, bins=bins_hist, density=False)[0]) ynorm2 = ynorm1*len(Y)*(ymax-ymin)\/ky  # \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f X ax1.hist(     data_df['X'],     bins=bins_hist,     density=False,     histtype='bar',    # 'bar', 'barstacked', 'step', 'stepfilled'     orientation='vertical',   # 'vertical', 'horizontal'     color = \"#1f77b4\",     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430') ax1.plot(     x1, xnorm2,     linestyle = \"-\",     color = \"r\",     linewidth = 2,     label = '\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f') ax1.axvline(X_mean, color='magenta', label = '\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435') ax1.axvline(np.median(data_df['X']), color='orange', label = '\u043c\u0435\u0434\u0438\u0430\u043d\u0430') ax1.legend(fontsize = f_size+4)  # \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f Y ax2.hist(     data_df['Y'],     bins=bins_hist,     density=False,     histtype='bar',    # 'bar', 'barstacked', 'step', 'stepfilled'     orientation='vertical',   # 'vertical', 'horizontal'     color = \"#1f77b4\",     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430')     ax2.plot(     y1, ynorm2,     linestyle = \"-\",     color = \"r\",     linewidth = 2,     label = '\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f') ax2.axvline(Y_mean, color='magenta', label = '\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435') ax2.axvline(np.median(data_df['Y']), color='orange', label = '\u043c\u0435\u0434\u0438\u0430\u043d\u0430') ax2.legend(fontsize = f_size+4)  # \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 X sns.boxplot(     #data=corn_yield_df,     x=data_df['X'],     orient='h',     width=0.3,     ax=ax3)  # \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 Y sns.boxplot(     #data=corn_yield_df,      x=data_df['Y'],      orient='h',      width=0.3,      ax=ax4)  # \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043e\u0441\u0435\u0439  ax3.set_xlabel(Variable_Name_X) ax4.set_xlabel(Variable_Name_Y)  plt.show() fig.savefig('graph\/scatterplot_boxplot_X_Y_sns.png', orientation = \"portrait\", dpi = 300)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a80\/893\/7b8\/a808937b81f3bc3be1ed868572c24da4.png\" width=\"958\" height=\"770\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a80\/893\/7b8\/a808937b81f3bc3be1ed868572c24da4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u00a0\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430:<\/p>\n<pre><code class=\"python\"># \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0430 \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 def Shapiro_Wilk_test(data):     data = np.array(data)     result = sci.stats.shapiro(data)     s_calc = result.statistic    # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f     a_calc = result.pvalue    # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438          print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_calc = {round(a_calc, DecPlace)}\")     print(f\"\u0417\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_level = {round(a_level, DecPlace)}\")          if a_calc >= a_level:         conclusion_ShW_test = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {round(a_calc, DecPlace)} >= a_level = {round(a_level, DecPlace)}\" + \\             \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 \u041f\u0420\u0418\u041d\u0418\u041c\u0410\u0415\u0422\u0421\u042f\"     else:         conclusion_ShW_test = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {round(a_calc, DecPlace)} &lt; a_level = {round(a_level, DecPlace)}\" + \\             \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 \u041e\u0422\u0412\u0415\u0420\u0413\u0410\u0415\u0422\u0421\u042f\"     print(conclusion_ShW_test)<\/code><\/pre>\n<pre><code class=\"python\"># \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X Shapiro_Wilk_test(X)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/7e9\/3cc\/69d\/7e93cc69d71517d079816de9d769cfd7.jpg\" width=\"991\" height=\"65\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7e9\/3cc\/69d\/7e93cc69d71517d079816de9d769cfd7.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<pre><code class=\"python\"># \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y Shapiro_Wilk_test(Y)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/26d\/0b0\/9f5\/26d0b09f5bb0885a9ed33991e73b636d.jpg\" width=\"992\" height=\"67\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26d\/0b0\/9f5\/26d0b09f5bb0885a9ed33991e73b636d.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b <strong>\u03b7<\/strong>, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0420\u0430\u0441\u0447\u0451\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p><u>1. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u043e\u0431\u043e\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c X \u0438 Y:<\/u><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>matrix_XY_df<\/strong> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre><code class=\"python\">matrix_XY_df = data_XY_df.copy()<\/code><\/pre>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 (\u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0421\u0442\u0435\u0440\u0434\u0436\u0435\u0441\u0441\u0430); \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 2:<\/p>\n<pre><code class=\"python\"># \u043e\u0431\u044a\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 X \u0438 Y n_X = len(X) n_Y = len(Y)  # \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 group_int_number = lambda n: round (3.31*log(n_X, 10)+1) if round (3.31*log(n_X, 10)+1) >=2 else 2  K_X = group_int_number(n_X) K_Y = group_int_number(n_Y) print(f\"\u0427\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X: {K_X}\") print(f\"\u0427\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y: {K_Y}\")<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>pandas<\/strong>, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <strong>pandas.cut<\/strong>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 <strong>cut_X<\/strong> \u0438 <strong>cut_X<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>X<\/strong> \u0438 <strong>Y<\/strong>. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 DataFrame <strong>matrix_XY_df<\/strong>:<\/p>\n<pre><code class=\"python\">cut_X = pd.cut(X, bins=K_X) cut_Y = pd.cut(Y, bins=K_Y)  matrix_XY_df['cut_X'] = cut_X matrix_XY_df['cut_Y'] = cut_Y  display(matrix_XY_df.head())<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a5e\/6a6\/3fb\/a5e6a63fb488dd3acb1c37c455fa7549.png\" width=\"412\" height=\"173\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a5e\/6a6\/3fb\/a5e6a63fb488dd3acb1c37c455fa7549.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>pandas.crosstab<\/strong>:<\/p>\n<pre><code class=\"python\">CorrTable_df = pd.crosstab(     index=matrix_XY_df['cut_X'],     columns=matrix_XY_df['cut_Y'],     rownames=['cut_X'],     colnames=['cut_Y'])  display(CorrTable_df)  # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c print(f\"sum = {np.sum(np.array(CorrTable_df))}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee4\/a9b\/f4e\/ee4a9bf4e04cdbbf897017c31a3a0f62.png\" width=\"835\" height=\"269\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee4\/a9b\/f4e\/ee4a9bf4e04cdbbf897017c31a3a0f62.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>pandas.crosstab<\/strong> \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u043e\u0432\u043d\u044b\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 <strong>\u03b7<\/strong> \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442, \u043d\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong>:<\/p>\n<pre><code class=\"python\">bins_X = pd.IntervalIndex.from_tuples([(200, 400), (400, 600), (600, 800), (800, 1000), (1000, 1200), (1200, 1400), (1400, 1600)]) cut_X = pd.cut(X, bins=bins_X)  bins_Y = pd.IntervalIndex.from_tuples([(6.0, 7.0), (7.0, 8.0), (8.0, 9.0), (9.0, 10.0), (10.0, 11.0), (11.0, 12.0), (12.0, 13.0)]) cut_Y = pd.cut(X, bins=bins_Y)  CorrTable_df2 = pd.crosstab(     index=pd.cut(X, bins=bins_X),     columns=pd.cut(Y, bins=bins_Y),     rownames=['cut_X'],     colnames=['cut_Y']) display(CorrTable_df2)  # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c print(f\"sum = {np.sum(np.array(CorrTable_df2))}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d24\/556\/5ac\/d245565ac3efc769ae047ea5b660d849.png\" width=\"708\" height=\"308\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d24\/556\/5ac\/d245565ac3efc769ae047ea5b660d849.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b &#8212; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>pandas.pivot_table<\/strong>:<\/p>\n<pre><code class=\"python\">matrix_XY_df.pivot_table(     values=['Y'],     index='cut_X',     columns='cut_Y',     aggfunc=len,     fill_value=0)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/295\/2cb\/14e\/2952cb14e3b3985d943c11070769cf88.png\" width=\"832\" height=\"264\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/295\/2cb\/14e\/2952cb14e3b3985d943c11070769cf88.png\"\/><figcaption><\/figcaption><\/figure>\n<p><u>2. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f:<\/u><\/p>\n<p>\u0414\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a \u0442\u0438\u043f\u0443 <strong>numpy.ndarray<\/strong>:<\/p>\n<pre><code class=\"python\">CorrTable_np = np.array(CorrTable_df) print(CorrTable_np, type(CorrTable_np))<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd6\/05f\/1c2\/cd605f1c21d0cf8c709172c4e8dad78c.png\" width=\"318\" height=\"141\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd6\/05f\/1c2\/cd605f1c21d0cf8c709172c4e8dad78c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u043e\u0433\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c:<\/p>\n<pre><code class=\"python\"># \u0438\u0442\u043e\u0433\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c n_group_X = [np.sum(CorrTable_np[i]) for i in range(K_X)] print(f\"n_group_X = {n_group_X}\")  # \u0438\u0442\u043e\u0433\u0438 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c n_group_Y = [np.sum(CorrTable_np[:,j]) for j in range(K_Y)] print(f\"n_group_Y = {n_group_Y}\")<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f34\/6cf\/24b\/f346cf24bf3777761aab259fa1e40af3.png\" width=\"262\" height=\"44\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f34\/6cf\/24b\/f346cf24bf3777761aab259fa1e40af3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b (\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>pandas.crosstab<\/strong> \u043f\u0440\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0438\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u043d\u0430 0.1% \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c &#8212; \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>pandas.cut<\/strong> &#8212; \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <strong>right<\/strong> \u0438 <strong>left<\/strong>:<\/p>\n<pre><code class=\"python\"># \u0421\u0440\u0435\u0434\u043d\u0435\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X Xboun_mean = [(CorrTable_df.index[i].left + CorrTable_df.index[i].right)\/2 for i in range(K_X)] Xboun_mean[0] = (np.min(X) + CorrTable_df.index[0].right)\/2    # \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u0445 Xboun_mean[K_X-1] = (CorrTable_df.index[K_X-1].left + np.max(X))\/2 print(f\"Xboun_mean = {Xboun_mean}\")  # \u0421\u0440\u0435\u0434\u043d\u0435\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y Yboun_mean = [(CorrTable_df.columns[j].left + CorrTable_df.columns[j].right)\/2 for j in range(K_Y)] Yboun_mean[0] = (np.min(Y) + CorrTable_df.columns[0].right)\/2    # \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u0445 Yboun_mean[K_Y-1] = (CorrTable_df.columns[K_Y-1].left + np.max(Y))\/2 print(f\"Yboun_mean = {Yboun_mean}\", '\\n')<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3d4\/c41\/341\/3d4c41341a1eb93bb2a63b7ab2411ad9.png\" width=\"684\" height=\"49\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d4\/c41\/341\/3d4c41341a1eb93bb2a63b7ab2411ad9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0437\u0435\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b:<\/p>\n<pre><code class=\"python\">Xmean_group = [np.sum(CorrTable_np[:,j] * Xboun_mean) \/ n_group_Y[j] for j in range(K_Y)] print(f\"Xmean_group = {Xmean_group}\")  Ymean_group = [np.sum(CorrTable_np[i] * Yboun_mean) \/ n_group_X[i] for i in range(K_X)] print(f\"Ymean_group = {Ymean_group}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d50\/c12\/041\/d50c12041a36c029a2aeadfcceeb19b0.png\" width=\"794\" height=\"45\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d50\/c12\/041\/d50c12041a36c029a2aeadfcceeb19b0.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0449\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong>:<\/p>\n<pre><code class=\"python\">Sum2_total_X = np.sum(n_group_X * (Xboun_mean - np.mean(X))**2) print(f\"Sum2_total_X = {Sum2_total_X}\")  Sum2_total_Y = np.sum(n_group_Y * (Yboun_mean - np.mean(Y))**2) print(f\"Sum2_total_Y = {Sum2_total_Y}\")<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f12\/1b7\/d1b\/f121b7d1be3234537d63e2f0bd806681.png\" width=\"273\" height=\"44\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f12\/1b7\/d1b\/f121b7d1be3234537d63e2f0bd806681.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u0435\u0436\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong> (\u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0445):<\/p>\n<pre><code class=\"python\">Sum2_between_group_X = np.sum(n_group_Y * (Xmean_group - np.mean(X))**2) print(f\"Sum2_between_group_X = {Sum2_between_group_X}\")  Sum2_between_group_Y = np.sum(n_group_X * (Ymean_group - np.mean(Y))**2) print(f\"Sum2_between_group_Y = {Sum2_between_group_Y}\")<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/17c\/251\/f3e\/17c251f3e8ba2f30b2b46c236ad08940.png\" width=\"340\" height=\"46\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/17c\/251\/f3e\/17c251f3e8ba2f30b2b46c236ad08940.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f <strong>X<\/strong> \u0438 <strong>Y<\/strong> (\u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 &#8212; \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439):<\/p>\n<pre><code class=\"python\">print(f\"Sum2_within_group_X = {Sum2_total_X - Sum2_between_group_X}\") print(f\"Sum2_within_group_Y = {Sum2_total_Y - Sum2_between_group_Y}\")<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/be1\/591\/9ca\/be15919ca74d0e30fb086ea7cbe50423.png\" width=\"331\" height=\"44\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/be1\/591\/9ca\/be15919ca74d0e30fb086ea7cbe50423.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"python\">corr_ratio_XY = sqrt(Sum2_between_group_Y \/ Sum2_total_Y) print(f\"corr_ratio_XY = {corr_ratio_XY}\")  corr_ratio_YX = sqrt(Sum2_between_group_X \/ Sum2_total_X) print(f\"corr_ratio_YX = {corr_ratio_YX}\")<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef6\/27a\/1ed\/ef627a1edb4cea54e7f5ef82e6d135c6.png\" width=\"286\" height=\"44\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef6\/27a\/1ed\/ef627a1edb4cea54e7f5ef82e6d135c6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0446\u0435\u043d\u0438\u043c \u0442\u0435\u0441\u043d\u043e\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043f\u043e <strong>\u0448\u043a\u0430\u043b\u0435 \u0427\u0435\u0434\u0434\u043e\u043a\u0430<\/strong>, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def Cheddock_scale_check(r, name='r'):     # \u0437\u0430\u0434\u0430\u0435\u043c \u0448\u043a\u0430\u043b\u0443 \u0427\u0435\u0434\u0434\u043e\u043a\u0430     Cheddock_scale = {         f'no correlation (|{name}| &lt;= 0.1)':    0.1,         f'very weak (0.1 &lt; |{name}| &lt;= 0.2)':   0.2,         f'weak (0.2 &lt; |{name}| &lt;= 0.3)':        0.3,         f'moderate (0.3 &lt; |{name}| &lt;= 0.5)':    0.5,         f'perceptible (0.5 &lt; |{name}| &lt;= 0.7)': 0.7,         f'high (0.7 &lt; |{name}| &lt;= 0.9)':        0.9,         f'very high (0.9 &lt; |{name}| &lt;= 0.99)':  0.99,         f'functional (|{name}| > 0.99)':        1.0}          r_scale = list(Cheddock_scale.values())     for i, elem in enumerate(r_scale):         if abs(r) &lt;= elem:             conclusion_Cheddock_scale = list(Cheddock_scale.keys())[i]             break     return conclusion_Cheddock_scale<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/23e\/802\/8cf\/23e8028cf6fe482012a194e9918c0852.png\" width=\"558\" height=\"23\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/23e\/802\/8cf\/23e8028cf6fe482012a194e9918c0852.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0428\u043a\u0430\u043b\u0430 \u0427\u0435\u0434\u0434\u043e\u043a\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0438\u0440\u0441\u043e\u043d\u0430 <strong>r<\/strong>), \u043d\u043e \u043c\u044b \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f <strong>\u03b7<\/strong> (\u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u043f\u0440\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <strong>\u03b7 \u2265 r<\/strong>!). \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>Cheddock_scale_check<\/strong> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 &#8212; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <strong>name=chr(951)<\/strong> \u0432\u044b\u0432\u043e\u0434\u0438\u0442 <strong>\u03b7<\/strong> \u0432\u043c\u0435\u0441\u0442\u043e <strong>r<\/strong>.<\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 <strong>\u0448\u043a\u0430\u043b\u0430 \u0427\u0435\u0434\u0434\u043e\u043a\u0430<\/strong> \u0442\u0435\u0440\u044f\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b \u0432\u0441\u0435 \u0447\u0430\u0449\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f <strong>\u0448\u043a\u0430\u043b\u0430 \u042d\u0432\u0430\u043d\u0441\u0430<\/strong> (\u0432 \u043f\u0441\u0438\u0445\u043e\u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445, \u043c\u0435\u0434\u0438\u043a\u043e-\u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0434\u0440.\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445) ( \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u0448\u043a\u0430\u043b\u044b \u0427\u0435\u0434\u0434\u043e\u043a\u0430, \u042d\u0432\u0430\u043d\u0441\u0430 \u0438 \u0434\u0440. &#8212; \u0441\u043c.[4]). \u041e\u0446\u0435\u043d\u0438\u043c \u0442\u0435\u0441\u043d\u043e\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043f\u043e <strong>\u0448\u043a\u0430\u043b\u0435 \u042d\u0432\u0430\u043d\u0441\u0430<\/strong>, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def Evans_scale_check(r, name='r'):     # \u0437\u0430\u0434\u0430\u0435\u043c \u0448\u043a\u0430\u043b\u0443 \u042d\u0432\u0430\u043d\u0441\u0430     Evans_scale = {         f'very weak (|{name}| &lt; 0.19)':         0.2,         f'weak (0.2 &lt; |{name}| &lt;= 0.39)':       0.4,           f'moderate (0.4 &lt; |{name}| &lt;= 0.59)':   0.6,         f'strong (0.6 &lt; |{name}| &lt;= 0.79)':     0.8,         f'very strong (0.8 &lt; |{name}| &lt;= 1.0)': 1.0}          r_scale = list(Evans_scale.values())     for i, elem in enumerate(r_scale):         if abs(r) &lt;= elem:             conclusion_Evans_scale = list(Evans_scale.keys())[i]             break     return conclusion_Evans_scale      print(f\"\u041e\u0446\u0435\u043d\u043a\u0430 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u042d\u0432\u0430\u043d\u0441\u0430: {Evans_scale_check(corr_ratio_XY, name=chr(951))}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef1\/99f\/bd1\/ef199fbd1357e8414a4401cee207fd62.png\" width=\"576\" height=\"25\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef1\/99f\/bd1\/ef199fbd1357e8414a4401cee207fd62.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0446\u0435\u043d\u0435\u043d\u0430 \u043a\u0430\u043a <strong>\u0432\u044b\u0441\u043e\u043a\u0430\u044f<\/strong> (\u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0427\u0435\u0434\u0434\u043e\u043a\u0430), <strong>\u0441\u0438\u043b\u044c\u043d\u0430\u044f<\/strong> (\u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u042d\u0432\u0430\u043d\u0441\u0430).<\/p>\n<p><u>3. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f:<\/u><\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443:<\/p>\n<pre><code>H0: \u03b7XY = 0 H1: \u03b7XY \u2260 0<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0424\u0438\u0448\u0435\u0440\u0430:<\/p>\n<pre><code class=\"python\"># \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430 F_corr_ratio_calc = (n_X - K_X)\/(K_X - 1) * corr_ratio_XY**2 \/ (1 - corr_ratio_XY**2) print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430: F_calc = {round(F_corr_ratio_calc, DecPlace)}\") # \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430 dfn = K_X - 1 dfd = n_X - K_X F_corr_ratio_table = sci.stats.f.ppf(p_level, dfn, dfd, loc=0, scale=1) print(f\"\u0422\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430: F_table = {round(F_corr_ratio_table, DecPlace)}\") # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 a_corr_ratio_calc = 1 - sci.stats.f.cdf(F_corr_ratio_calc, dfn, dfd, loc=0, scale=1) print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_calc = {round(a_corr_ratio_calc, DecPlace)}\") print(f\"\u0417\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_level = {round(a_level, DecPlace)}\") # \u0432\u044b\u0432\u043e\u0434 if F_corr_ratio_calc &lt; F_corr_ratio_table:     conclusion_corr_ratio_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a F_calc = {round(F_corr_ratio_calc, DecPlace)} &lt; F_table = {round(F_corr_ratio_table, DecPlace)}\" + \\         \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u043d\u0443\u043b\u044e \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u041f\u0420\u0418\u041d\u0418\u041c\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u041d\u0415\u0417\u041d\u0410\u0427\u0418\u041c\u0410\" else:     conclusion_corr_ratio_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a F_calc = {round(F_corr_ratio_calc, DecPlace)} >= F_table = {round(F_corr_ratio_table, DecPlace)}\" + \\         \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u043d\u0443\u043b\u044e \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u041e\u0422\u0412\u0415\u0420\u0413\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u0417\u041d\u0410\u0427\u0418\u041c\u0410\" print(conclusion_corr_ratio_sign)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f21\/427\/fd6\/f21427fd6be9e42f93ead515361bc7d5.png\" width=\"1223\" height=\"118\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f21\/427\/fd6\/f21427fd6be9e42f93ead515361bc7d5.png\"\/><figcaption><\/figcaption><\/figure>\n<p><u>4. \u0414\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f:<\/u><\/p>\n<pre><code class=\"python\"># \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u044b f1 = round ((K_X - 1 + n_X * corr_ratio_XY**2)**2 \/ (K_X - 1 + 2 * n_X * corr_ratio_XY**2)) f2 = n_X - K_X # \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b z1 = (n_X - K_X) \/ n_X * corr_ratio_XY**2 \/ (1 - corr_ratio_XY**2) * 1\/sci.stats.f.ppf(p_level, f1, f2, loc=0, scale=1) - (K_X - 1)\/n_X z2 = (n_X - K_X) \/ n_X * corr_ratio_XY**2 \/ (1 - corr_ratio_XY**2) * 1\/sci.stats.f.ppf(1 - p_level, f1, f2, loc=0, scale=1) - (K_X - 1)\/n_X # \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b corr_ratio_XY_low = sqrt(z1) if sqrt(z1) >= 0 else 0 corr_ratio_XY_high = sqrt(z2) if sqrt(z2) &lt;= 1 else 1 print(f\"{p_level*100}%-\u043d\u044b\u0439 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f: {[round(corr_ratio_XY_low, DecPlace), round(corr_ratio_XY_high, DecPlace)]}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/692\/ce8\/dd1\/692ce8dd1bded5213f07b35aa8496b4e.png\" width=\"629\" height=\"26\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/692\/ce8\/dd1\/692ce8dd1bded5213f07b35aa8496b4e.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>\u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 <strong>\u03b7<\/strong> \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a 0 \u0438\u043b\u0438 1 <strong>\u043b\u0435\u0432\u0430\u044f \u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043e\u0442\u0440\u0435\u0437\u043a\u0430 [0; 1], \u0442\u0435\u0440\u044f\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b<\/strong> (\u0441\u043c. [1, \u0441.80]). \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0433\u043e &#8212; \u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0433\u0440\u0430\u043d\u0438\u0446 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b, \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p><u>5. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043e\u0442 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439:<\/u><\/p>\n<p>\u041e\u0446\u0435\u043d\u0438\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">corr_coef = sci.stats.pearsonr(X, Y)[0] print(f\"\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438: r = {round(corr_coef, DecPlace)}\")  print(f\"\u041e\u0446\u0435\u043d\u043a\u0430 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0427\u0435\u0434\u0434\u043e\u043a\u0430: {Cheddock_scale_check(corr_coef)}\") print(f\"\u041e\u0446\u0435\u043d\u043a\u0430 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u042d\u0432\u0430\u043d\u0441\u0430: {Evans_scale_check(corr_coef)}\")<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fd0\/ade\/1a3\/fd0ade1a33ea0b157c6b81fecde78bb2.png\" width=\"645\" height=\"76\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fd0\/ade\/1a3\/fd0ade1a33ea0b157c6b81fecde78bb2.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\"># \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 a_corr_coef_calc = sci.stats.pearsonr(X, Y)[1] print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438: a_calc = {a_corr_coef_calc}\") print(f\"\u0417\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_level = {round(a_level, DecPlace)}\") # \u0432\u044b\u0432\u043e\u0434 if a_corr_coef_calc >= a_level:     conclusion_corr_coef_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {a_corr_coef_calc} >= a_level = {round(a_level, DecPlace)}\" + \\         \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u043d\u0443\u043b\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0420\u0418\u041d\u0418\u041c\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u041d\u0415\u0417\u041d\u0410\u0427\u0418\u041c\u0410\" else:     conclusion_corr_coef_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {a_corr_coef_calc} &lt; a_level = {round(a_level, DecPlace)}\" + \\         \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u043d\u0443\u043b\u044e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041e\u0422\u0412\u0415\u0420\u0413\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u0417\u041d\u0410\u0427\u0418\u041c\u0410\" print(conclusion_corr_coef_sign)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/943\/599\/dc5\/943599dc5cbbe2cc623c0ac722b2bc9e.png\" width=\"1424\" height=\"70\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/943\/599\/dc5\/943599dc5cbbe2cc623c0ac722b2bc9e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043e\u0442 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443:<\/p>\n<pre><code>H0: \u03b7\u00b2 - r\u00b2 = 0 H1: \u03b7\u00b2 - r\u00b2 \u2260 0<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0424\u0438\u0448\u0435\u0440\u0430:<\/p>\n<pre><code class=\"python\">print(f\"\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435: {chr(951)} = {round(corr_ratio_XY, DecPlace)}\") print(f\"\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438: r = {round(corr_coef, DecPlace)}\") # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430 F_line_corr_sign_calc = (n_X - K_X)\/(K_X - 2) * (corr_ratio_XY**2 - corr_coef**2) \/ (1 - corr_ratio_XY**2) print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430: F_calc = {round(F_line_corr_sign_calc, DecPlace)}\") # \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430 dfn = K_X - 2 dfd = n_X - K_X F_line_corr_sign_table = sci.stats.f.ppf(p_level, dfn, dfd, loc=0, scale=1) print(f\"\u0422\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0424\u0438\u0448\u0435\u0440\u0430: F_table = {round(F_line_corr_sign_table, DecPlace)}\") # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 a_line_corr_sign_calc = 1 - sci.stats.f.cdf(F_line_corr_sign_calc, dfn, dfd, loc=0, scale=1) print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_calc = {round(a_line_corr_sign_calc, DecPlace)}\") print(f\"\u0417\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_level = {round(a_level, DecPlace)}\") # \u0432\u044b\u0432\u043e\u0434 if F_line_corr_sign_calc &lt; F_line_corr_sign_table:     conclusion_line_corr_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a F_calc = {round(F_line_corr_sign_calc, DecPlace)} &lt; F_table = {round(F_line_corr_sign_table, DecPlace)}\" + \\         f\", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 {chr(951)} \u0438 r \u041f\u0420\u0418\u041d\u0418\u041c\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u041b\u0418\u041d\u0415\u0419\u041d\u0410\u042f\" else:     conclusion_line_corr_sign = f\"\u0422\u0430\u043a \u043a\u0430\u043a F_calc = {round(F_line_corr_sign_calc, DecPlace)} >= F_table = {round(F_line_corr_sign_table, DecPlace)}\" + \\         f\", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 {chr(951)} \u0438 r \u041e\u0422\u0412\u0415\u0420\u0413\u0410\u0415\u0422\u0421\u042f, \u0442.\u0435. \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u041d\u0415\u041b\u0418\u041d\u0415\u0419\u041d\u0410\u042f\" print(conclusion_line_corr_sign)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c87\/49c\/5e7\/c8749c5e70e78a2e1e45ce20e74c2c39.png\" width=\"1037\" height=\"168\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c87\/49c\/5e7\/c8749c5e70e78a2e1e45ce20e74c2c39.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 <\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>corr_coef_check<\/strong> &#8212; \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0438\u0440\u0441\u043e\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>corr_ratio_check<\/strong> &#8212; \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>line_corr_sign_check<\/strong> &#8212; \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u0432\u0438\u0434\u0435 DataFrame, \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0432\u043e\u0434\u0430 &#8212; \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044f).<\/p>\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0438\u0440\u0441\u043e\u043d\u0430 def corr_coef_check(X, Y, p_level=0.95, scale='Cheddok'):     a_level = 1 - p_level     X = np.array(X)     Y = np.array(Y)     n_X = len(X)     n_Y = len(Y)     # \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 scipy     corr_coef, a_corr_coef_calc = sci.stats.pearsonr(X, Y)     # \u043d\u0435\u0441\u043c\u0435\u0449\u0435\u043d\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 (\u043f\u0440\u0438 n &lt; 15) (\u0441\u043c.\u041a\u043e\u0431\u0437\u0430\u0440\u044c, \u0441.607)     if n_X &lt; 15:         corr_coef = corr_coef * (1 + (1 - corr_coef**2) \/ (2*(n_X-3)))     # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438     t_corr_coef_calc = abs(corr_coef) * sqrt(n_X-2) \/ sqrt(1 - corr_coef**2)     t_corr_coef_table = sci.stats.t.ppf((1 + p_level)\/2 , n_X - 2)     conclusion_corr_coef_sign = 'significance' if t_corr_coef_calc >= t_corr_coef_table else 'not significance'     # \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438     if t_corr_coef_calc >= t_corr_coef_table:         z1 = np.arctanh(corr_coef) - sci.stats.norm.ppf((1 + p_level)\/2, 0, 1) \/ sqrt(n_X-3) - corr_coef \/ (2*(n_X-1))         z2 = np.arctanh(corr_coef) + sci.stats.norm.ppf((1 + p_level)\/2, 0, 1) \/ sqrt(n_X-3) - corr_coef \/ (2*(n_X-1))         corr_coef_conf_int_low = tanh(z1)         corr_coef_conf_int_high = tanh(z2)     else:         corr_coef_conf_int_low = corr_coef_conf_int_high = '-'         # \u043e\u0446\u0435\u043d\u043a\u0430 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u0438     if scale=='Cheddok':         conclusion_corr_coef_scale = scale + ': ' + Cheddock_scale_check(corr_coef)     elif scale=='Evans':         conclusion_corr_coef_scale = scale + ': ' + Evans_scale_check(corr_coef)     # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442                 result = pd.DataFrame({         'notation': ('r'),         'coef_value': (corr_coef),         'coef_value_squared': (corr_coef**2),         'p_level': (p_level),         'a_level': (a_level),         't_calc': (t_corr_coef_calc),         't_table': (t_corr_coef_table),         't_calc >= t_table': (t_corr_coef_calc >= t_corr_coef_table),         'a_calc': (a_corr_coef_calc),         'a_calc &lt;= a_level': (a_corr_coef_calc &lt;= a_level),         'significance_check': (conclusion_corr_coef_sign),         'conf_int_low': (corr_coef_conf_int_low),         'conf_int_high': (corr_coef_conf_int_high),         'scale': (conclusion_corr_coef_scale)         },         index=['Correlation coef.'])              return result        <\/code><\/pre>\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f def corr_ratio_check(X, Y, p_level=0.95, orientation='XY', scale='Cheddok'):     a_level = 1 - p_level     X = np.array(X)     Y = np.array(Y)     n_X = len(X)     n_Y = len(Y)         # \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 DataFrame     matrix_XY_df = pd.DataFrame({         'X': X,         'Y': Y})     # \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438     group_int_number = lambda n: round (3.31*log(n_X, 10)+1) if round (3.31*log(n_X, 10)+1) >=2 else 2     K_X = group_int_number(n_X)     K_Y = group_int_number(n_Y)     # \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     cut_X = pd.cut(X, bins=K_X)     cut_Y = pd.cut(Y, bins=K_Y)     matrix_XY_df['cut_X'] = cut_X     matrix_XY_df['cut_Y'] = cut_Y     CorrTable_df = pd.crosstab(         index=matrix_XY_df['cut_X'],         columns=matrix_XY_df['cut_Y'],         rownames=['cut_X'],         colnames=['cut_Y'])     CorrTable_np = np.array(CorrTable_df)     # \u0438\u0442\u043e\u0433\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c     n_group_X = [np.sum(CorrTable_np[i]) for i in range(K_X)]     n_group_Y = [np.sum(CorrTable_np[:,j]) for j in range(K_Y)]     # \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X     Xboun_mean = [(CorrTable_df.index[i].left + CorrTable_df.index[i].right)\/2 for i in range(K_X)]     Xboun_mean[0] = (np.min(X) + CorrTable_df.index[0].right)\/2    # \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u0445     Xboun_mean[K_X-1] = (CorrTable_df.index[K_X-1].left + np.max(X))\/2     # \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y     Yboun_mean = [(CorrTable_df.columns[j].left + CorrTable_df.columns[j].right)\/2 for j in range(K_Y)]     Yboun_mean[0] = (np.min(Y) + CorrTable_df.columns[0].right)\/2    # \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0440\u0430\u0439\u043d\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u0445     Yboun_mean[K_Y-1] = (CorrTable_df.columns[K_Y-1].left + np.max(Y))\/2     # \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0437\u0435\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f X \u0438 Y \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b     Xmean_group = [np.sum(CorrTable_np[:,j] * Xboun_mean) \/ n_group_Y[j] for j in range(K_Y)]     Ymean_group = [np.sum(CorrTable_np[i] * Yboun_mean) \/ n_group_X[i] for i in range(K_X)]     # \u043e\u0431\u0449\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f X \u0438 Y     Sum2_total_X = np.sum(n_group_X * (Xboun_mean - np.mean(X))**2)     Sum2_total_Y = np.sum(n_group_Y * (Yboun_mean - np.mean(Y))**2)     # \u043c\u0435\u0436\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f X \u0438 Y (\u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0445)     Sum2_between_group_X = np.sum(n_group_Y * (Xmean_group - np.mean(X))**2)     Sum2_between_group_Y = np.sum(n_group_X * (Ymean_group - np.mean(Y))**2)     # \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435     corr_ratio_XY = sqrt(Sum2_between_group_Y \/ Sum2_total_Y)     corr_ratio_YX = sqrt(Sum2_between_group_X \/ Sum2_total_X)     try:         if orientation!='XY' and orientation!='YX':             raise ValueError(\"Error! Incorrect orientation!\")         if orientation=='XY':             corr_ratio = corr_ratio_XY         elif orientation=='YX':             corr_ratio = corr_ratio_YX     except ValueError as err:         print(err)     # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f     F_corr_ratio_calc = (n_X - K_X)\/(K_X - 1) * corr_ratio**2 \/ (1 - corr_ratio**2)     dfn = K_X - 1     dfd = n_X - K_X     F_corr_ratio_table = sci.stats.f.ppf(p_level, dfn, dfd, loc=0, scale=1)     a_corr_ratio_calc = 1 - sci.stats.f.cdf(F_corr_ratio_calc, dfn, dfd, loc=0, scale=1)     conclusion_corr_ratio_sign = 'significance' if F_corr_ratio_calc >= F_corr_ratio_table else 'not significance'     # \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f     if F_corr_ratio_calc >= F_corr_ratio_table:         f1 = round ((K_X - 1 + n_X * corr_ratio**2)**2 \/ (K_X - 1 + 2 * n_X * corr_ratio**2))         f2 = n_X - K_X         z1 = (n_X - K_X) \/ n_X * corr_ratio**2 \/ (1 - corr_ratio**2) * 1\/sci.stats.f.ppf(p_level, f1, f2, loc=0, scale=1) - (K_X - 1)\/n_X         z2 = (n_X - K_X) \/ n_X * corr_ratio**2 \/ (1 - corr_ratio**2) * 1\/sci.stats.f.ppf(1 - p_level, f1, f2, loc=0, scale=1) - (K_X - 1)\/n_X         corr_ratio_conf_int_low = sqrt(z1) if sqrt(z1) >= 0 else 0         corr_ratio_conf_int_high = sqrt(z2) if sqrt(z2) &lt;= 1 else 1     else:         corr_ratio_conf_int_low = corr_ratio_conf_int_high = '-'         # \u043e\u0446\u0435\u043d\u043a\u0430 \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u0438     if scale=='Cheddok':         conclusion_corr_ratio_scale = scale + ': ' + Cheddock_scale_check(corr_ratio, name=chr(951))     elif scale=='Evans':         conclusion_corr_ratio_scale = scale + ': ' + Evans_scale_check(corr_ratio, name=chr(951))     # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442                 result = pd.DataFrame({         'notation': (chr(951)),         'coef_value': (corr_ratio),         'coef_value_squared': (corr_ratio**2),         'p_level': (p_level),         'a_level': (a_level),         'F_calc': (F_corr_ratio_calc),         'F_table': (F_corr_ratio_table),         'F_calc >= F_table': (F_corr_ratio_calc >= F_corr_ratio_table),         'a_calc': (a_corr_ratio_calc),         'a_calc &lt;= a_level': (a_corr_ratio_calc &lt;= a_level),         'significance_check': (conclusion_corr_ratio_sign),         'conf_int_low': (corr_ratio_conf_int_low),         'conf_int_high': (corr_ratio_conf_int_high),         'scale': (conclusion_corr_ratio_scale)         },         index=['Correlation ratio'])          return result        <\/code><\/pre>\n<pre><code class=\"python\"># \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 def line_corr_sign_check(X, Y, p_level=0.95, orientation='XY'):     a_level = 1 - p_level     X = np.array(X)     Y = np.array(Y)     n_X = len(X)     n_Y = len(Y)         # \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438     corr_coef = sci.stats.pearsonr(X, Y)[0]     # \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435     try:         if orientation!='XY' and orientation!='YX':             raise ValueError(\"Error! Incorrect orientation!\")         if orientation=='XY':             corr_ratio = corr_ratio_check(X, Y, orientation='XY', scale='Evans')['coef_value'].values[0]         elif orientation=='YX':             corr_ratio = corr_ratio_check(X, Y, orientation='YX', scale='Evans')['coef_value'].values[0]     except ValueError as err:         print(err)     # \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438     group_int_number = lambda n: round (3.31*log(n_X, 10)+1) if round (3.31*log(n_X, 10)+1) >=2 else 2     K_X = group_int_number(n_X)     # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438     if corr_ratio >= abs(corr_coef):         F_line_corr_sign_calc = (n_X - K_X)\/(K_X - 2) * (corr_ratio**2 - corr_coef**2) \/ (1 - corr_ratio**2)         dfn = K_X - 2         dfd = n_X - K_X         F_line_corr_sign_table = sci.stats.f.ppf(p_level, dfn, dfd, loc=0, scale=1)         comparison_F_calc_table = F_line_corr_sign_calc >= F_line_corr_sign_table         a_line_corr_sign_calc = 1 - sci.stats.f.cdf(F_line_corr_sign_calc, dfn, dfd, loc=0, scale=1)         comparison_a_calc_a_level = a_line_corr_sign_calc &lt;= a_level         conclusion_null_hypothesis_check = 'accepted' if F_line_corr_sign_calc &lt; F_line_corr_sign_table else 'unaccepted'         conclusion_line_corr_sign = 'linear' if conclusion_null_hypothesis_check == 'accepted' else 'non linear'     else:         F_line_corr_sign_calc = ''         F_line_corr_sign_table = ''         comparison_F_calc_table = ''         a_line_corr_sign_calc = ''         comparison_a_calc_a_level = ''         conclusion_null_hypothesis_check = 'Attention! The correlation ratio is less than the correlation coefficient'         conclusion_line_corr_sign = '-'          # \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442                 result = pd.DataFrame({         'corr.coef.': (corr_coef),         'corr.ratio.': (corr_ratio),         'null hypothesis': ('r\\u00b2 = ' + chr(951) + '\\u00b2'),         'p_level': (p_level),         'a_level': (a_level),         'F_calc': (F_line_corr_sign_calc),         'F_table': (F_line_corr_sign_table),         'F_calc >= F_table': (comparison_F_calc_table),         'a_calc': (a_line_corr_sign_calc),         'a_calc &lt;= a_level': (comparison_a_calc_a_level),         'null_hypothesis_check': (conclusion_null_hypothesis_check),         'significance_line_corr_check': (conclusion_line_corr_sign),         },         index=['Significance of linear correlation'])          return result<\/code><\/pre>\n<pre><code class=\"python\">display(corr_coef_check(X, Y, scale='Evans')) display(corr_ratio_check(X, Y, orientation='XY', scale='Evans')) display(line_corr_sign_check(X, Y, orientation='XY'))<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/07b\/61a\/5b7\/07b61a5b70877ec4d0d5b055ee4b1722.png\" width=\"1601\" height=\"290\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07b\/61a\/5b7\/07b61a5b70877ec4d0d5b055ee4b1722.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u041c\u0435\u0436\u0434\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f (<strong>a<sub>calc<\/sub>&lt;0.05<\/strong>) \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c, \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 <strong>\u03b7 = 0.7936<\/strong> (\u0442.\u0435. \u0441\u0432\u044f\u0437\u044c <strong>\u0441\u0438\u043b\u044c\u043d\u0430\u044f<\/strong> \u043f\u043e \u042d\u0432\u0430\u043d\u0441\u0443).<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0442\u0430\u043a\u0436\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f (<strong>a<sub>calc<\/sub>&lt;0.05<\/strong>), \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 <strong>r = -0.7189<\/strong> (\u0441\u0432\u044f\u0437\u044c <strong>\u0441\u0438\u043b\u044c\u043d\u0430\u044f<\/strong> \u043f\u043e \u042d\u0432\u0430\u043d\u0441\u0443); \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 51.68% \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0435 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f (<strong>a<sub>calc<\/sub>&lt;0.05<\/strong>), \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0441\u0432\u044f\u0437\u0438 \u043e\u0442 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e.<\/p>\n<\/li>\n<\/ol>\n<p><strong><em><u>\u0418\u0422\u041e\u0413\u0418<\/u><\/em><\/strong><\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <strong>Python<\/strong>. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub (<a href=\"https:\/\/github.com\/AANazarov\/Statistical-methods\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/AANazarov\/Statistical-methods<\/a>).<\/p>\n<p><strong><em><u>\u041b\u0418\u0422\u0415\u0420\u0410\u0422\u0423\u0420\u0410<\/u><\/em><\/strong><\/p>\n<ol>\n<li>\n<p>\u0410\u0439\u0432\u0430\u0437\u044f\u043d \u0421.\u0410. \u0438 \u0434\u0440. \u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430: \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. &#8212; \u041c.: \u0424\u0438\u043d\u0430\u043d\u0441\u044b \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430, 1985. &#8212; 487 \u0441.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0439\u0432\u0430\u0437\u044f\u043d \u0421.\u0410., \u041c\u0445\u0438\u0442\u0430\u0440\u044f\u043d \u0412.\u0421. \u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430. \u041e\u0441\u043d\u043e\u0432\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u043a\u0438: \u0412 2 \u0442. &#8212; \u0422.1: \u0422\u0435\u043e\u0440\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430. &#8212; \u041c.: \u042e\u041d\u0418\u0422\u0418-\u0414\u0410\u041d\u0410, 2001. &#8212; 656 \u0441.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0431\u0437\u0430\u0440\u044c \u0410.\u0418. \u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430. \u0414\u043b\u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0438 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u043d\u0438\u043a\u043e\u0432. &#8212; \u041c.: \u0424\u0418\u0417\u041c\u0410\u0422\u041b\u0418\u0422, 2006. &#8212; 816 \u0441.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0442\u0435\u0440\u043e\u0432 \u0410.\u041d. \u0438 \u0434\u0440. \u0421\u0438\u043b\u0430 \u0441\u0432\u044f\u0437\u0438. \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 2. \u0413\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438. &#8212; \u041c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0430\u044f \u0440\u0430\u0434\u0438\u043e\u043b\u043e\u0433\u0438\u044f \u0438 \u0440\u0430\u0434\u0438\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. 2019. \u0422\u043e\u043c 64. \u2116 6. \u0441.12\u201324 (<a href=\"https:\/\/medradiol.fmbafmbc.ru\/journal_medradiol\/abstracts\/2019\/6\/12-24_Koterov_et_al.pdf\" rel=\"noopener noreferrer nofollow\">https:\/\/medradiol.fmbafmbc.ru\/journal_medradiol\/abstracts\/2019\/6\/12-24_Koterov_et_al.pdf<\/a>).<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/683442\/\"> https:\/\/habr.com\/ru\/post\/683442\/<\/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<h3>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u041f\u0440\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0440\u0430\u0441\u0447\u0435\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043a\u0430\u043a <strong>\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 (\u03b7)<\/strong>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043e\u0431\u043e\u0439\u0434\u0435\u043d \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 <strong>\u03b7<\/strong> \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <strong>Python<\/strong>.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043e\u0440\u0438\u044e (\u043f\u0440\u043e <strong>\u03b7<\/strong> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 [1, \u0441.73], [2, \u0441.412], [3, \u0441.609]), \u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>\u03b7<\/strong>:<\/p>\n<ol>\n<li>\n<p><strong>\u03b7<\/strong> \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0442\u0435\u0441\u043d\u043e\u0442\u044b <strong>\u043b\u044e\u0431\u043e\u0439<\/strong> \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 (\u043a\u0430\u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439), \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438 \u041f\u0438\u0440\u0441\u043e\u043d\u0430 <strong>r<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0442\u0435\u0441\u043d\u043e\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439<\/strong> \u0441\u0432\u044f\u0437\u0438. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 <strong>r=0<\/strong> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u043c\u0438, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c (<strong>\u03b7>0<\/strong>).<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 1; \u043f\u0440\u0438 <strong>\u03b7=0<\/strong> \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u0440\u0438 <strong>\u03b7=1<\/strong> \u0441\u0432\u044f\u0437\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439; \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0442\u0435\u0441\u043d\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u0448\u043a\u0430\u043b\u0430\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0427\u0435\u0434\u0434\u043e\u043a\u0430 \u0438 \u0434\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u043b\u0438\u0447\u0438\u043d\u0430 <strong>\u03b7\u00b2<\/strong> \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0434\u043e\u043b\u044e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b <strong>r<\/strong>: <strong>\u03b7 \u2265 |r|<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u03b7<\/strong> \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c <strong>\u03b7<sub>XY<\/sub> \u2260 \u03b7<sub>YX<\/sub><\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 <strong>\u03b7<\/strong> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0441\u0442\u044f\u043c\u0438; \u0435\u0441\u043b\u0438 \u0436\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <strong>X<\/strong> \u0438 <strong>Y<\/strong>, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e\u0442 \u0432\u044b\u0432\u043e\u0434, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d &#8212; \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c <strong>\u03b7<\/strong> \u043f\u043e \u043d\u0435\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <strong>\u03b7=1<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 <strong>\u03b7<\/strong> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <strong>X<\/strong> \u0438 <strong>Y<\/strong> \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b, \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <strong>\u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/strong>.<\/p>\n<p><strong>\u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0435 \u0441\u0432\u044f\u0437\u0438, \u0431\u043b\u0438\u0437\u043a\u043e\u0439 \u043a \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439, \u0438 <strong>\u03b7<\/strong> \u0431\u043b\u0438\u0437\u043a\u043e\u043c \u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u0430\u0431\u0441\u0443\u0440\u0434\u043d\u044b\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u03b7 \u2265 |r|;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 <strong>r<\/strong> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u043c, \u0430 <strong>\u03b7<\/strong> \u043d\u0435\u0442;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0436\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0434\u043b\u044f <strong>\u03b7<\/strong> \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 0 \u0438\u043b\u0438 \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 &#8212; \u0431\u043e\u043b\u044c\u0448\u0435 1.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0430 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c) (FuelFlow)<\/strong> \u043e\u0442 <strong>\u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u0435\u0433\u0430 (\u043a\u043c) (Mileage)<\/strong>.<\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 csv-\u0444\u0430\u0439\u043b\u0430 (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/github.com\/AANazarov\/Statistical-methods\" rel=\"noopener noreferrer nofollow\">\u0432 \u043c\u043e\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub<\/a>):<\/p>\n<pre><code class=\"python\">fuel_df = pd.read_csv(     filepath_or_buffer='data\/fuel_df.csv',     sep=';',     index_col='Number') dataset_df = fuel_df.copy()    # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b display(dataset_df.head())<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 <strong>DataFrame<\/strong> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b:<\/p>\n<ul>\n<li>\n<p><strong>Month<\/strong> \u2014 \u043c\u0435\u0441\u044f\u0446 (\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel)<\/p>\n<\/li>\n<li>\n<p><strong>Mileage<\/strong> &#8212; \u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>Temperature<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 (\u00b0C) <\/p>\n<\/li>\n<li>\n<p><strong>FuelFlow<\/strong> &#8212; \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 (\u043b\/100 \u043a\u043c)<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <strong>Mileage<\/strong> \u0438 <strong>FuelFlow<\/strong> \u0432 \u0432\u0438\u0434\u0435 <strong>numpy.ndarray<\/strong>.<\/p>\n<pre><code class=\"python\">X = np.array(dataset_df['Mileage']) Y = np.array(dataset_df['FuelFlow'])<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 DataFrame \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 &#8212; <strong>X<\/strong> \u0438 <strong>Y<\/strong>:<\/p>\n<pre><code class=\"python\">data_XY_df = pd.DataFrame({     'X': X,     'Y': Y})<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u043e\u0442\u0447\u0435\u0442\u0430 (\u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432):<\/p>\n<pre><code class=\"python\"># \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Project = \"\u0420\u0430\u0441\u0447\u0435\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Python\" # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 AsOfTheDate = \"\" # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Task_Theme = \"\u0410\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f\" # \u041e\u0431\u0449\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 Title_String = f\"{Task_Project}\\n{AsOfTheDate}\" # \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Variable_Name_X = \"\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u0433 (\u043a\u043c)\" Variable_Name_Y = \"\u0421\u0440\u0435\u0434\u043d\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0445\u043e\u0434 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f (\u043b\/100 \u043a\u043c)\"<\/code><\/pre>\n<h3>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0435\u0435\u043c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0432\u044b\u0431\u0440\u043e\u0441\u044b). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435, \u043e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<pre><code class=\"python\">mask1 = data_XY_df['X'] > 200 mask2 = data_XY_df['X'] &lt; 2000 data_XY_df = data_XY_df[mask1 &amp; mask2]  X = np.array(data_XY_df['X']) Y = np.array(data_XY_df['Y'])<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">data_XY_df.describe()<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">fig, axes = plt.subplots(figsize=(297\/INCH, 210\/INCH)) fig.suptitle(Task_Theme) axes.set_title('\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u0433\u0430') data_df = data_XY_df sns.scatterplot(     data=data_df,     x='X', y='Y',     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435',     s=50,     ax=axes) axes.set_xlabel(Variable_Name_X) axes.set_ylabel(Variable_Name_Y) #axes.tick_params(axis=\"x\", labelsize=f_size+4) #axes.tick_params(axis=\"y\", labelsize=f_size+4) #axes.legend(prop={'size': f_size+6}) plt.show() fig.savefig('graph\/scatterplot_XY_sns.png', orientation = \"portrait\", dpi = 300)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u044b\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"python\">fig = plt.figure(figsize=(420\/INCH, 297\/INCH)) ax1 = plt.subplot(2,2,1) ax2 = plt.subplot(2,2,2) ax3 = plt.subplot(2,2,3) ax4 = plt.subplot(2,2,4) fig.suptitle(Task_Theme) ax1.set_title('X') ax2.set_title('Y')  # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 data_df = data_XY_df X_mean = data_df['X'].mean() X_std = data_df['X'].std(ddof = 1) Y_mean = data_df['Y'].mean() Y_std = data_df['Y'].std(ddof = 1) bins_hist = 'sturges'    # \u0432\u044b\u0431\u043e\u0440 \u0447\u0438\u0441\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 ('auto', 'fd', 'doane', 'scott', 'stone', 'rice', 'sturges', 'sqrt')  # \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f X xmin = np.amin(data_df['X']) xmax = np.amax(data_df['X']) nx = 100 hx = (xmax - xmin)\/(nx - 1) x1 = np.linspace(xmin, xmax, nx) xnorm1 = sps.norm.pdf(x1, X_mean, X_std) kx = len(np.histogram(X, bins=bins_hist, density=False)[0]) xnorm2 = xnorm1*len(X)*(xmax-xmin)\/kx  # \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f Y ymin = np.amin(Y) ymax = np.amax(Y) ny = 100 hy = (ymax - ymin)\/(ny - 1) y1 = np.linspace(ymin, ymax, ny) ynorm1 = sps.norm.pdf(y1, Y_mean, Y_std) ky = len(np.histogram(Y, bins=bins_hist, density=False)[0]) ynorm2 = ynorm1*len(Y)*(ymax-ymin)\/ky  # \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f X ax1.hist(     data_df['X'],     bins=bins_hist,     density=False,     histtype='bar',    # 'bar', 'barstacked', 'step', 'stepfilled'     orientation='vertical',   # 'vertical', 'horizontal'     color = \"#1f77b4\",     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430') ax1.plot(     x1, xnorm2,     linestyle = \"-\",     color = \"r\",     linewidth = 2,     label = '\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f') ax1.axvline(X_mean, color='magenta', label = '\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435') ax1.axvline(np.median(data_df['X']), color='orange', label = '\u043c\u0435\u0434\u0438\u0430\u043d\u0430') ax1.legend(fontsize = f_size+4)  # \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f Y ax2.hist(     data_df['Y'],     bins=bins_hist,     density=False,     histtype='bar',    # 'bar', 'barstacked', 'step', 'stepfilled'     orientation='vertical',   # 'vertical', 'horizontal'     color = \"#1f77b4\",     label='\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430')     ax2.plot(     y1, ynorm2,     linestyle = \"-\",     color = \"r\",     linewidth = 2,     label = '\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f') ax2.axvline(Y_mean, color='magenta', label = '\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435') ax2.axvline(np.median(data_df['Y']), color='orange', label = '\u043c\u0435\u0434\u0438\u0430\u043d\u0430') ax2.legend(fontsize = f_size+4)  # \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 X sns.boxplot(     #data=corn_yield_df,     x=data_df['X'],     orient='h',     width=0.3,     ax=ax3)  # \u043a\u043e\u0440\u043e\u0431\u0447\u0430\u0442\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 Y sns.boxplot(     #data=corn_yield_df,      x=data_df['Y'],      orient='h',      width=0.3,      ax=ax4)  # \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043e\u0441\u0435\u0439  ax3.set_xlabel(Variable_Name_X) ax4.set_xlabel(Variable_Name_Y)  plt.show() fig.savefig('graph\/scatterplot_boxplot_X_Y_sns.png', orientation = \"portrait\", dpi = 300)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0438 \u0442.\u0434.<\/p>\n<p>\u00a0\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430:<\/p>\n<pre><code class=\"python\"># \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0430 \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 def Shapiro_Wilk_test(data):     data = np.array(data)     result = sci.stats.shapiro(data)     s_calc = result.statistic    # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f     a_calc = result.pvalue    # \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438          print(f\"\u0420\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_calc = {round(a_calc, DecPlace)}\")     print(f\"\u0417\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438: a_level = {round(a_level, DecPlace)}\")          if a_calc >= a_level:         conclusion_ShW_test = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {round(a_calc, DecPlace)} >= a_level = {round(a_level, DecPlace)}\" + \\             \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 \u041f\u0420\u0418\u041d\u0418\u041c\u0410\u0415\u0422\u0421\u042f\"     else:         conclusion_ShW_test = f\"\u0422\u0430\u043a \u043a\u0430\u043a a_calc = {round(a_calc, DecPlace)} &lt; a_level = {round(a_level, DecPlace)}\" + \\             \", \u0442\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0428\u0430\u043f\u0438\u0440\u043e-\u0423\u0438\u043b\u043a\u0430 \u041e\u0422\u0412\u0415\u0420\u0413\u0410\u0415\u0422\u0421\u042f\"     print(conclusion_ShW_test)<\/code><\/pre>\n<pre><code class=\"python\"># \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 X Shapiro_Wilk_test(X)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<pre><code class=\"python\"># \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 Y Shapiro_Wilk_test(Y)<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b <strong>\u03b7<\/strong>, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u0443 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0420\u0430\u0441\u0447\u0451\u0442 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p><u>1. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u043e\u0431\u043e\u0438\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c X \u0438 Y:<\/u><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>matrix_XY_df<\/strong> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre><code class=\"python\">matrix_XY_df = data_XY_df.copy()<\/code><\/pre>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 (\u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0421\u0442\u0435\u0440\u0434\u0436\u0435\u0441\u0441\u0430); \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 2:<\/p>\n<pre><code class=\"python\"># \u043e\u0431\u044a\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 X \u0438 Y n_X = len(X) n_Y = len(Y)  # \u0447\u0438\u0441\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 group_int_number = lambda<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-337246","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337246","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=337246"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337246\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}