{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "17c606f9-a0f6-40e7-17e6-8ea095288d1e"
      },
      "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",
        "# Any results you write to the current directory are saved as output.\n",
        "train = pd.read_csv(\"../input/clicks_train.csv\")\n",
        "test =  pd.read_csv(\"../input/clicks_test.csv\")\n",
        "sample_subm = pd.read_csv(\"../input/sample_submission.csv\") "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "4d94a0f2-a180-39fc-69b4-b61e997c3935"
      },
      "outputs": [],
      "source": [
        "train[:10]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "999ca528-afd8-3c5d-0fc8-0f07a2b2c4f3"
      },
      "outputs": [],
      "source": [
        "test[:10]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "b742cae7-6fea-9abc-ddf5-1889145a5f38"
      },
      "outputs": [],
      "source": [
        "sample_subm[:10]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "112d12bd-cc18-203a-8987-d26b630ce541"
      },
      "outputs": [],
      "source": [
        "count = train[train.clicked==1].ad_id.value_counts()\n",
        "count.describe()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "94ab1021-931d-7b22-c5fc-ffebbc1d5160"
      },
      "outputs": [],
      "source": [
        "count[1:10]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "937a6d7c-b003-0b8f-59b2-4debcfde7b25"
      },
      "outputs": [],
      "source": [
        "count[[1,3,5]]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "fc7bc746-8792-1fd7-144a-02dd397d291f"
      },
      "outputs": [],
      "source": [
        "1 in count"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "5cb4a5bf-617b-f1e0-5fff-fa24581d67c3"
      },
      "outputs": [],
      "source": ""
    }
  ],
  "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
}