{"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.0"}},"nbformat":4,"nbformat_minor":0,"cells":[{"metadata":{"_cell_guid":"ba9d48be-0276-3caf-e634-e0135d24fda7","_active":false,"collapsed":false},"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 in \n\nimport 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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":1,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"2a1ac1e4-1de6-cb3f-7de9-fb0dad44fe6f","_active":true,"collapsed":false},"source":",nrows=# read data\npage_views_sample = pd.read_csv('../input/page_views_sample.csv')\nclicks_train = pd.read_csv('../input/clicks_train.csv',nrows=)\nevents = pd.read_csv('../input/events.csv')\npromoted_content = pd.read_csv('../input/promoted_content.csv')\n#documents_categories = pd.read_csv('documents_categories.csv')\n#documents_entities = pd.read_csv('documents_entities.csv')\n#documents_meta = pd.read_csv('documents_meta.csv')\n#documents_topics = pd.read_csv('documents_topics.csv')\nclicks_test = pd.read_csv('../input/clicks_test.csv')","execution_count":4,"cell_type":"code","outputs":[],"execution_state":"idle"},{"metadata":{"_cell_guid":"2a1ac1e4-1de6-cb3f-7de9-fb0dad44fe6f","_active":true,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[]},{"metadata":{"_cell_guid":"e81a2938-72dc-f8b3-e985-de917c83c71c","_active":false,"collapsed":false},"source":"data_0_train = pd.merge(clicks_train, events, on='display_id', how='left')\ndata_1_train = pd.merge(data_0_train, page_views_sample, on = ['uuid', 'document_id', 'geo_location', 'platform', 'timestamp'], how = 'inner')\ndata_train = pd.merge(data_1_train, promoted_content, on='ad_id', how = 'left')\ndata_train.head(10)","execution_count":5,"cell_type":"code","outputs":[],"execution_state":"busy"},{"metadata":{"_cell_guid":"a5d175a0-67e9-b425-f7e2-6d9be167a276","_active":false,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[]},{"metadata":{"_cell_guid":"a5d175a0-67e9-b425-f7e2-6d9be167a276","_active":false,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[]},{"metadata":{"_cell_guid":"ba9d48be-0276-3caf-e634-e0135d24fda7","_active":false,"collapsed":false},"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 in \n\nimport 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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"cell_type":"code","outputs":[]},{"metadata":{"_cell_guid":"e81a2938-72dc-f8b3-e985-de917c83c71c","_active":false,"collapsed":false},"source":null,"execution_count":null,"cell_type":"code","outputs":[]}]}