{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n","execution_count":1,"outputs":[]},{"metadata":{"collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0"},"cell_type":"markdown","source":"* ### Checking if we can get Ad durations from periods"},{"metadata":{"_uuid":"2300d40589fd9a78aacd03b6ebd162a812a6c6fe","_cell_guid":"1418328d-fa5a-411e-be6c-a040d8160f1b","trusted":true},"cell_type":"code","source":"train = pd.read_csv(\"../input/train.csv\", usecols=['item_id', 'user_id', 'deal_probability'], \n                    dtype={'item_id': str, 'user_id': str, 'deal_probability': float})\ntrain.head()","execution_count":2,"outputs":[]},{"metadata":{"_uuid":"e1dbd9f2f2c538215cc28270a59ae47edff70504","_cell_guid":"19159e97-fb08-4906-95bf-28141ace7c74","trusted":true},"cell_type":"code","source":"periods_train = pd.read_csv(\"../input/periods_train.csv\", parse_dates = ['activation_date', 'date_from', 'date_to'],\n                    dtype={'item_id': str})\nperiods_train.head()","execution_count":3,"outputs":[]},{"metadata":{"_uuid":"42e2f78e7ae8f4d36da45e90c39f8edf7616a5da","_cell_guid":"820fcfb0-e0c7-4136-84fd-1c5e54e383c1","trusted":true},"cell_type":"code","source":"#Check common item id's\nprint(len(set(train.item_id)))\nprint(len(set(periods_train.item_id)))\nprint(len(set(train.item_id).intersection(set(periods_train.item_id))))","execution_count":4,"outputs":[]},{"metadata":{"_uuid":"768319ff8360494bb0aeff1410cac2eb382e41f0","collapsed":true,"_cell_guid":"d5e00e7d-2cee-45be-a3ac-48beb59feb98","trusted":false},"cell_type":"markdown","source":"** I am not able to find any common item_id between train and periods_train. Although data description mentions it **"},{"metadata":{"trusted":true,"_uuid":"e10f720abc7f265faebbcc85558b1c64c8061f02"},"cell_type":"code","source":"train_active = pd.read_csv(\"../input/train_active.csv\", usecols=[\"item_id\", \"user_id\", \"item_seq_number\"])\ntrain_active.head()","execution_count":5,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"58a86b3d07a101ee9ccbddd375aec84a236719f4"},"cell_type":"code","source":"print(len(set(train_active.item_id)))\nprint(len(set(train.item_id).intersection(set(train_active.item_id))))","execution_count":6,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"852b12243d0fd7f0787ad7d4ec6c80b634e98eb5"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"language_info":{"name":"python","version":"3.6.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"nbformat":4,"nbformat_minor":1}