{"cells": [{"metadata": {"_cell_guid": "72b31c3a-0981-4e91-9347-cd02bc81334d", "_uuid": "6d8bce67fe32e0c4a0ff946f3cc93e089ea80ce7"}, "cell_type": "markdown", "source": ["## 1. Loading Libraries"]}, {"metadata": {"_cell_guid": "1cd0d9db-dfd6-421f-a938-fae311a58494", "_uuid": "6c99b93138952070b8e64cff2462a0fd67ecfbc7"}, "cell_type": "code", "execution_count": null, "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", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import time\n", "from datetime import datetime\n", "from collections import Counter\n", "\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\", \"-la\"]).decode(\"utf8\"))\n", "\n", "# Any results you write to the current directory are saved as output.\n"]}, {"metadata": {"_cell_guid": "49ff318e-8c8f-4b0e-b556-223337cf6d40", "_uuid": "6b0e98bf973a9f92b1ddd470683c6a9c259b120c"}, "cell_type": "markdown", "source": ["## 2. Loading data"]}, {"metadata": {"_cell_guid": "65baf05e-1995-4839-92f1-8b3ee387edd0", "_uuid": "7303bbc16c3b1f6f7308120b925dfe48ff8e9e5e", "collapsed": true}, "cell_type": "code", "execution_count": null, "outputs": [], "source": ["train = pd.read_csv('../input/train.csv')\n", "members = pd.read_csv('../input/members.csv')\n", "transactions = pd.read_csv('../input/transactions.csv')\n", "# user_logs = pd.read_csv('../input/user_logs.csv')\n", "sample_submission_zero = pd.read_csv('../input/sample_submission_zero.csv')"]}, {"metadata": {"_cell_guid": "4452a9ca-d4a3-47be-9c54-3a103ea345a1", "_uuid": "e1a7bbd9c1e24bc9814722c6ec77343676875a45"}, "cell_type": "code", "execution_count": null, "outputs": [], "source": ["sample_submission_zero.head()\n", "sample_submission_zero['is_churn'] = 1\n", "sample_submission_zero.head()\n", "sample_submission_zero.to_csv('Test.csv', index=False)"]}, {"metadata": {"_cell_guid": "320f0ba4-9ac3-4547-8255-ec9df1d72b3f", "_uuid": "f4b7e9e08109d59eceb488113b9987b96a33b476"}, "cell_type": "code", "execution_count": null, "outputs": [], "source": ["print(check_output([\"ls\", \"-la\"]).decode(\"utf8\"))\n", "train.head(20)"]}, {"metadata": {"_cell_guid": "a3a2831f-4cf4-4b40-b438-b37406accc16", "_uuid": "7eb0ac0ffc046e69394662960e3cd6e8e620f09a"}, "cell_type": "code", "execution_count": null, "outputs": [], "source": ["members.shape\n", "# len(members['msno'].unique())\n", "members.head(100)"]}, {"metadata": {"_cell_guid": "c6982db9-3e8c-4164-8a2c-1914d114747c", "_uuid": "f52019b924821a2431f477f5a4eb30983da44a34"}, "cell_type": "code", "execution_count": null, "outputs": [], "source": ["transactions.head(20)"]}, {"metadata": {"_cell_guid": "82f34d6c-7895-47f7-aa49-3ae699dde49c", "_uuid": "52bcd353e835ad559cd4ed52a4f3447293a765b6", "collapsed": true}, "cell_type": "code", "execution_count": null, "outputs": [], "source": []}], "nbformat_minor": 1, "nbformat": 4, "metadata": {"language_info": {"nbconvert_exporter": "python", "pygments_lexer": "ipython3", "mimetype": "text/x-python", "name": "python", "version": "3.6.3", "codemirror_mode": {"version": 3, "name": "ipython"}, "file_extension": ".py"}, "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}}}