{"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 numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns; sns.set()\nfrom datetime import datetime, date, timedelta\nimport pandas_profiling\n\nfrom collections import Counter, defaultdict\nfrom PIL import Image\nfrom pathlib import Path\n\npath = Path(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/\")","metadata":{"execution":{"iopub.status.busy":"2022-04-17T13:07:32.772412Z","iopub.execute_input":"2022-04-17T13:07:32.772719Z","iopub.status.idle":"2022-04-17T13:07:34.767572Z","shell.execute_reply.started":"2022-04-17T13:07:32.772689Z","shell.execute_reply":"2022-04-17T13:07:34.766416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_df = pd.read_csv(path / \"transactions_train.csv\", dtype = {'article_id': str})\narticles_df = pd.read_csv(path / \"articles.csv\", dtype = {'article_id': str})\ncustomers_df = pd.read_csv(path / \"customers.csv\")\nsubmission = pd.read_csv(path / \"sample_submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-04-17T13:07:34.769772Z","iopub.execute_input":"2022-04-17T13:07:34.770046Z","iopub.status.idle":"2022-04-17T13:08:47.903925Z","shell.execute_reply.started":"2022-04-17T13:07:34.770012Z","shell.execute_reply":"2022-04-17T13:08:47.902735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles_df.profile_report()","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-04-17T13:08:47.905429Z","iopub.execute_input":"2022-04-17T13:08:47.905707Z","iopub.status.idle":"2022-04-17T14:04:27.374116Z","shell.execute_reply.started":"2022-04-17T13:08:47.905674Z","shell.execute_reply":"2022-04-17T14:04:27.373474Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers_df.profile_report()","metadata":{"execution":{"iopub.status.busy":"2022-04-17T14:04:27.37746Z","iopub.execute_input":"2022-04-17T14:04:27.378583Z","iopub.status.idle":"2022-04-17T14:07:06.765718Z","shell.execute_reply.started":"2022-04-17T14:04:27.378529Z","shell.execute_reply":"2022-04-17T14:07:06.764351Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_df.profile_report()","metadata":{"execution":{"iopub.status.busy":"2022-04-17T14:07:06.767986Z","iopub.execute_input":"2022-04-17T14:07:06.768361Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def show_images(article_ids, cols=1, rows=-1):\n    if isinstance(article_ids, int) or isinstance(article_ids, str):\n        article_ids = [article_ids]\n    article_count = len(article_ids)\n    if rows < 0: rows = (article_count // cols) + 1\n    plt.figure(figsize=(3 + 3.5 * cols, 3 + 5 * rows))\n    for i in range(article_count):\n        article_id = (\"0\" + str(article_ids[i]))[-10:]\n        plt.subplot(rows, cols, i + 1)\n        plt.axis('off')\n        plt.title(article_id)\n        try:\n            image = Image.open(f\"/kaggle/input/h-and-m-personalized-fashion-recommendations/images/{article_id[:3]}/{article_id}.jpg\")\n            plt.imshow(image)\n        except:\n            pass","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"show_images(\"0783707002\")\nshow_images(\"0783707034\")","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]}