{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","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\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 read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-06-28T12:57:04.061311Z","iopub.execute_input":"2021-06-28T12:57:04.061645Z","iopub.status.idle":"2021-06-28T12:57:04.154428Z","shell.execute_reply.started":"2021-06-28T12:57:04.061567Z","shell.execute_reply":"2021-06-28T12:57:04.152149Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Offers","metadata":{}},{"cell_type":"code","source":"# reading offer details\noffers = pd.read_csv('/kaggle/input/acquire-valued-shoppers-challenge/offers.csv.gz', compression='gzip')\nprint(offers.shape)\noffers.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-28T12:57:04.156912Z","iopub.execute_input":"2021-06-28T12:57:04.157324Z","iopub.status.idle":"2021-06-28T12:57:07.628400Z","shell.execute_reply.started":"2021-06-28T12:57:04.157285Z","shell.execute_reply":"2021-06-28T12:57:07.626724Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### History","metadata":{}},{"cell_type":"code","source":"# reading history details\nhistory = pd.read_csv('/kaggle/input/acquire-valued-shoppers-challenge/trainHistory.csv.gz', compression='gzip')\nprint(history.shape)\nhistory.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-28T12:57:07.630424Z","iopub.execute_input":"2021-06-28T12:57:07.630798Z","iopub.status.idle":"2021-06-28T12:57:07.912928Z","shell.execute_reply.started":"2021-06-28T12:57:07.630761Z","shell.execute_reply":"2021-06-28T12:57:07.910913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Transactions","metadata":{}},{"cell_type":"code","source":"chunk_size = 2 * (10 ** 7)\nno_entries = 0\nfor chunk in pd.read_csv('/kaggle/input/acquire-valued-shoppers-challenge/transactions.csv.gz', compression = 'gzip', chunksize = chunk_size,\n                        engine='c'):\n    no_entries += chunk.shape[0]\n    print(chunk.shape)\nprint(no_entries)\n","metadata":{"execution":{"iopub.status.busy":"2021-06-28T12:57:07.914882Z","iopub.execute_input":"2021-06-28T12:57:07.915314Z","iopub.status.idle":"2021-06-28T13:07:47.942071Z","shell.execute_reply.started":"2021-06-28T12:57:07.915269Z","shell.execute_reply":"2021-06-28T13:07:47.940783Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}