{
  "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": [
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "_cell_guid": "1d7d3ecc-af25-a82c-658b-b641a89baec8",
        "_active": false
      },
      "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\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nfrom 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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input/Train\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output.",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "_cell_guid": "0d9cbfae-256e-0e87-7394-89d96d0f5a80",
        "_active": false
      },
      "outputs": [],
      "source": "df = pd.read_csv('../input/sample_submission.csv', index_col=[\"test_id\"])\nprint(df.shape)\ndf.tail()",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "_cell_guid": "f5ef9cce-7474-0117-1a1b-8cf9fb9ce5d5",
        "_active": false
      },
      "outputs": [],
      "source": "train_y = pd.read_csv(\"../input/Train/train.csv\")\ntrain_y.tail()",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "_cell_guid": "ab487cab-b6ce-d671-ac4a-3646af180c89",
        "_active": false
      },
      "outputs": [],
      "source": "df = df.astype(int)\nmeans = train_y.mean()\nmeans = means.round().astype(int)\nfor row in tqdm(range(len(df))):\n    # means[\"test_id\"] = int(row)\n    df.iloc[row] = means\ndf.tail()",
      "execution_state": "idle"
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "_cell_guid": "00891022-2a3c-6b96-fb8b-b925bc764f3c",
        "_active": false
      },
      "outputs": [],
      "source": "df.to_csv(\"baseline_submission.csv\")",
      "execution_state": "idle"
    },
    {
      "metadata": {
        "_cell_guid": "3f6feb01-8583-bcbc-a971-7f1108bdce99",
        "_active": true,
        "collapsed": false
      },
      "source": null,
      "execution_count": null,
      "cell_type": "code",
      "outputs": []
    }
  ]
}