{"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","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:19:58.781626Z","iopub.execute_input":"2022-09-27T21:19:58.782048Z","iopub.status.idle":"2022-09-27T21:19:58.786682Z","shell.execute_reply.started":"2022-09-27T21:19:58.782012Z","shell.execute_reply":"2022-09-27T21:19:58.785647Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data=pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv')","metadata":{"execution":{"iopub.status.busy":"2022-09-27T19:49:45.266357Z","iopub.execute_input":"2022-09-27T19:49:45.266759Z","iopub.status.idle":"2022-09-27T19:49:46.455219Z","shell.execute_reply.started":"2022-09-27T19:49:45.266726Z","shell.execute_reply":"2022-09-27T19:49:46.454055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.head(10)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T19:49:58.297372Z","iopub.execute_input":"2022-09-27T19:49:58.297794Z","iopub.status.idle":"2022-09-27T19:49:58.327334Z","shell.execute_reply.started":"2022-09-27T19:49:58.297759Z","shell.execute_reply":"2022-09-27T19:49:58.326234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* **columns**","metadata":{}},{"cell_type":"code","source":"print(data.columns, len(data.columns))","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:53:54.601694Z","iopub.execute_input":"2022-09-27T21:53:54.603010Z","iopub.status.idle":"2022-09-27T21:53:54.609284Z","shell.execute_reply.started":"2022-09-27T21:53:54.602967Z","shell.execute_reply":"2022-09-27T21:53:54.608147Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.describe()","metadata":{"execution":{"iopub.status.busy":"2022-09-27T16:32:47.052792Z","iopub.execute_input":"2022-09-27T16:32:47.053343Z","iopub.status.idle":"2022-09-27T16:32:47.156836Z","shell.execute_reply.started":"2022-09-27T16:32:47.053296Z","shell.execute_reply":"2022-09-27T16:32:47.155458Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.info()","metadata":{"execution":{"iopub.status.busy":"2022-09-27T16:33:10.847525Z","iopub.execute_input":"2022-09-27T16:33:10.847872Z","iopub.status.idle":"2022-09-27T16:33:10.928150Z","shell.execute_reply.started":"2022-09-27T16:33:10.847842Z","shell.execute_reply":"2022-09-27T16:33:10.926678Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* ### **45k product name that belongs to 131 types that belong to 19 groups of products** ","metadata":{}},{"cell_type":"markdown","source":"* **product names**","metadata":{}},{"cell_type":"code","source":"product_name = data[\"prod_name\"]\nlen(data[\"prod_name\"])","metadata":{"execution":{"iopub.status.busy":"2022-09-27T19:52:44.763440Z","iopub.execute_input":"2022-09-27T19:52:44.763857Z","iopub.status.idle":"2022-09-27T19:52:44.771815Z","shell.execute_reply.started":"2022-09-27T19:52:44.763823Z","shell.execute_reply":"2022-09-27T19:52:44.770763Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"product_name = list(set(product_name))\nprint(\"number of items:\",len(product_name),\"\\n original_product names \\n\",product_name[:100])","metadata":{"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(data[\"prod_name\"].value_counts()[:30])","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:05:29.517294Z","iopub.execute_input":"2022-09-27T22:05:29.517757Z","iopub.status.idle":"2022-09-27T22:05:29.557260Z","shell.execute_reply.started":"2022-09-27T22:05:29.517693Z","shell.execute_reply":"2022-09-27T22:05:29.556179Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* **barplot for product_names densitiy per name**","metadata":{}},{"cell_type":"code","source":"info_names = data[\"prod_name\"].value_counts()\ninfo_names[:30].plot.bar(figsize=(15,5),rot=70)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:17:09.817232Z","iopub.execute_input":"2022-09-27T22:17:09.817685Z","iopub.status.idle":"2022-09-27T22:17:10.275347Z","shell.execute_reply.started":"2022-09-27T22:17:09.817647Z","shell.execute_reply":"2022-09-27T22:17:10.274266Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* **prodduct type name**","metadata":{}},{"cell_type":"code","source":"product_type = data[\"product_type_name\"]\nprint(\"total number of items\",len(data[\"product_type_name\"]))","metadata":{"execution":{"iopub.status.busy":"2022-09-27T20:37:17.062336Z","iopub.execute_input":"2022-09-27T20:37:17.062752Z","iopub.status.idle":"2022-09-27T20:37:17.068491Z","shell.execute_reply.started":"2022-09-27T20:37:17.062719Z","shell.execute_reply":"2022-09-27T20:37:17.067262Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"product_type = list(set(product_type))\nprint(\"number of items:\",len(product_type),\"\\n unrepeated product type names \\n\",product_type)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T20:37:21.616753Z","iopub.execute_input":"2022-09-27T20:37:21.617152Z","iopub.status.idle":"2022-09-27T20:37:21.634155Z","shell.execute_reply.started":"2022-09-27T20:37:21.617119Z","shell.execute_reply":"2022-09-27T20:37:21.632848Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(data[\"product_type_name\"].value_counts())","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:37:52.721558Z","iopub.execute_input":"2022-09-27T21:37:52.722051Z","iopub.status.idle":"2022-09-27T21:37:52.736513Z","shell.execute_reply.started":"2022-09-27T21:37:52.722013Z","shell.execute_reply":"2022-09-27T21:37:52.735718Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"type(data[\"product_type_name\"].value_counts())","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:35:05.341318Z","iopub.execute_input":"2022-09-27T21:35:05.341738Z","iopub.status.idle":"2022-09-27T21:35:05.356942Z","shell.execute_reply.started":"2022-09-27T21:35:05.341693Z","shell.execute_reply":"2022-09-27T21:35:05.355631Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"info_type = data[\"product_type_name\"].value_counts()\ninfo_type.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:38:21.426433Z","iopub.execute_input":"2022-09-27T21:38:21.426853Z","iopub.status.idle":"2022-09-27T21:38:21.442458Z","shell.execute_reply.started":"2022-09-27T21:38:21.426817Z","shell.execute_reply":"2022-09-27T21:38:21.441032Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"info_type[:30]","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:49:29.111927Z","iopub.execute_input":"2022-09-27T21:49:29.112323Z","iopub.status.idle":"2022-09-27T21:49:29.120864Z","shell.execute_reply.started":"2022-09-27T21:49:29.112291Z","shell.execute_reply":"2022-09-27T21:49:29.119766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* **barplot for product_types densitiy**","metadata":{}},{"cell_type":"code","source":"\ninfo_type[:30].plot.bar(figsize=(15,5),rot=70)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T21:52:48.776663Z","iopub.execute_input":"2022-09-27T21:52:48.777116Z","iopub.status.idle":"2022-09-27T21:52:49.206157Z","shell.execute_reply.started":"2022-09-27T21:52:48.777079Z","shell.execute_reply":"2022-09-27T21:52:49.205087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"* **product group name**","metadata":{}},{"cell_type":"code","source":"product_group = data[\"product_group_name\"]\nprint(\"total number of items\",len(data[\"product_group_name\"]))","metadata":{"execution":{"iopub.status.busy":"2022-09-27T20:37:30.723459Z","iopub.execute_input":"2022-09-27T20:37:30.723897Z","iopub.status.idle":"2022-09-27T20:37:30.730070Z","shell.execute_reply.started":"2022-09-27T20:37:30.723859Z","shell.execute_reply":"2022-09-27T20:37:30.728913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"product_group = list(set(product_group))\nprint(\"number of items:\",len(product_group),\"\\n unrepeated product type names \\n\",product_group)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T20:38:44.422311Z","iopub.execute_input":"2022-09-27T20:38:44.422784Z","iopub.status.idle":"2022-09-27T20:38:44.442527Z","shell.execute_reply.started":"2022-09-27T20:38:44.422744Z","shell.execute_reply":"2022-09-27T20:38:44.441282Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**data substitution according to the needed groups**","metadata":{}},{"cell_type":"code","source":"items_grp = ['Garment Lower body','Garment Upper body']","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:11:30.532773Z","iopub.execute_input":"2022-09-27T22:11:30.533201Z","iopub.status.idle":"2022-09-27T22:11:30.538900Z","shell.execute_reply.started":"2022-09-27T22:11:30.533163Z","shell.execute_reply":"2022-09-27T22:11:30.537651Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data_upper_lower= data.loc[data['product_group_name'].isin(['Garment Lower body','Garment Upper body']),:]\ndata_upper_lower.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:19:47.816749Z","iopub.execute_input":"2022-09-27T22:19:47.817138Z","iopub.status.idle":"2022-09-27T22:19:47.872204Z","shell.execute_reply.started":"2022-09-27T22:19:47.817107Z","shell.execute_reply":"2022-09-27T22:19:47.871040Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"info_ULg = data_upper_lower[\"product_type_name\"].value_counts()\nprint(info_ULg,\"\\n\",len(info_ULg))","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:25:01.397221Z","iopub.execute_input":"2022-09-27T22:25:01.397663Z","iopub.status.idle":"2022-09-27T22:25:01.412281Z","shell.execute_reply.started":"2022-09-27T22:25:01.397629Z","shell.execute_reply":"2022-09-27T22:25:01.410624Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**final clothes' names**","metadata":{}},{"cell_type":"code","source":"info_ULg.plot.bar(figsize=(15,5),rot=70)","metadata":{"execution":{"iopub.status.busy":"2022-09-27T22:25:11.646904Z","iopub.execute_input":"2022-09-27T22:25:11.647562Z","iopub.status.idle":"2022-09-27T22:25:11.984212Z","shell.execute_reply.started":"2022-09-27T22:25:11.647518Z","shell.execute_reply":"2022-09-27T22:25:11.983038Z"},"trusted":true},"execution_count":null,"outputs":[]}]}