{"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":"import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sb\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:40:23.871694Z","iopub.execute_input":"2022-03-15T03:40:23.871965Z","iopub.status.idle":"2022-03-15T03:40:24.89699Z","shell.execute_reply.started":"2022-03-15T03:40:23.871891Z","shell.execute_reply":"2022-03-15T03:40:24.896238Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles =pd.read_csv(\"../input/h-and-m-personalized-fashion-recommendations/articles.csv\")\ncustomers =pd.read_csv(\"../input/h-and-m-personalized-fashion-recommendations/customers.csv\")\ntransactions_train =pd.read_csv(\"../input/h-and-m-personalized-fashion-recommendations/transactions_train.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:40:24.898364Z","iopub.execute_input":"2022-03-15T03:40:24.898567Z","iopub.status.idle":"2022-03-15T03:41:38.285978Z","shell.execute_reply.started":"2022-03-15T03:40:24.898538Z","shell.execute_reply":"2022-03-15T03:41:38.284932Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles.head()\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:41:38.33903Z","iopub.execute_input":"2022-03-15T03:41:38.339253Z","iopub.status.idle":"2022-03-15T03:41:38.361977Z","shell.execute_reply.started":"2022-03-15T03:41:38.339223Z","shell.execute_reply":"2022-03-15T03:41:38.361234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:47:12.788346Z","iopub.execute_input":"2022-03-15T03:47:12.788744Z","iopub.status.idle":"2022-03-15T03:47:12.803954Z","shell.execute_reply.started":"2022-03-15T03:47:12.788714Z","shell.execute_reply":"2022-03-15T03:47:12.803294Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-06T02:31:41.49171Z","iopub.execute_input":"2022-03-06T02:31:41.492397Z","iopub.status.idle":"2022-03-06T02:31:41.507608Z","shell.execute_reply.started":"2022-03-06T02:31:41.492356Z","shell.execute_reply":"2022-03-06T02:31:41.506676Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-05T17:02:34.400365Z","iopub.execute_input":"2022-03-05T17:02:34.40072Z","iopub.status.idle":"2022-03-05T17:02:34.407873Z","shell.execute_reply.started":"2022-03-05T17:02:34.400686Z","shell.execute_reply":"2022-03-05T17:02:34.406892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-05T17:02:55.063253Z","iopub.execute_input":"2022-03-05T17:02:55.063596Z","iopub.status.idle":"2022-03-05T17:02:55.070294Z","shell.execute_reply.started":"2022-03-05T17:02:55.063563Z","shell.execute_reply":"2022-03-05T17:02:55.069417Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-05T17:03:25.983698Z","iopub.execute_input":"2022-03-05T17:03:25.984221Z","iopub.status.idle":"2022-03-05T17:03:25.991085Z","shell.execute_reply.started":"2022-03-05T17:03:25.984174Z","shell.execute_reply":"2022-03-05T17:03:25.989988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers.dtypes","metadata":{"execution":{"iopub.status.busy":"2022-03-05T17:04:06.4376Z","iopub.execute_input":"2022-03-05T17:04:06.438791Z","iopub.status.idle":"2022-03-05T17:04:06.449043Z","shell.execute_reply.started":"2022-03-05T17:04:06.438721Z","shell.execute_reply":"2022-03-05T17:04:06.447888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers.club_member_status.unique()","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:45:12.277635Z","iopub.execute_input":"2022-03-15T03:45:12.277906Z","iopub.status.idle":"2022-03-15T03:45:12.376806Z","shell.execute_reply.started":"2022-03-15T03:45:12.277875Z","shell.execute_reply":"2022-03-15T03:45:12.376092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y =pd.cut(customers['age'], bins=8)\na = customers['age'].groupby(y).count().reset_index(name=\"count\")\na\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:45:17.506852Z","iopub.execute_input":"2022-03-15T03:45:17.507098Z","iopub.status.idle":"2022-03-15T03:45:17.576423Z","shell.execute_reply.started":"2022-03-15T03:45:17.507071Z","shell.execute_reply":"2022-03-15T03:45:17.575528Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sb.barplot(data = a, x = 'age', y ='count')\nplt.xticks(rotation=70)","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:45:24.966626Z","iopub.execute_input":"2022-03-15T03:45:24.96688Z","iopub.status.idle":"2022-03-15T03:45:25.159301Z","shell.execute_reply.started":"2022-03-15T03:45:24.966852Z","shell.execute_reply":"2022-03-15T03:45:25.158433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Percentage of active members = 33.8","metadata":{}},{"cell_type":"code","source":"w =((customers['Active'].value_counts())*100)/customers.shape[0]\nw\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:45:32.157643Z","iopub.execute_input":"2022-03-15T03:45:32.157886Z","iopub.status.idle":"2022-03-15T03:45:32.179933Z","shell.execute_reply.started":"2022-03-15T03:45:32.157859Z","shell.execute_reply":"2022-03-15T03:45:32.179066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Percentage of not active members =66.15","metadata":{}},{"cell_type":"code","source":"\n\nsb.countplot(x=\"Active\",data=customers,hue=\"club_member_status\")\n\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:47:25.291982Z","iopub.execute_input":"2022-03-15T03:47:25.292705Z","iopub.status.idle":"2022-03-15T03:47:26.038684Z","shell.execute_reply.started":"2022-03-15T03:47:25.292677Z","shell.execute_reply":"2022-03-15T03:47:26.037867Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":" u =(customers['Active'].isna().sum()*100)/customers.shape[0]\nu","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:45:41.927718Z","iopub.execute_input":"2022-03-15T03:45:41.928319Z","iopub.status.idle":"2022-03-15T03:45:41.937839Z","shell.execute_reply.started":"2022-03-15T03:45:41.928286Z","shell.execute_reply":"2022-03-15T03:45:41.936745Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new = sb.countplot(data=articles,x=\"product_group_name\")\nnew.tick_params(axis='x', rotation=90)","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:42:54.317399Z","iopub.execute_input":"2022-03-15T03:42:54.317671Z","iopub.status.idle":"2022-03-15T03:42:54.625398Z","shell.execute_reply.started":"2022-03-15T03:42:54.317643Z","shell.execute_reply":"2022-03-15T03:42:54.624624Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\ng = sb.histplot(data=customers,x=\"age\")\n\n","metadata":{"execution":{"iopub.status.busy":"2022-03-15T03:44:27.667196Z","iopub.execute_input":"2022-03-15T03:44:27.668129Z","iopub.status.idle":"2022-03-15T03:44:28.333903Z","shell.execute_reply.started":"2022-03-15T03:44:27.668101Z","shell.execute_reply":"2022-03-15T03:44:28.332906Z"},"trusted":true},"execution_count":null,"outputs":[]}]}