{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"a4ce7fce-09d3-2ac4-193f-76c2d69bdf55"},"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)\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.model import LogisticRegression\nimport tensorflow as tf\n%matplotlib inline\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\"]).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":"6f50888d-fb1b-40c1-1587-01798a659123"},"outputs":[],"source":"labeled_images = pd.read_csv('../input/train.csv')\nimages = labeled_images.iloc[0:5000,1:]\nlabels = labeled_images.iloc[0:5000,:1]\ntrain_images, test_images,train_labels, test_labels = train_test_split(\n    images, labels, train_size=0.8, random_state=0)"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"8bd35ad8-7e25-143c-f185-c4faf013a4a3"},"outputs":[],"source":"img=train_images.iloc[2].as_matrix()\nimg=img.reshape((28,28))\nplt.imshow(img,cmap='gray')\nplt.title(train_labels.iloc[2,0])"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"8e45adbe-45a1-608f-c2c8-b87ddc76cf88"},"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}