{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom pandas_profiling import ProfileReport\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-01-17T07:54:40.598786Z","iopub.execute_input":"2023-01-17T07:54:40.599962Z","iopub.status.idle":"2023-01-17T07:54:43.659681Z","shell.execute_reply.started":"2023-01-17T07:54:40.599921Z","shell.execute_reply":"2023-01-17T07:54:43.658193Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('/kaggle/input/goodreads-books-reviews-290312/goodreads_train.csv')","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:54:43.661634Z","iopub.execute_input":"2023-01-17T07:54:43.662316Z","iopub.status.idle":"2023-01-17T07:55:14.900860Z","shell.execute_reply.started":"2023-01-17T07:54:43.662276Z","shell.execute_reply":"2023-01-17T07:55:14.899470Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.describe()","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:14.902431Z","iopub.execute_input":"2023-01-17T07:55:14.903394Z","iopub.status.idle":"2023-01-17T07:55:15.083256Z","shell.execute_reply.started":"2023-01-17T07:55:14.903350Z","shell.execute_reply":"2023-01-17T07:55:15.081835Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:15.086753Z","iopub.execute_input":"2023-01-17T07:55:15.087146Z","iopub.status.idle":"2023-01-17T07:55:15.471840Z","shell.execute_reply.started":"2023-01-17T07:55:15.087110Z","shell.execute_reply":"2023-01-17T07:55:15.470863Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"missing_values = df.isnull().sum()\nprint(missing_values)","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:15.473249Z","iopub.execute_input":"2023-01-17T07:55:15.473620Z","iopub.status.idle":"2023-01-17T07:55:15.841014Z","shell.execute_reply.started":"2023-01-17T07:55:15.473590Z","shell.execute_reply":"2023-01-17T07:55:15.839744Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(df.shape)","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:15.842463Z","iopub.execute_input":"2023-01-17T07:55:15.842850Z","iopub.status.idle":"2023-01-17T07:55:15.848223Z","shell.execute_reply.started":"2023-01-17T07:55:15.842809Z","shell.execute_reply":"2023-01-17T07:55:15.847313Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"corr = df.corr()\nsns.heatmap(corr, annot=True)","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:15.849466Z","iopub.execute_input":"2023-01-17T07:55:15.850140Z","iopub.status.idle":"2023-01-17T07:55:16.166301Z","shell.execute_reply.started":"2023-01-17T07:55:15.850106Z","shell.execute_reply":"2023-01-17T07:55:16.165055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.displot(df['rating'], kde=False)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:16.167841Z","iopub.execute_input":"2023-01-17T07:55:16.168218Z","iopub.status.idle":"2023-01-17T07:55:17.347405Z","shell.execute_reply.started":"2023-01-17T07:55:16.168182Z","shell.execute_reply":"2023-01-17T07:55:17.346258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.scatterplot(x='n_votes', y='rating', data=df)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:17.349279Z","iopub.execute_input":"2023-01-17T07:55:17.349714Z","iopub.status.idle":"2023-01-17T07:55:18.741575Z","shell.execute_reply.started":"2023-01-17T07:55:17.349677Z","shell.execute_reply":"2023-01-17T07:55:18.740650Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(df.loc[df['rating'] > 5])","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:18.744398Z","iopub.execute_input":"2023-01-17T07:55:18.744984Z","iopub.status.idle":"2023-01-17T07:55:18.753824Z","shell.execute_reply.started":"2023-01-17T07:55:18.744945Z","shell.execute_reply":"2023-01-17T07:55:18.752763Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(df.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:18.755279Z","iopub.execute_input":"2023-01-17T07:55:18.755946Z","iopub.status.idle":"2023-01-17T07:55:18.770079Z","shell.execute_reply.started":"2023-01-17T07:55:18.755909Z","shell.execute_reply":"2023-01-17T07:55:18.768948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:18.772557Z","iopub.execute_input":"2023-01-17T07:55:18.773099Z","iopub.status.idle":"2023-01-17T07:55:18.786098Z","shell.execute_reply.started":"2023-01-17T07:55:18.772931Z","shell.execute_reply":"2023-01-17T07:55:18.784637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(df.review_id.unique())","metadata":{"execution":{"iopub.status.busy":"2023-01-17T07:55:18.787707Z","iopub.execute_input":"2023-01-17T07:55:18.788134Z","iopub.status.idle":"2023-01-17T07:55:19.033141Z","shell.execute_reply.started":"2023-01-17T07:55:18.788083Z","shell.execute_reply":"2023-01-17T07:55:19.031851Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_frac = df.sample(frac = 0.001, replace = False, random_state = 123)","metadata":{"execution":{"iopub.status.busy":"2023-01-17T08:00:39.106584Z","iopub.execute_input":"2023-01-17T08:00:39.107034Z","iopub.status.idle":"2023-01-17T08:00:39.152532Z","shell.execute_reply.started":"2023-01-17T08:00:39.106996Z","shell.execute_reply":"2023-01-17T08:00:39.151326Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_frac.shape","metadata":{"execution":{"iopub.status.busy":"2023-01-17T08:00:41.515472Z","iopub.execute_input":"2023-01-17T08:00:41.516953Z","iopub.status.idle":"2023-01-17T08:00:41.525159Z","shell.execute_reply.started":"2023-01-17T08:00:41.516891Z","shell.execute_reply":"2023-01-17T08:00:41.524055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"profile = ProfileReport(df_frac)\nprofile","metadata":{"execution":{"iopub.status.busy":"2023-01-17T08:01:14.298875Z","iopub.execute_input":"2023-01-17T08:01:14.299348Z","iopub.status.idle":"2023-01-17T08:01:33.554623Z","shell.execute_reply.started":"2023-01-17T08:01:14.299307Z","shell.execute_reply":"2023-01-17T08:01:33.553180Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}