{"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":"import pandas as pd\nimport dask_cudf","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-11-24T11:16:31.539086Z","iopub.execute_input":"2022-11-24T11:16:31.539812Z","iopub.status.idle":"2022-11-24T11:16:31.545152Z","shell.execute_reply.started":"2022-11-24T11:16:31.539776Z","shell.execute_reply":"2022-11-24T11:16:31.543452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = dask_cudf.read_parquet('/kaggle/input/otto-chunk-data-inparquet-format/train_parquet/*.parquet')\n\ntest_df = dask_cudf.read_parquet('/kaggle/input/otto-chunk-data-inparquet-format/test_parquet/*.parquet')","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:32:27.065624Z","iopub.execute_input":"2022-11-24T11:32:27.065987Z","iopub.status.idle":"2022-11-24T11:32:27.196667Z","shell.execute_reply.started":"2022-11-24T11:32:27.065958Z","shell.execute_reply":"2022-11-24T11:32:27.195799Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"unique_train_aid = df['aid'].unique().compute()","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:32:49.930277Z","iopub.execute_input":"2022-11-24T11:32:49.930647Z","iopub.status.idle":"2022-11-24T11:33:00.785044Z","shell.execute_reply.started":"2022-11-24T11:32:49.930615Z","shell.execute_reply":"2022-11-24T11:33:00.783844Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"unique_test_aid = test_df['aid'].unique().compute()","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:33:05.366911Z","iopub.execute_input":"2022-11-24T11:33:05.367349Z","iopub.status.idle":"2022-11-24T11:33:07.438822Z","shell.execute_reply.started":"2022-11-24T11:33:05.367311Z","shell.execute_reply":"2022-11-24T11:33:07.437637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(unique_train_aid)","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:34:52.992927Z","iopub.execute_input":"2022-11-24T11:34:52.993285Z","iopub.status.idle":"2022-11-24T11:34:52.999718Z","shell.execute_reply.started":"2022-11-24T11:34:52.993256Z","shell.execute_reply":"2022-11-24T11:34:52.998680Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"(unique_test_aid.isin(unique_train_aid.to_arrow().to_pylist())).sum() == unique_test_aid.shape[0]","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:38:08.721746Z","iopub.execute_input":"2022-11-24T11:38:08.722099Z","iopub.status.idle":"2022-11-24T11:38:09.494433Z","shell.execute_reply.started":"2022-11-24T11:38:08.722070Z","shell.execute_reply":"2022-11-24T11:38:09.493349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"frac = df[df['session'] == 1].sort_values('ts')","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:43:17.883350Z","iopub.execute_input":"2022-11-24T11:43:17.883846Z","iopub.status.idle":"2022-11-24T11:43:41.160471Z","shell.execute_reply.started":"2022-11-24T11:43:17.883815Z","shell.execute_reply":"2022-11-24T11:43:41.159541Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"frac.compute()","metadata":{"execution":{"iopub.status.busy":"2022-11-24T11:43:41.853088Z","iopub.execute_input":"2022-11-24T11:43:41.853436Z","iopub.status.idle":"2022-11-24T11:44:05.882495Z","shell.execute_reply.started":"2022-11-24T11:43:41.853387Z","shell.execute_reply":"2022-11-24T11:44:05.881449Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}