{"cells":[{"cell_type":"markdown","metadata":{"_cell_guid":"a1cf1ab1-1d4b-7be2-6ddd-2c05566d2019"},"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"16d2435f-4ae5-0d9c-9cc1-189470e88acc"},"outputs":[],"source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n%matplotlib inline\nimport sys"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"cff88545-d0ad-199a-c16d-f3176d9b9290"},"outputs":[],"source":"sys.version"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"3cef8d56-6e04-e556-bdb0-fe187463fc22"},"outputs":[],"source":"def df_load(file, batch_size, skip = 1):\n    ''' Build dataframe by iterating over chunks. Option to skip chunks and\n        therefore read in less data. '''\n\n    reader = pd.read_csv(file, chunksize=batch_size,\n                         dtype=np.float16)\n\n    df = pd.concat((chunk for i, chunk in enumerate(reader) if i % skip == 0))\n\n    return df"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"21a3862f-4474-4ca8-2a0b-cb0a2ca61fda"},"outputs":[],"source":"input_path = '../input/'\ndf_num = df_load(input_path+'train_numeric.csv',\n                 batch_size=100000)"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"eb6d7f42-cac5-0204-cf46-09995912fb72"},"outputs":[],"source":"df_num.head()"}],"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}