{"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 pickle\n# import pandas as pd\nimport os\n\n\noutput_path = \"tranposed_summission.csv\"\n\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-10-12T18:36:54.024981Z","iopub.execute_input":"2022-10-12T18:36:54.025466Z","iopub.status.idle":"2022-10-12T18:36:54.055858Z","shell.execute_reply.started":"2022-10-12T18:36:54.025365Z","shell.execute_reply":"2022-10-12T18:36:54.054670Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\n\n# np.vstack([output, output]).T.shape","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:36:54.058399Z","iopub.execute_input":"2022-10-12T18:36:54.059273Z","iopub.status.idle":"2022-10-12T18:36:54.064262Z","shell.execute_reply.started":"2022-10-12T18:36:54.059200Z","shell.execute_reply":"2022-10-12T18:36:54.063041Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# with open(\"../input/lgbm-hardcore-ensemble/0-1000\", \"rb\") as f:\n#     test = pickle.load(f)","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:36:54.066204Z","iopub.execute_input":"2022-10-12T18:36:54.067015Z","iopub.status.idle":"2022-10-12T18:36:54.075847Z","shell.execute_reply.started":"2022-10-12T18:36:54.066969Z","shell.execute_reply":"2022-10-12T18:36:54.074794Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ROWS = 55935\nCOLS = 23418\noutputs = np.zeros((ROWS, COLS))","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:36:54.078850Z","iopub.execute_input":"2022-10-12T18:36:54.079474Z","iopub.status.idle":"2022-10-12T18:36:54.088182Z","shell.execute_reply.started":"2022-10-12T18:36:54.079425Z","shell.execute_reply":"2022-10-12T18:36:54.087003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from tqdm import tqdm\n\nimport gc\n\noutputs = []\nfor start, end in zip(range(0, 24000, 1000), range(1000, 25000, 1000)):\n    if start < 12000:\n\n        if end > 23418:\n            end = 23418\n\n        path = f\"../input/lgbm-hardcore-ensemble/{start}-{end}\"\n\n        print(path)\n\n        with open(path, \"rb\") as f:\n            o = pickle.load(f)\n        outputs.append(o)\n\n        gc.collect()\n\n","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:36:54.089661Z","iopub.execute_input":"2022-10-12T18:36:54.089987Z","iopub.status.idle":"2022-10-12T18:37:47.303276Z","shell.execute_reply.started":"2022-10-12T18:36:54.089958Z","shell.execute_reply":"2022-10-12T18:37:47.302011Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"outputs = np.hstack(outputs)","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:37:47.306347Z","iopub.execute_input":"2022-10-12T18:37:47.307382Z","iopub.status.idle":"2022-10-12T18:37:50.821357Z","shell.execute_reply.started":"2022-10-12T18:37:47.307331Z","shell.execute_reply":"2022-10-12T18:37:50.820107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\n\npd.DataFrame(outputs).to_csv(\"lower_12000.csv\", index=False, header=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-12T18:39:05.641277Z","iopub.execute_input":"2022-10-12T18:39:05.641777Z","iopub.status.idle":"2022-10-12T19:19:14.392448Z","shell.execute_reply.started":"2022-10-12T18:39:05.641740Z","shell.execute_reply":"2022-10-12T19:19:14.390508Z"},"trusted":true},"execution_count":null,"outputs":[]}]}