|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 1, |
| 5 | + "execution_count": 2, |
6 | 6 | "metadata": {}, |
7 | | - "outputs": [], |
| 7 | + "outputs": [ |
| 8 | + { |
| 9 | + "name": "stderr", |
| 10 | + "output_type": "stream", |
| 11 | + "text": [ |
| 12 | + "/var/folders/5n/n97z4g557rs9lyv924z46dhc0000gn/T/ipykernel_30845/3479152577.py:7: DeprecationWarning: Please use `pearsonr` from the `scipy.stats` namespace, the `scipy.stats.stats` namespace is deprecated.\n", |
| 13 | + " from scipy.stats.stats import pearsonr\n" |
| 14 | + ] |
| 15 | + } |
| 16 | + ], |
8 | 17 | "source": [ |
9 | 18 | "#import all required packages..\n", |
10 | 19 | "\n", |
|
18 | 27 | }, |
19 | 28 | { |
20 | 29 | "cell_type": "code", |
21 | | - "execution_count": 2, |
| 30 | + "execution_count": 3, |
22 | 31 | "metadata": {}, |
23 | 32 | "outputs": [], |
24 | 33 | "source": [ |
|
32 | 41 | }, |
33 | 42 | { |
34 | 43 | "cell_type": "code", |
35 | | - "execution_count": 3, |
| 44 | + "execution_count": 4, |
36 | 45 | "metadata": {}, |
37 | 46 | "outputs": [ |
38 | 47 | { |
|
111 | 120 | "4 12882 110 4.5 1147195239" |
112 | 121 | ] |
113 | 122 | }, |
114 | | - "execution_count": 3, |
| 123 | + "execution_count": 4, |
115 | 124 | "metadata": {}, |
116 | 125 | "output_type": "execute_result" |
117 | 126 | } |
|
122 | 131 | }, |
123 | 132 | { |
124 | 133 | "cell_type": "code", |
125 | | - "execution_count": 4, |
| 134 | + "execution_count": 10, |
126 | 135 | "metadata": {}, |
127 | | - "outputs": [ |
128 | | - { |
129 | | - "name": "stderr", |
130 | | - "output_type": "stream", |
131 | | - "text": [ |
132 | | - "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:18: FutureWarning: 'movieId' is both an index level and a column label.\n", |
133 | | - "Defaulting to column, but this will raise an ambiguity error in a future version\n" |
134 | | - ] |
135 | | - } |
136 | | - ], |
| 136 | + "outputs": [], |
137 | 137 | "source": [ |
138 | 138 | "#Get movie rating count so it will be easy at end to rank movie when 2 movie get same rating....\n", |
139 | | - "#this is optional if you want can do it else skip this step.\n", |
| 139 | + "#this is optional if you want, you can do it, else skip this step.\n", |
140 | 140 | "\n", |
141 | 141 | "#1. take groupby with respect to movie and get mean avg of each movie. \n", |
142 | 142 | "movie_rating_count = Ratings.groupby('movieId')['rating'].count()\n", |
|
147 | 147 | "#3. change column name.\n", |
148 | 148 | "movie_rating_count.columns = ['rating_count']\n", |
149 | 149 | "\n", |
150 | | - "#4. create new column movieIUd\n", |
| 150 | + "#4. create new column movieId\n", |
151 | 151 | "movie_rating_count['movieId'] = movie_rating_count.index\n", |
152 | | - "movie_rating_count.reset_index(drop=True)\n", |
| 152 | + "movie_rating_count.reset_index(drop=True, inplace=True)\n", |
153 | 153 | "\n", |
154 | 154 | "#merging to Rating dataframe so we have collectively all information together..\n", |
155 | 155 | "Ratings = Ratings.merge(movie_rating_count,right_on='movieId',left_on='movieId')" |
|
1814 | 1814 | ] |
1815 | 1815 | }, |
1816 | 1816 | { |
| 1817 | + "attachments": {}, |
1817 | 1818 | "cell_type": "markdown", |
1818 | 1819 | "metadata": {}, |
1819 | 1820 | "source": [ |
|
2678 | 2679 | "name": "python", |
2679 | 2680 | "nbconvert_exporter": "python", |
2680 | 2681 | "pygments_lexer": "ipython3", |
2681 | | - "version": "3.6.7" |
| 2682 | + "version": "3.11.3" |
2682 | 2683 | } |
2683 | 2684 | }, |
2684 | 2685 | "nbformat": 4, |
|
0 commit comments