{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"da9d5672-8240-632b-1ff4-6abd690380e7"},"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":"markdown","metadata":{"_cell_guid":"9ebfa311-f180-0857-7cb8-f021476dce53"},"source":"Load Train set."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"676bbb43-c157-6893-5b4e-caef2dcc30da"},"outputs":[],"source":"train = pd.read_csv(\"../input/train.csv\",\n                    usecols=[\"Semana\",\n                             \"Agencia_ID\",\n                             \"Canal_ID\",\n                             \"Ruta_SAK\",\n                             \"Cliente_ID\",\n                             \"Producto_ID\",\n                             \"Venta_uni_hoy\",\n                             \"Dev_uni_proxima\",\n                             \"Demanda_uni_equil\"],\n                    dtype={\"Semana\": np.uint8,\n                           \"Agencia_ID\": np.uint16,\n                           \"Canal_ID\": np.uint8,\n                           \"Ruta_SAK\": np.uint16,\n                           \"Cliente_ID\": np.uint32,\n                           \"Producto_ID\": np.uint16,\n                           \"Venta_uni_hoy\": np.uint32,\n                           \"Dev_uni_proxima\": np.uint32,\n                           \"Demanda_uni_equil\": np.uint32})"},{"cell_type":"markdown","metadata":{"_cell_guid":"8e15e2cf-7786-02ad-5e25-ea78b73c6a80"},"source":"Maximum difference between sales and adjusted demand."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"639704e5-4b00-9f45-6569-3f2c11906377"},"outputs":[],"source":"(train[\"Venta_uni_hoy\"]-train[\"Demanda_uni_equil\"]).abs().max()"},{"cell_type":"markdown","metadata":{"_cell_guid":"76b34891-5463-fbb7-0ed4-26cb72603c94"},"source":"Maximum returns."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"d74390b0-6ec4-619c-1c82-85037d99c393"},"outputs":[],"source":"train[\"Dev_uni_proxima\"].max()"},{"cell_type":"markdown","metadata":{"_cell_guid":"5d3a8bfb-613d-4be4-666a-e6a26bf3d1ea"},"source":"Find most returned product."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"cfe50c3e-2ad3-97b8-2135-e75dbbe25757"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"4669a03c-63d8-66ec-ccf0-6c6d9a0e61aa"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"7dd57eae-1ffc-bcde-e95d-5f003e6a646d"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"54dc6ad2-6f48-f2f0-f6a4-75933bc8cf71"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"c8bee4d4-e66b-e822-165c-01c970666f39"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"f5052f43-58c5-db14-ba2e-878da0c9a996"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"00876b79-6d51-667b-51cf-a05da3343e3f"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"14a2b281-10d4-ab76-eab1-1cd7840a3a0b"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"f4ec1f6b-ac42-912b-4f44-65dc4fe33dbc"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"26052937-148a-3401-510c-9b11ff080e6a"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"d3b111ab-7669-82a7-f922-07c3344fc072"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"1fb332e9-2e62-a38e-258c-17601898d392"},"outputs":[],"source":""},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"64998e7e-1d08-cf03-ad63-6f873ebb1fd1"},"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}