{"cells":[
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": 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)\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": {
   "collapsed": false
  },
  "outputs": [],
  "source": "train = pd.read_csv('../input/train.csv', chunksize=1000000)"
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "Semana_max = 0\nAgencia_ID_max = 0\nCanal_ID_max = 0\nRuta_SAK_max = 0\nCliente_ID_max = 0\nProducto_ID_max = 0\nVenta_uni_hoy_max = 0\nVenta_hoy_max = 0\nDev_uni_proxima_max = 0\nDev_proxima_max = 0\nDemanda_uni_equil_max = 0\n\nfor chunk in train:\n    Semana_max = max([Semana_max, chunk['Semana'].max()])\n    Agencia_ID_max = max([Agencia_ID_max, chunk['Agencia_ID'].max()])\n    Canal_ID_max = max([Canal_ID_max, chunk['Canal_ID'].max()])\n    Ruta_SAK_max = max([Ruta_SAK_max, chunk['Ruta_SAK'].max()])\n    Cliente_ID_max = max([Cliente_ID_max, chunk['Cliente_ID'].max()])\n    Producto_ID_max = max([Producto_ID_max, chunk['Producto_ID'].max()])\n    Venta_uni_hoy_max = max([Venta_uni_hoy_max, chunk['Venta_uni_hoy'].max()])\n    Venta_hoy_max = max([Venta_hoy_max, chunk['Venta_hoy'].max()])\n    Dev_uni_proxima_max = max([Dev_uni_proxima_max, chunk['Dev_uni_proxima'].max()])\n    Dev_proxima_max = max([Dev_proxima_max, chunk['Dev_proxima'].max()])\n    Demanda_uni_equil_max = max([Demanda_uni_equil_max, chunk['Demanda_uni_equil'].max()])\n    "
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "Cliente_ID_max"
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "train_100 = pd.read_csv('../input/train.csv', nrows=100)"
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "train_100.head()"
 }
],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}}, "nbformat": 4, "nbformat_minor": 0}