{"id":453402,"date":"2025-03-26T15:01:19","date_gmt":"2025-03-26T15:01:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=453402"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=453402","title":{"rendered":"<span>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Python \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433-\u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python \u0432\u0437\u044f\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440\u0430, \u043e \u0444\u0438\u043b\u044c\u043c\u0430\u0445 \u0438 \u0438\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435. \u0411\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: Pandas, Numpy \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 Seaborn \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h3>1. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<h4>1.1 \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>import<\/strong>:<\/p>\n<pre><code>import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0440\u0438 \u0434\u0430\u0442\u0430 \u0441\u0435\u0442\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0444\u0438\u043b\u044c\u043c\u0430\u0445, \u0438\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>pd.read_csv<\/strong> \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 DataFrame:<\/p>\n<pre><code>movies_data = pd.read_csv('Dataset_Movie.csv') ratings = pd.read_csv('Rating.csv') users = pd.read_csv('users.csv')<\/code><\/pre>\n<h4>1.2 \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 DataFrame \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/h4>\n<p>\u0411\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c DataFrame \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <strong>.isnull().sum()<\/strong>.<br \/> \u041c\u0435\u0442\u043e\u0434 <strong>isnull()<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 DataFrame \u0442\u043e\u0439 \u0436\u0435 \u0444\u043e\u0440\u043c\u044b, \u043d\u043e \u0441 \u0431\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <em>True<\/em> \u0438\u043b\u0438 <em>False<\/em>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <em>True<\/em> \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <strong>1<\/strong>, \u0430 <em>False<\/em> \u043a\u0430\u043a <strong>0<\/strong>, \u0441\u0443\u043c\u043c\u0430 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435.<\/p>\n<pre><code>print(ratings.isnull().sum())<\/code><\/pre>\n<p>output:<\/p>\n<p>User_ID 0<br \/> Rating 0<br \/> Movie_ID 0<\/p>\n<h4>1.3 \u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 DataFrame \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<pre><code>ratings['Rating'] = ratings['Rating'].fillna(ratings['Rating'].mean()) users['Age'] = users['Age'].fillna(users['Age'].median())<\/code><\/pre>\n<p>\u0411\u044b\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043c\u0435\u0442\u043e\u0434 <strong>.fillna()<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Rating&#8217; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Rating&#8217; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.mean()<\/strong>.<br \/> \u0414\u043b\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Age&#8217; \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.median()<\/strong><\/p>\n<h4>1.4 \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446<\/h4>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043b\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u0438\u043d DataFrame.<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>pd.merge()<\/strong>, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u0435c\u0442\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f DataFrame \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.head()<\/strong>, \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code>merged_df = pd.merge(movies_data, ratings, on = 'Movie_ID') rating_user = pd.merge(users, merged_df, on = 'User_ID') print(rating_user.head())<\/code><\/pre>\n<h3>2. \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h3>\n<h4>2.1 \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440<\/h4>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<pre><code>rating_user = rating_user.assign(Genres=rating_user['Favorite_Genre'].str.split('|')).explode('Favorite_Genre') most_popular_genre = rating_user['Favorite_Genre'].value_counts().idxmax() print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:\\n{most_popular_genre}')<\/code><\/pre>\n<p>C\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Favorite_Genre&#8217;, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0435 \u043e\u0434\u0438\u043d \u0436\u0430\u043d\u0440. \u0417\u0430\u0442\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.value_counts()<\/strong> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0436\u0430\u043d\u0440\u0430, \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <strong>.idmax()<\/strong><\/p>\n<h4>2.2 \u0421\u0430\u043c\u044b\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u043c\u044b \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435:<\/p>\n<pre><code>rating_user['Age_Group'] = pd.cut(rating_user['Age'],  bins = [18,30,45,60,90],  labels= ['18-30', '30-45', '45-60', '60-90'])<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8216;Age_Group&#8217;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 <strong>pd.cut()<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b (<em>bins<\/em>) \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u044b (<em>labels<\/em>).<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u043c\u0435\u0442\u043e\u0434 <strong>pd.pivot_table<\/strong>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430: \u043f\u043e \u043e\u0441\u0438 <em>\u0430\u0431\u0441\u0446\u0438\u0441\u0441<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Favorite_Genre&#8217;, \u043f\u043e \u043e\u0441\u0438 <em>\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/em> &#8212; \u0438\u0437 &#8216;Age_Group&#8217;. \u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u043e\u043b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433<\/em> \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u043e \u0434\u0432\u0443\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code>popular_genre = pivot.idxmax(axis=0) popular_genre_df = popular_genre.reset_index() popular_genre_df.columns = ['Age_Group', 'Most_Popular_Genre'] print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b:\\n{popular_genre_df}')<\/code><\/pre>\n<p>output:<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b:<br \/> Age_Group Most_Popular_Genre<br \/> 0     18-30             Action<br \/> 1      30-45            Drama<br \/> 2     45-60            Romance<br \/> 3     60-90            Horror<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 DataFrame <strong>popular_genre_df<\/strong> \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 &#8216;Age_Group&#8217; \u0438 &#8216;Most_Popular_Genre&#8217;. \u0411\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <em>.idmax(axis = 0)<\/em> (axis = 0 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c).<\/p>\n<h4>2.3 \u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435<\/h4>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043b\u044e\u0434\u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u0438 \u0444\u0438\u043b\u044c\u043c\u044b \u0437\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439:<\/p>\n<pre><code>bins1=[1960, 1970, 1980, 1990, 2000]<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 &#8216;Age_Group&#8217;, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8216;Decade&#8217;:<\/p>\n<pre><code>rating_user['Decade'] = pd.cut(     rating_user['Year'],     bins=bins1,     right=False,     labels=[f'{bins1[i]}' for i in range(len(bins1) - 1)])<\/code><\/pre>\n<p>\u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 &#8216;Decade&#8217;, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433:<\/p>\n<pre><code>avg_rating_by_year = round(rating_user.groupby('Decade', observed = True)['Rating'].mean(),2) print(f'\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435:\\n{avg_rating_by_year}')<\/code><\/pre>\n<p>output:<br \/> Decade<br \/> 1960     3.74<br \/> 1970     3.76<br \/> 1980     3.62<br \/> 1990     3.61<br \/> \u041a\u0430\u043a \u0438\u0442\u043e\u0433: \u0432 \u0441\u0435\u043c\u0438\u0434\u0435\u0441\u044f\u0442\u044b\u0435 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0444\u0438\u043b\u044c\u043c\u044b \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u043c.<\/p>\n<h4>2.4 \u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h4>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a python \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0443, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e.<\/p>\n<pre><code>country_most_users = rating_user['Country'].value_counts().idxmax() print(f'\u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:\\n{country_most_users}')<\/code><\/pre>\n<p>output:<br \/> \u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<br \/> Germany<br \/> \u041c\u0435\u0442\u043e\u0434\u043e\u043c <strong>value_counts().idmax()<\/strong> \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043e\u0439 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h4>2.5 \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435<\/h4>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0444\u0438\u043b\u044c\u043c\u044b \u043a\u0430\u043a\u043e\u0433\u043e \u0436\u0430\u043d\u0440\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:<\/p>\n<pre><code>top_genre_by_country = rating_user.groupby('Country') ['Favorite_Genre'].apply(lambda x: x.mode()[0]) print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:\\n {top_genre_by_country}')<\/code><\/pre>\n<p>output:<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:<br \/> Country<br \/> Australia        Romance<br \/> Brazil             Romance<br \/> Canada          Documentary<br \/> France           Drama<br \/> Germany       Drama<br \/> India              Horror<br \/> Japan            Documentary<br \/> Mexico          Romance<br \/> UK                 Documentary<br \/> USA               Romance<br \/> Name: Favorite_Genre, dtype: object<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044f (<em>lambda<\/em>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Favorite_Genre&#8217; \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.mode()<\/strong>. \u041c\u0435\u0442\u043e\u0434 .mode() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e.<br \/> \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e [0].<\/p>\n<h4>2.6 \u041e\u0442\u0431\u043e\u0440 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0441 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435 4.5<\/h4>\n<pre><code>top_movies = rating_user[rating_user['Rating'] &gt; 4.5][['Movie_ID', 'Rating']]<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0442\u0431\u043e\u0440\u0435 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430 \u0431\u0443\u043b\u0435\u0432\u0430\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u0438 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430: \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d DataFrame c \u0431\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <strong>[&#8216;Rating&#8217;] &gt; 4.5<\/strong>.<br \/> \u041f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Movie_ID&#8217; \u0438 &#8216;Rating&#8217; \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>2.7 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438<\/h4>\n<pre><code>watch_hours = rating_user.groupby('Subscription_Type', observed=True) ['Watch_Time_Hours'].sum() print(f'\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:\\n{watch_hours}')<\/code><\/pre>\n<p>output:<br \/> \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:<br \/> Subscription_Type<br \/> Basic           28594802.53<br \/> Premium     26518708.16<br \/> Standard     27210667.60<br \/> Name: Watch_Time_Hours, dtype: float64<\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <strong>.groupby()<\/strong> \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Subscription_Type&#8217;, \u0430 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0441\u0443\u043c\u043c\u0443 \u043f\u043e \u0447\u0430\u0441\u0430\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u0432\u0438\u0434\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 &#8216;Basic&#8217; \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0444\u0438\u043b\u044c\u043c\u044b \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h3>3. \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<h4>3.1 \u0413\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h4>\n<pre><code>sns.histplot(rating_user['Age'], bins = 10, kde = True, color='pink') plt.title('\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439') plt.show()<\/code><\/pre>\n<p>C \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>sns.hisplot()<\/strong> \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/> ![Alt \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439(\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_1.png)<\/p>\n<h4>3.2 \u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0438\u0432\u0443\u044e \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430:<\/p>\n<pre><code>sns.kdeplot(rating_user['Rating'], color='blue', fill=True) plt.title('\u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430') plt.show()<\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_2.png\" alt=\"Alt \u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430\" data-src=\"\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_2.png\"\/><\/p>\n<div><figcaption>Alt \u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043b\u043e\u043d\u043d\u044b \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u043c\u0430\u043c \u043e\u0446\u0435\u043d\u043a\u0443 &#8216;4&#8217;.<\/p>\n<h4>3.3 \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c<\/h4>\n<p>\u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0438 \u0442\u0438\u043f\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:<\/p>\n<pre><code>subscription_counts = rating_user.groupby(['Age_Group', 'Subscription_Type'], observed=True).size().reset_index(name='Count') print(subscription_counts)<\/code><\/pre>\n<p>output:<br \/> Age_Group Subscription_Type  Count<br \/> 0      18-30             Basic      8753<br \/> 1      18-30           Premium   9662<br \/> 2      18-30          Standard   8254<br \/> 3      30-45             Basic      14185<br \/> 4      30-45           Premium  11211<br \/> 5      30-45          Standard   11167<br \/> 6      45-60             Basic      11977<br \/> 7      45-60           Premium  12598<br \/> 8      45-60          Standard  12310<br \/> 9      60-90             Basic      17929<br \/> 10     60-90           Premium  14991<br \/> 11     60-90          Standard   16373<\/p>\n<p>\u0411\u044b\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0432\u0443\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c: &#8216;Age_Group&#8217; \u0438 &#8216;Subscription_Type&#8217;. \u041c\u0435\u0442\u043e\u0434 <strong>.size()<\/strong> \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u0440\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 &#8216;Age_Group&#8217; \u0438 &#8216;Subscription_Type&#8217; \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432. \u041c\u0435\u0442\u043e\u0434 <strong>.reset_index()<\/strong> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 DataFrame. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>name=&#8217;Count&#8217;<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u043d\u043e\u0432\u043e\u043c\u0443 \u0441\u0442\u043e\u043b\u0431\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 &#8216;Age_Group&#8217; \u0438 &#8216;Subscription_Type&#8217;.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b barplot:<br \/> sns.barplot(x=&#8217;Age_Group&#8217;, y=&#8217;Count&#8217;, hue=&#8217;Subscription_Type&#8217;,<br \/> data=subscription_counts, palette=&#8217;viridis&#8217;)<br \/> plt.title(&#8216;\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c&#8217;)<br \/> plt.xlabel(&#8216;\u0412\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430&#8217;)<br \/> plt.ylabel(&#8216;\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a&#8217;)<br \/> plt.legend(title=&#8217;\u0422\u0438\u043f \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438&#8217;)<br \/> plt.show() <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_3.png\" alt=\"Alt \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c\" data-src=\"\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_3.png\"\/><\/p>\n<div><figcaption>Alt \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e \u043e\u0441\u0438 \u0430\u0431\u0441\u0446\u0438\u0441\u0441 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430, \u043f\u043e \u043e\u0441\u0438 \u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432. \u0418\u0437 \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u0438\u0441\u0442\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043e\u0442 18 \u0434\u043e 30 \u043b\u0435\u0442 \u0447\u0430\u0449\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 Premium, \u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u0448\u0435\u0433\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 Basic.<\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 python \u0438 \u0435\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u043f\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0443\u0436\u0434.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/894530\/\"> https:\/\/habr.com\/ru\/articles\/894530\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043d\u0430\u0431\u043e\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Python \u0432\u0437\u044f\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440\u0430, \u043e \u0444\u0438\u043b\u044c\u043c\u0430\u0445 \u0438 \u0438\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435. \u0411\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: Pandas, Numpy \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 Seaborn \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h3>1. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<h4>1.1 \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>import<\/strong>:<\/p>\n<pre><code>import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0440\u0438 \u0434\u0430\u0442\u0430 \u0441\u0435\u0442\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0444\u0438\u043b\u044c\u043c\u0430\u0445, \u0438\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>pd.read_csv<\/strong> \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 DataFrame:<\/p>\n<pre><code>movies_data = pd.read_csv('Dataset_Movie.csv') ratings = pd.read_csv('Rating.csv') users = pd.read_csv('users.csv')<\/code><\/pre>\n<h4>1.2 \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 DataFrame \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/h4>\n<p>\u0411\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c DataFrame \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <strong>.isnull().sum()<\/strong>.<br \/> \u041c\u0435\u0442\u043e\u0434 <strong>isnull()<\/strong> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 DataFrame \u0442\u043e\u0439 \u0436\u0435 \u0444\u043e\u0440\u043c\u044b, \u043d\u043e \u0441 \u0431\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <em>True<\/em> \u0438\u043b\u0438 <em>False<\/em>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <em>True<\/em> \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a <strong>1<\/strong>, \u0430 <em>False<\/em> \u043a\u0430\u043a <strong>0<\/strong>, \u0441\u0443\u043c\u043c\u0430 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435.<\/p>\n<pre><code>print(ratings.isnull().sum())<\/code><\/pre>\n<p>output:<\/p>\n<p>User_ID 0<br \/> Rating 0<br \/> Movie_ID 0<\/p>\n<h4>1.3 \u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 DataFrame \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<pre><code>ratings['Rating'] = ratings['Rating'].fillna(ratings['Rating'].mean()) users['Age'] = users['Age'].fillna(users['Age'].median())<\/code><\/pre>\n<p>\u0411\u044b\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043c\u0435\u0442\u043e\u0434 <strong>.fillna()<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Rating&#8217; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Rating&#8217; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.mean()<\/strong>.<br \/> \u0414\u043b\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Age&#8217; \u043f\u0443\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043c\u0435\u0434\u0438\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.median()<\/strong><\/p>\n<h4>1.4 \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446<\/h4>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043b\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0434\u0438\u043d DataFrame.<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>pd.merge()<\/strong>, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u0435c\u0442\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f DataFrame \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.head()<\/strong>, \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code>merged_df = pd.merge(movies_data, ratings, on = 'Movie_ID') rating_user = pd.merge(users, merged_df, on = 'User_ID') print(rating_user.head())<\/code><\/pre>\n<h3>2. \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h3>\n<h4>2.1 \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440<\/h4>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<pre><code>rating_user = rating_user.assign(Genres=rating_user['Favorite_Genre'].str.split('|')).explode('Favorite_Genre') most_popular_genre = rating_user['Favorite_Genre'].value_counts().idxmax() print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:\\n{most_popular_genre}')<\/code><\/pre>\n<p>C\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Favorite_Genre&#8217;, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0435 \u043e\u0434\u0438\u043d \u0436\u0430\u043d\u0440. \u0417\u0430\u0442\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.value_counts()<\/strong> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0436\u0430\u043d\u0440\u0430, \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <strong>.idmax()<\/strong><\/p>\n<h4>2.2 \u0421\u0430\u043c\u044b\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u043c\u044b \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435:<\/p>\n<pre><code>rating_user['Age_Group'] = pd.cut(rating_user['Age'],  bins = [18,30,45,60,90],  labels= ['18-30', '30-45', '45-60', '60-90'])<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8216;Age_Group&#8217;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 <strong>pd.cut()<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b (<em>bins<\/em>) \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u044b (<em>labels<\/em>).<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u043c\u0435\u0442\u043e\u0434 <strong>pd.pivot_table<\/strong>, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430: \u043f\u043e \u043e\u0441\u0438 <em>\u0430\u0431\u0441\u0446\u0438\u0441\u0441<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Favorite_Genre&#8217;, \u043f\u043e \u043e\u0441\u0438 <em>\u043e\u0440\u0434\u0438\u043d\u0430\u0442<\/em> &#8212; \u0438\u0437 &#8216;Age_Group&#8217;. \u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u043e\u043b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433<\/em> \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0436\u0430\u043d\u0440\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u043e \u0434\u0432\u0443\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code>popular_genre = pivot.idxmax(axis=0) popular_genre_df = popular_genre.reset_index() popular_genre_df.columns = ['Age_Group', 'Most_Popular_Genre'] print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b:\\n{popular_genre_df}')<\/code><\/pre>\n<p>output:<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b:<br \/> Age_Group Most_Popular_Genre<br \/> 0     18-30             Action<br \/> 1      30-45            Drama<br \/> 2     45-60            Romance<br \/> 3     60-90            Horror<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 DataFrame <strong>popular_genre_df<\/strong> \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 &#8216;Age_Group&#8217; \u0438 &#8216;Most_Popular_Genre&#8217;. \u0411\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <em>.idmax(axis = 0)<\/em> (axis = 0 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c).<\/p>\n<h4>2.3 \u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435<\/h4>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043b\u044e\u0434\u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u0438 \u0444\u0438\u043b\u044c\u043c\u044b \u0437\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439:<\/p>\n<pre><code>bins1=[1960, 1970, 1980, 1990, 2000]<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 &#8216;Age_Group&#8217;, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 &#8216;Decade&#8217;:<\/p>\n<pre><code>rating_user['Decade'] = pd.cut(     rating_user['Year'],     bins=bins1,     right=False,     labels=[f'{bins1[i]}' for i in range(len(bins1) - 1)])<\/code><\/pre>\n<p>\u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 &#8216;Decade&#8217;, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433:<\/p>\n<pre><code>avg_rating_by_year = round(rating_user.groupby('Decade', observed = True)['Rating'].mean(),2) print(f'\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435:\\n{avg_rating_by_year}')<\/code><\/pre>\n<p>output:<br \/> Decade<br \/> 1960     3.74<br \/> 1970     3.76<br \/> 1980     3.62<br \/> 1990     3.61<br \/> \u041a\u0430\u043a \u0438\u0442\u043e\u0433: \u0432 \u0441\u0435\u043c\u0438\u0434\u0435\u0441\u044f\u0442\u044b\u0435 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0444\u0438\u043b\u044c\u043c\u044b \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u043c.<\/p>\n<h4>2.4 \u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h4>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a python \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0443, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e.<\/p>\n<pre><code>country_most_users = rating_user['Country'].value_counts().idxmax() print(f'\u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:\\n{country_most_users}')<\/code><\/pre>\n<p>output:<br \/> \u0421\u0442\u0440\u0430\u043d\u0430 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<br \/> Germany<br \/> \u041c\u0435\u0442\u043e\u0434\u043e\u043c <strong>value_counts().idmax()<\/strong> \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043e\u0439 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h4>2.5 \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435<\/h4>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0444\u0438\u043b\u044c\u043c\u044b \u043a\u0430\u043a\u043e\u0433\u043e \u0436\u0430\u043d\u0440\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:<\/p>\n<pre><code>top_genre_by_country = rating_user.groupby('Country') ['Favorite_Genre'].apply(lambda x: x.mode()[0]) print(f'\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:\\n {top_genre_by_country}')<\/code><\/pre>\n<p>output:<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0436\u0430\u043d\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435:<br \/> Country<br \/> Australia        Romance<br \/> Brazil             Romance<br \/> Canada          Documentary<br \/> France           Drama<br \/> Germany       Drama<br \/> India              Horror<br \/> Japan            Documentary<br \/> Mexico          Romance<br \/> UK                 Documentary<br \/> USA               Romance<br \/> Name: Favorite_Genre, dtype: object<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044f (<em>lambda<\/em>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Favorite_Genre&#8217; \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0430\u043c\u044b\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>.mode()<\/strong>. \u041c\u0435\u0442\u043e\u0434 .mode() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e.<br \/> \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e [0].<\/p>\n<h4>2.6 \u041e\u0442\u0431\u043e\u0440 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u0441 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435 4.5<\/h4>\n<pre><code>top_movies = rating_user[rating_user['Rating'] &gt; 4.5][['Movie_ID', 'Rating']]<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043e\u0442\u0431\u043e\u0440\u0435 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430 \u0431\u0443\u043b\u0435\u0432\u0430\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u0438 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430: \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d DataFrame c \u0431\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <strong>[&#8216;Rating&#8217;] &gt; 4.5<\/strong>.<br \/> \u041f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043e\u043b\u043e\u043d\u043a\u0438 &#8216;Movie_ID&#8217; \u0438 &#8216;Rating&#8217; \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>2.7 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438<\/h4>\n<pre><code>watch_hours = rating_user.groupby('Subscription_Type', observed=True) ['Watch_Time_Hours'].sum() print(f'\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:\\n{watch_hours}')<\/code><\/pre>\n<p>output:<br \/> \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0447\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:<br \/> Subscription_Type<br \/> Basic           28594802.53<br \/> Premium     26518708.16<br \/> Standard     27210667.60<br \/> Name: Watch_Time_Hours, dtype: float64<\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <strong>.groupby()<\/strong> \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 &#8216;Subscription_Type&#8217;, \u0430 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0441\u0443\u043c\u043c\u0443 \u043f\u043e \u0447\u0430\u0441\u0430\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u0432\u0438\u0434\u043e\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 &#8216;Basic&#8217; \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0444\u0438\u043b\u044c\u043c\u044b \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h3>3. \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<h4>3.1 \u0413\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h4>\n<pre><code>sns.histplot(rating_user['Age'], bins = 10, kde = True, color='pink') plt.title('\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439') plt.show()<\/code><\/pre>\n<p>C \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <strong>sns.hisplot()<\/strong> \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/> ![Alt \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439(\/Users\/grigorovakarina\/Documents\/GitHub\/Project1\/Figure_1.png)<\/p>\n<h4>3.2 \u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0438\u0432\u0443\u044e \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430:<\/p>\n<pre><code>sns.kdeplot(rating_user['Rating'], color='blue', fill=True) plt.title('\u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430') plt.show()<\/code><\/pre>\n<figure class=\"\">\n<div><figcaption>Alt \u041a\u0440\u0438\u0432\u0430\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043b\u043e\u043d\u043d\u044b \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u043c\u0430\u043c \u043e\u0446\u0435\u043d\u043a\u0443 &#8216;4&#8217;.<\/p>\n<h4>3.3 \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0430\u043c<\/h4>\n<p>\u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0438 \u0442\u0438\u043f\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438:<\/p>\n<pre><code>subscription_counts = rating_user.groupby(['Age_Group', 'Subscription_Type'], observed=True).size().reset_index(name='Count') print(subscription_counts)<\/code><\/pre>\n<p>output:<br \/> Age_Group Subscription_Type  Count<br \/> 0      18-30             Basic      8753<br \/> 1      18-30           Premium   9662<br \/> 2      18-30          Standard   8254<br \/> 3      30-45             Basic      14185<br \/> 4      30-45           Premium  11211<br \/> 5      30-45          Standard   11167<br \/> 6      45-60             Basic      11977<br \/> 7      45-60           Premium  12598<br \/> 8      45-60          Standard  12310<br \/> 9      60-90             Basic      17929<br \/> 10     60-90           Premium  14991<br \/> 11     60-90          Standard   16373<\/p>\n<p>\u0411\u044b\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0432\u0443\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c: &#8216;Age_Group&#8217; \u0438 &#8216;Subscription_Type&#8217;. \u041c\u0435\u0442\u043e\u0434 <strong>.size()<\/strong> \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u0440\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 &#8216;Age_Group&#8217; \u0438 &#8216;Subscription_Type&#8217; \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432. \u041c\u0435\u0442\u043e\u0434 <strong>.reset_index()<\/strong><\/p>\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-453402","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/453402","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=453402"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/453402\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}