{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "2d69f31e-47d5-a92c-90cc-56e81385dac2"
      },
      "outputs": [],
      "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",
        "\n",
        "import numpy as np # linear algebra\n",
        "import 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",
        "\n",
        "from subprocess import check_output\n",
        "print(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n",
        "\n",
        "\n",
        "\n",
        "# Any results you write to the current directory are saved as output."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "90e9ddea-721f-63a5-8d68-b7fae97c685e"
      },
      "outputs": [],
      "source": [
        "# Read the data you need\n",
        "df_train = pd.read_csv('../input/clicks_train.csv')\n",
        "df_events = pd.read_csv('../input/events.csv')\n",
        "df_promoted_content = pd.read_csv('../input/promoted_content.csv')\n",
        "df_doc_categories = pd.read_csv('../input/documents_categories.csv')\n",
        "df_doc_entities = pd.read_csv('../input/documents_entities.csv')\n",
        "df_doc_meta = pd.read_csv('../input/documents_meta.csv')\n",
        "df_doc_topics = pd.read_csv('../input/documents_topics.csv')\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "14f156a6-2cc3-ba0e-af68-8c7ad990fb1d"
      },
      "outputs": [],
      "source": [
        "df_doc_categories = pd.read_csv('../input/documents_categories.csv')"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "492de018-9e70-afe1-7e16-afaedb6d6adf"
      },
      "outputs": [],
      "source": [
        "page_views_events_joined_by_uuid_document_df = page_views_df.alias('page_views').join(events_df.alias('events'), on=['uuid','document_id'], how='outer')"
      ]
    }
  ],
  "metadata": {
    "_change_revision": 0,
    "_is_fork": false,
    "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.5.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}