{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "1d7d3ecc-af25-a82c-658b-b641a89baec8"
      },
      "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",
        "from tqdm import tqdm\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/Train\"]).decode(\"utf8\"))\n",
        "\n",
        "# Any results you write to the current directory are saved as output."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "0d9cbfae-256e-0e87-7394-89d96d0f5a80"
      },
      "outputs": [],
      "source": [
        "df = pd.read_csv('../input/sample_submission.csv', index_col=[\"test_id\"])\n",
        "print(df.shape)\n",
        "df.tail()\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "f5ef9cce-7474-0117-1a1b-8cf9fb9ce5d5"
      },
      "outputs": [],
      "source": [
        "train_y = pd.read_csv(\"../input/Train/train.csv\")\n",
        "train_y.tail()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "ab487cab-b6ce-d671-ac4a-3646af180c89"
      },
      "outputs": [],
      "source": [
        "df = df.astype(int)\n",
        "means = train_y.mean()\n",
        "means = means.round().astype(int)\n",
        "for row in tqdm(range(len(df))):\n",
        "    # means[\"test_id\"] = int(row)\n",
        "    df.iloc[row] = means\n",
        "df.tail()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "00891022-2a3c-6b96-fb8b-b925bc764f3c"
      },
      "outputs": [],
      "source": [
        "df.to_csv(\"baseline_submission.csv\")"
      ]
    }
  ],
  "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.6.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}