{"id":471917,"date":"2025-08-23T21:00:41","date_gmt":"2025-08-23T21:00:41","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471917"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471917","title":{"rendered":"<span>\u041b\u0438\u0447\u043d\u044b\u0439 \u0442\u043e\u043f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Pandas<\/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>Pandas \u2014 \u044d\u0442\u043e \u0438\u0437\u0443\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430 Python \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u0430, \u0447\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u0433\u043e \u043e\u043d\u0430 <em>\u043d\u0435 \u0443\u043c\u0435\u0435\u0442<\/em>, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0412 \u043c\u0438\u0440\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 <strong>\u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436<\/strong>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0447\u043d\u044b\u043c \u0442\u043e\u043f\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432 <strong>\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043f\u043e \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0438\u043d\u0434\u0438\u0439\u0441\u043a\u043e\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \u0425\u0430\u0439\u0434\u0430\u0440\u0430\u0431\u0430\u0434 (CSV \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/drive.google.com\/file\/d\/1X5dn5wFR8w6Y1kjwPGPgiQ67NDg9WcCa\/view\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>).<\/p>\n<pre><code class=\"python\">import pandas as pd    # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 data = pd.read_csv(r'\u0432\u0430\u0448_\u043f\u0443\u0442\u044c_\u043a_\u0444\u0430\u0439\u043b\u0443\\Hyderabad.csv')  # \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 data.head(10) data.tail(10)  # \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a data.columns <\/code><\/pre>\n<p><strong> 1. \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437: \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b  <\/strong><\/p>\n<pre><code class=\"python\">mean_price = data['Price'].mean()     # \u0441\u0440\u0435\u0434\u043d\u0435\u0435 max_price = data['Price'].max()       # \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c min_price = data['Price'].min()       # \u043c\u0438\u043d\u0438\u043c\u0443\u043c sum_price = data['Price'].sum()       # \u0441\u0443\u043c\u043c\u0430 std_price = data['Price'].std()       # \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 median_price = data['Price'].median() # \u043c\u0435\u0434\u0438\u0430\u043d\u0430 count_data = data['Price'].count()    # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/code><\/pre>\n<p> \u0418 \u043c\u0435\u0433\u0430-\u043c\u0435\u0442\u043e\u0434:  <\/p>\n<pre><code class=\"python\">data['Price'].describe()<\/code><\/pre>\n<h4>2. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/h4>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0432 Pandas \u0443\u0434\u043e\u0431\u043d\u0430, \u043d\u043e \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438: \u0432\u043c\u0435\u0441\u0442\u043e <code>and\/or\/not<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <code>&amp;<\/code>, <code>|<\/code>, <code>~<\/code>.<\/p>\n<pre><code class=\"python\"># \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c Madhapur data[data['Location'] != 'Madhapur']  # \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 data[(data['Location'] != 'Madhapur') &amp; (data['Price'] &lt; 3_000_000)]  # \u0441 \u0431\u0430\u0441\u0441\u0435\u0439\u043d\u043e\u043c \u0438 \u0441\u043f\u043e\u0440\u0442\u0437\u0430\u043b\u043e\u043c data[(data['SwimmingPool'] == 1) &amp; (data['Gymnasium'] == 1)]<\/code><\/pre>\n<p><strong> 3. \u041f\u043e\u0438\u0441\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u044b  <\/strong><\/p>\n<pre><code class=\"python\">filtered = data[(data['SwimmingPool'] == 1) &amp; (data['Gymnasium'] == 1)] min_house = filtered[filtered['Price'] == filtered['Price'].min()]<\/code><\/pre>\n<p> \ud83d\udc49 \u0422\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u0434\u0435\u0448\u0451\u0432\u044b\u0439 \u0434\u043e\u043c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438.  <\/p>\n<p><strong> 4. GroupBy  <\/strong><\/p>\n<p> \u041c\u0435\u0442\u043e\u0434 <code>groupby<\/code> \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0432 Pandas (\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 SQL).  <\/p>\n<pre><code class=\"python\"># \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0446\u0435\u043d\u044b \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0438 data.groupby('Location')['Price'].max()  # \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 data.groupby('Location')['Price'].agg(['max', 'min', 'mean', 'median'])<\/code><\/pre>\n<p><strong> 5. Between \u0438 isin  <\/strong><\/p>\n<pre><code class=\"python\"># \u0446\u0435\u043d\u044b \u043c\u0435\u0436\u0434\u0443 10 \u0438 50 \u043c\u043b\u043d data[data['Price'].between(10_000_000, 50_000_000)]  # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 data[data['Location'].isin(['Delhi', 'Mumbai'])]<\/code><\/pre>\n<p><strong> 6. \u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b  <\/strong><\/p>\n<pre><code class=\"python\"># \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f data['No. of Bedrooms'].unique()  # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 data['Location'].nunique()  # \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 data['Location'].value_counts()  # \u043f\u043e\u0438\u0441\u043a \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 data['Location'].duplicated()  # \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 data['Location'].drop_duplicates()<\/code><\/pre>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>\u0412\u043e\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0447\u0435\u043a-\u043b\u0438\u0441\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Pandas:<\/p>\n<ul>\n<li>\n<p>\ud83d\udcca <code>mean(), max(), min(), sum(), std(), median(), describe()<\/code> \u2014 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\ud83d\udd0e <code>[]<\/code>, <code>&amp; | ~<\/code> \u2014 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\ud83c\udff7 <code>groupby(), agg()<\/code> \u2014 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\ud83d\udcd0 <code>between(), isin()<\/code> \u2014 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c<\/p>\n<\/li>\n<li>\n<p>\ud83c\udfad <code>unique(), value_counts(), nunique()<\/code> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\ud83d\udd04 <code>duplicated(), drop_duplicates()<\/code> \u2014 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<p> \ud83d\udc49 Pandas \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0430 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u2014 \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u043e \u0434\u0430\u0436\u0435 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c CSV-\u0444\u0430\u0439\u043b \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a.  <\/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\/940028\/\"> https:\/\/habr.com\/ru\/articles\/940028\/<\/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>Pandas \u2014 \u044d\u0442\u043e \u0438\u0437\u0443\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430 Python \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u0430, \u0447\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u0433\u043e \u043e\u043d\u0430 <em>\u043d\u0435 \u0443\u043c\u0435\u0435\u0442<\/em>, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0412 \u043c\u0438\u0440\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 <strong>\u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436<\/strong>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0447\u043d\u044b\u043c \u0442\u043e\u043f\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0432 <strong>\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043f\u043e \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0438\u043d\u0434\u0438\u0439\u0441\u043a\u043e\u043c \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \u0425\u0430\u0439\u0434\u0430\u0440\u0430\u0431\u0430\u0434 (CSV \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/drive.google.com\/file\/d\/1X5dn5wFR8w6Y1kjwPGPgiQ67NDg9WcCa\/view\" rel=\"noopener noreferrer nofollow\">\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>).<\/p>\n<pre><code class=\"python\">import pandas as pd    # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 data = pd.read_csv(r'\u0432\u0430\u0448_\u043f\u0443\u0442\u044c_\u043a_\u0444\u0430\u0439\u043b\u0443\\Hyderabad.csv')  # \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 data.head(10) data.tail(10)  # \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a data.columns <\/code><\/pre>\n<p><strong> 1. \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437: \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b  <\/strong><\/p>\n<pre><code class=\"python\">mean_price = data['Price'].mean()     # \u0441\u0440\u0435\u0434\u043d\u0435\u0435 max_price = data['Price'].max()       # \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c min_price = data['Price'].min()       # \u043c\u0438\u043d\u0438\u043c\u0443\u043c sum_price = data['Price'].sum()       # \u0441\u0443\u043c\u043c\u0430 std_price = data['Price'].std()       # \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 median_price = data['Price'].median() # \u043c\u0435\u0434\u0438\u0430\u043d\u0430 count_data = data['Price'].count()    # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/code><\/pre>\n<p> \u0418 \u043c\u0435\u0433\u0430-\u043c\u0435\u0442\u043e\u0434:  <\/p>\n<pre><code class=\"python\">data['Price'].describe()<\/code><\/pre>\n<h4>2. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/h4>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0432 Pandas \u0443\u0434\u043e\u0431\u043d\u0430, \u043d\u043e \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438: \u0432\u043c\u0435\u0441\u0442\u043e <code>and\/or\/not<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <code>&amp;<\/code>, <code>|<\/code>, <code>~<\/code>.<\/p>\n<pre><code class=\"python\"># \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c Madhapur data[data['Location'] != 'Madhapur']  # \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 data[(data['Location'] != 'Madhapur') &amp; (data['Price'] &lt; 3_000_000)]  # \u0441 \u0431\u0430\u0441\u0441\u0435\u0439\u043d\u043e\u043c \u0438 \u0441\u043f\u043e\u0440\u0442\u0437\u0430\u043b\u043e\u043c data[(data['SwimmingPool'] == 1) &amp; (data['Gymnasium'] == 1)]<\/code><\/pre>\n<p><strong> 3. \u041f\u043e\u0438\u0441\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u044b  <\/strong><\/p>\n<pre><code class=\"python\">filtered = data[(data['SwimmingPool'] == 1) &amp; (data['Gymnasium'] == 1)] min_house = filtered[filtered['Price'] == filtered['Price'].min()]<\/code><\/pre>\n<p> \ud83d\udc49 \u0422\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u0434\u0435\u0448\u0451\u0432\u044b\u0439 \u0434\u043e\u043c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438.  <\/p>\n<p><strong> 4. GroupBy  <\/strong><\/p>\n<p> \u041c\u0435\u0442\u043e\u0434 <code>groupby<\/code> \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0432 Pandas (\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 SQL).  <\/p>\n<pre><code class=\"python\"># \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0446\u0435\u043d\u044b \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0438 data.groupby('Location')['Price'].max()  # \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 data.groupby('Location')['Price'].agg(['max', 'min', 'mean', 'median'])<\/code><\/pre>\n<p><strong> 5. Between \u0438 isin  <\/strong><\/p>\n<pre><code class=\"python\"># \u0446\u0435\u043d\u044b \u043c\u0435\u0436\u0434\u0443 10 \u0438 50 \u043c\u043b\u043d data[data['Price'].between(10_000_000, 50_000_000)]  # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 data[data['Location'].isin(['Delhi', 'Mumbai'])]<\/code><\/pre>\n<p><strong> 6. \u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b  <\/strong><\/p>\n<pre><code class=\"python\"># \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f data['No. of Bedrooms'].unique()  # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 data['Location'].nunique()  # \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 data['Location'].value_counts()  # \u043f\u043e\u0438\u0441\u043a \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 data['Location'].duplicated()  # \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 data['Location'].drop_duplicates()<\/code><\/pre>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>\u0412\u043e\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0447\u0435\u043a-\u043b\u0438\u0441\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Pandas:<\/p>\n<ul>\n<li>\n<p>\ud83d\udcca <code>mean(), max(), min(), sum(), std(), median(), describe()<\/code> \u2014 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\ud83d\udd0e <code>[]<\/code>, <code>&amp; | ~<\/code> \u2014 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\ud83c\udff7 <code>groupby(), agg()<\/code> \u2014 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\ud83d\udcd0 <code>between(), isin()<\/code> \u2014 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c<\/p>\n<\/li>\n<li>\n<p>\ud83c\udfad <code>unique(), value_counts(), nunique()<\/code> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\ud83d\udd04 <code>duplicated(), drop_duplicates()<\/code> \u2014 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b<\/p>\n<\/li>\n<\/ul>\n<p> \ud83d\udc49 Pandas \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0430 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u2014 \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u043e \u0434\u0430\u0436\u0435 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c CSV-\u0444\u0430\u0439\u043b \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a.  <\/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\/940028\/\"> https:\/\/habr.com\/ru\/articles\/940028\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-471917","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471917","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=471917"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471917\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}