{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":59093,"databundleVersionId":7469972,"sourceType":"competition"},{"sourceId":7396175,"sourceType":"datasetVersion","datasetId":4296008}],"dockerImageVersionId":30626,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# 🦩 Using Ibis-framework in Kaggle 🦩","metadata":{}},{"cell_type":"markdown","source":"![ibis](https://camo.qiitausercontent.com/536834ed6cbfe4ed6623b4b395baedcc31ce84a0/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f3639323136352f39316330333737302d623434302d363438632d633633372d3631616666343465656533362e706e67)\n\nDo you know about Ibis ? Ibis is a library that provides an integrated interface for data processing, allowing you to use over 18 supported data processing libraries with the same syntax. As of January 2024, it supports the following frameworks.\n\nBigQuery , ClickHouse , Dask , DataFusion , Druid ,\nDuckDB , Exasol ,\nFlink , Impala , MSSQL , MySQL , Oracle , pandas ( CuDF ) , Polars ,\nPostresSQL , PySpark , Snowflake , SQLite , Trino\n\n![ibis2](https://camo.qiitausercontent.com/4ce38b715f22e9c3947631bacf4a3e95361726bf/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f3639323136352f34393836646236322d656161332d656136372d613462662d3761636362393039323134352e706e67)\n\nWith Ibis, you can change the backend framework anytime without having to rewrite your code.","metadata":{}},{"cell_type":"code","source":"# %load_ext cudf.pandas # you can also use cudf\n\nibis.set_backend(\"pandas\") # Set pandas as the backend\n\nt = (\n    ibis.read_csv(\"titanic.csv\")\n    .select(\"name\", \"sex\", \"age\", \"fare\")\n    .filter(t[\"sex\"] == \"female\")\n    .mutate(\n        # Calculate z-scores for 'age' and 'fare'\n        s.across([\"age\", \"fare\"], {\"zscore\": lambda x: ((x - x.mean()) / x.std()) * 10 + 50}))\n    .order_by(ibis.desc(\"age\")) # Sort by 'age' column in descending order\n    )\n\nt.execute() # Execute the query","metadata":{"execution":{"iopub.status.busy":"2024-01-12T18:54:02.474804Z","iopub.execute_input":"2024-01-12T18:54:02.475402Z","iopub.status.idle":"2024-01-12T18:54:02.481234Z","shell.execute_reply.started":"2024-01-12T18:54:02.475351Z","shell.execute_reply":"2024-01-12T18:54:02.480021Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ibis.set_backend(\"polars\") # Set pandas as the backend\n\nt = (\n    ibis.read_csv(\"titanic.csv\")\n    .select(\"name\", \"sex\", \"age\", \"fare\")\n    .filter(t[\"sex\"] == \"female\")\n    .mutate(\n        # Calculate z-scores for 'age' and 'fare'\n        s.across([\"age\", \"fare\"], {\"zscore\": lambda x: ((x - x.mean()) / x.std()) * 10 + 50}))\n    .order_by(ibis.desc(\"age\")) # Sort by 'age' column in descending order\n    )\n\nt.execute() # Execute the query","metadata":{"execution":{"iopub.status.busy":"2024-01-12T18:54:02.483683Z","iopub.execute_input":"2024-01-12T18:54:02.484003Z","iopub.status.idle":"2024-01-12T18:54:02.495752Z","shell.execute_reply.started":"2024-01-12T18:54:02.483975Z","shell.execute_reply":"2024-01-12T18:54:02.494657Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Just like in the code example above, you can switch the backend processing engine from pandas to polars by simply modifying only the first line.\n\nIf you are interested in Ibis, you can study it through the following content.\n\nhttps://github.com/kunishou/Ibis_100_knocks","metadata":{}},{"cell_type":"markdown","source":"This time, I tried using Ibis on Kaggle. I referred to the following notebook for guidance. Thank you :)\n\nhttps://www.kaggle.com/code/docxian/hms-harmful-brain-activity-first-glance","metadata":{}},{"cell_type":"markdown","source":"## Table of Contents\n* [File Overview](#files)\n* [Training File](#train)\n* [EEG File Example](#ex_EEG)\n* [Spectrogram File Example](#ex_spec)\n* [Test and Submission File](#sub)","metadata":{}},{"cell_type":"code","source":"# install ibis-framework\n!pip install /kaggle/input/ibis-framework/*.whl -qq 2>/dev/null","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:20:24.327843Z","iopub.execute_input":"2024-01-13T18:20:24.329170Z","iopub.status.idle":"2024-01-13T18:21:47.316465Z","shell.execute_reply.started":"2024-01-13T18:20:24.329129Z","shell.execute_reply":"2024-01-13T18:21:47.315121Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# packages\n\n# standard\nimport numpy as np\nimport pandas as pd\nimport ibis\nimport time\n\n# plot\nimport matplotlib.pyplot as plt\nimport seaborn as sns","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-01-13T18:21:53.688547Z","iopub.execute_input":"2024-01-13T18:21:53.688974Z","iopub.status.idle":"2024-01-13T18:21:55.113284Z","shell.execute_reply.started":"2024-01-13T18:21:53.688938Z","shell.execute_reply":"2024-01-13T18:21:55.112223Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ibis.options.interactive = True # Ibis Eager Mode","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:21:55.114886Z","iopub.execute_input":"2024-01-13T18:21:55.115368Z","iopub.status.idle":"2024-01-13T18:21:55.120141Z","shell.execute_reply.started":"2024-01-13T18:21:55.115336Z","shell.execute_reply":"2024-01-13T18:21:55.118726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ibis.set_backend(\"polars\") # set polars as backend engine \n# ibis.set_backend(\"pandas\")\n# ibis.set_backend(\"duckdb\")","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:21:55.122224Z","iopub.execute_input":"2024-01-13T18:21:55.122576Z","iopub.status.idle":"2024-01-13T18:21:55.424063Z","shell.execute_reply.started":"2024-01-13T18:21:55.122540Z","shell.execute_reply":"2024-01-13T18:21:55.423157Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# configs\nibis.options.repr.interactive.max_rows = 100 # we want to display 100 columns in this notebook\n\n# aesthetics\ndefault_color_1 = 'darkblue'\ndefault_color_2 = 'darkgreen'\ndefault_color_3 = 'darkred'","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:21:55.425975Z","iopub.execute_input":"2024-01-13T18:21:55.426279Z","iopub.status.idle":"2024-01-13T18:21:55.430843Z","shell.execute_reply.started":"2024-01-13T18:21:55.426251Z","shell.execute_reply":"2024-01-13T18:21:55.429730Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id='files'></a>\n# File Overview","metadata":{}},{"cell_type":"code","source":"!ls -l '../input/hms-harmful-brain-activity-classification'","metadata":{"execution":{"iopub.status.busy":"2024-01-12T18:54:16.794677Z","iopub.execute_input":"2024-01-12T18:54:16.795435Z","iopub.status.idle":"2024-01-12T18:54:17.836600Z","shell.execute_reply.started":"2024-01-12T18:54:16.795399Z","shell.execute_reply":"2024-01-12T18:54:17.835038Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls -l '../input/hms-harmful-brain-activity-classification/example_figures'","metadata":{"execution":{"iopub.status.busy":"2024-01-12T18:54:17.838288Z","iopub.execute_input":"2024-01-12T18:54:17.838675Z","iopub.status.idle":"2024-01-12T18:54:18.880763Z","shell.execute_reply.started":"2024-01-12T18:54:17.838642Z","shell.execute_reply":"2024-01-12T18:54:18.879736Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls -l '../input/hms-harmful-brain-activity-classification/train_spectrograms'","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-01-12T18:54:18.882791Z","iopub.execute_input":"2024-01-12T18:54:18.883141Z","iopub.status.idle":"2024-01-12T18:54:21.615648Z","shell.execute_reply.started":"2024-01-12T18:54:18.883109Z","shell.execute_reply":"2024-01-12T18:54:21.614415Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls -l '../input/hms-harmful-brain-activity-classification/train_eegs'","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-01-12T18:54:21.621789Z","iopub.execute_input":"2024-01-12T18:54:21.622164Z","iopub.status.idle":"2024-01-12T18:54:26.402135Z","shell.execute_reply.started":"2024-01-12T18:54:21.622130Z","shell.execute_reply":"2024-01-12T18:54:26.400842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id='train'></a>\n# Training File","metadata":{}},{"cell_type":"code","source":"t_train = ibis.read_csv(\"../input/hms-harmful-brain-activity-classification/train.csv\")\nt_train.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:03.556766Z","iopub.execute_input":"2024-01-13T18:22:03.557159Z","iopub.status.idle":"2024-01-13T18:22:03.733703Z","shell.execute_reply.started":"2024-01-13T18:22:03.557119Z","shell.execute_reply":"2024-01-13T18:22:03.732831Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# votes columns\nfeatures_vote = ['seizure_vote', 'lpd_vote', 'gpd_vote',\n                 'lrda_vote', 'grda_vote', 'other_vote']","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:03.908506Z","iopub.execute_input":"2024-01-13T18:22:03.908857Z","iopub.status.idle":"2024-01-13T18:22:03.913356Z","shell.execute_reply.started":"2024-01-13T18:22:03.908828Z","shell.execute_reply":"2024-01-13T18:22:03.912495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Group by eeg_id and calculate the mean of the vote columns\nt_train_unique_votes = t_train.group_by('eeg_id').agg(\n    [t_train[col].mean().name(col) for col in features_vote]\n)\n\n# Calculate the sum of votes for each row\nt_train_unique_votes = t_train_unique_votes.mutate(\n    vote_sum=sum(t_train_unique_votes[col] for col in features_vote)\n)\n\n# Normalize votes to get a 100% distribution for each row/EEG\nfor f in features_vote:\n    t_train_unique_votes = t_train_unique_votes.mutate(\n        **{f: t_train_unique_votes[f] / t_train_unique_votes.vote_sum}\n    )\n    \nt_train_unique_votes.head(10)","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:04.310121Z","iopub.execute_input":"2024-01-13T18:22:04.310841Z","iopub.status.idle":"2024-01-13T18:22:04.544294Z","shell.execute_reply.started":"2024-01-13T18:22:04.310795Z","shell.execute_reply":"2024-01-13T18:22:04.543384Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id='ex_EEG'></a>\n# EEG File Example","metadata":{}},{"cell_type":"code","source":"# load an EEG file\nt_eeg = ibis.read_parquet('../input/hms-harmful-brain-activity-classification/train_eegs/1000913311.parquet')","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:06.649539Z","iopub.execute_input":"2024-01-13T18:22:06.650534Z","iopub.status.idle":"2024-01-13T18:22:06.675802Z","shell.execute_reply.started":"2024-01-13T18:22:06.650488Z","shell.execute_reply":"2024-01-13T18:22:06.674989Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# preview\nt_eeg.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:06.992464Z","iopub.execute_input":"2024-01-13T18:22:06.993106Z","iopub.status.idle":"2024-01-13T18:22:07.055783Z","shell.execute_reply.started":"2024-01-13T18:22:06.993061Z","shell.execute_reply":"2024-01-13T18:22:07.054739Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# show structure\nt_eeg.info()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:09.054070Z","iopub.execute_input":"2024-01-13T18:22:09.054625Z","iopub.status.idle":"2024-01-13T18:22:09.186125Z","shell.execute_reply.started":"2024-01-13T18:22:09.054592Z","shell.execute_reply":"2024-01-13T18:22:09.185151Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# basis stats\nt_eeg.execute().describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:09.244055Z","iopub.execute_input":"2024-01-13T18:22:09.245037Z","iopub.status.idle":"2024-01-13T18:22:09.324211Z","shell.execute_reply.started":"2024-01-13T18:22:09.244995Z","shell.execute_reply":"2024-01-13T18:22:09.323507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# list of features\nfeatures_eeg = ['Fp1', 'F3', 'C3', 'P3', 'F7', \n                'T3', 'T5', 'O1', 'Fz', 'Cz', 'Pz',\n                'Fp2', 'F4', 'C4', 'P4', 'F8',\n                'T4', 'T6', 'O2', 'EKG']","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:09.456566Z","iopub.execute_input":"2024-01-13T18:22:09.457129Z","iopub.status.idle":"2024-01-13T18:22:09.461211Z","shell.execute_reply.started":"2024-01-13T18:22:09.457096Z","shell.execute_reply":"2024-01-13T18:22:09.460374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plot all features\nfor f in features_eeg:\n    plt.figure(figsize=(12,3))\n    plt.plot(t_eeg[f].execute(), color=default_color_1)\n    plt.title(f)\n    plt.grid()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:11.732842Z","iopub.execute_input":"2024-01-13T18:22:11.733493Z","iopub.status.idle":"2024-01-13T18:22:19.271083Z","shell.execute_reply.started":"2024-01-13T18:22:11.733456Z","shell.execute_reply":"2024-01-13T18:22:19.270315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cor_eeg = t_eeg[features_eeg].execute().corr(method='pearson')\nplt.figure(figsize=(12,8))\nsns.heatmap(cor_eeg, annot=True,\n            fmt='.2f',\n            linecolor='black', linewidths=.5,\n            cmap='RdYlGn', vmin=-1, vmax=+1)\nplt.title('Correlation - EEG example')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:19.272719Z","iopub.execute_input":"2024-01-13T18:22:19.273242Z","iopub.status.idle":"2024-01-13T18:22:20.665624Z","shell.execute_reply.started":"2024-01-13T18:22:19.273209Z","shell.execute_reply":"2024-01-13T18:22:20.664678Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id='ex_spec'></a>\n# Spectrogram File Example","metadata":{}},{"cell_type":"code","source":"# load spectrogram file\nt_spec = ibis.read_parquet('../input/hms-harmful-brain-activity-classification/train_spectrograms/1000086677.parquet')","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:20.666919Z","iopub.execute_input":"2024-01-13T18:22:20.667212Z","iopub.status.idle":"2024-01-13T18:22:20.697433Z","shell.execute_reply.started":"2024-01-13T18:22:20.667186Z","shell.execute_reply":"2024-01-13T18:22:20.696527Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# preview\nt_spec.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:20.699510Z","iopub.execute_input":"2024-01-13T18:22:20.699868Z","iopub.status.idle":"2024-01-13T18:22:21.179215Z","shell.execute_reply.started":"2024-01-13T18:22:20.699838Z","shell.execute_reply":"2024-01-13T18:22:21.178176Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# show structure\nt_spec.execute().info(verbose=True, show_counts=True)","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2024-01-13T18:22:21.180444Z","iopub.execute_input":"2024-01-13T18:22:21.180785Z","iopub.status.idle":"2024-01-13T18:22:21.303417Z","shell.execute_reply.started":"2024-01-13T18:22:21.180755Z","shell.execute_reply":"2024-01-13T18:22:21.302410Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# basis stats\nt_spec.execute().describe()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:21.304864Z","iopub.execute_input":"2024-01-13T18:22:21.305216Z","iopub.status.idle":"2024-01-13T18:22:22.139969Z","shell.execute_reply.started":"2024-01-13T18:22:21.305185Z","shell.execute_reply":"2024-01-13T18:22:22.139278Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Some plots:","metadata":{}},{"cell_type":"code","source":"# plotting function\ndef plot_spec(i_frequency):\n    feature_1 = 'LL_' + i_frequency\n    feature_2 = 'RL_' + i_frequency\n    feature_3 = 'RP_' + i_frequency\n    feature_4 = 'LP_' + i_frequency\n    plt.figure(figsize=(10,3))\n    plt.scatter(df_spec.time, df_spec[feature_1], label='LL')\n    plt.scatter(df_spec.time, df_spec[feature_2], label='RL')\n    plt.scatter(df_spec.time, df_spec[feature_3], label='RP')\n    plt.scatter(df_spec.time, df_spec[feature_4], label='LP')\n    plt.legend(loc='upper right')\n    plt.title('Frequency=' + i_frequency)\n    plt.grid()\n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:23.703523Z","iopub.execute_input":"2024-01-13T18:22:23.704573Z","iopub.status.idle":"2024-01-13T18:22:23.711437Z","shell.execute_reply.started":"2024-01-13T18:22:23.704525Z","shell.execute_reply":"2024-01-13T18:22:23.710103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_spec = t_spec.execute()\n\n# plot for a few frequencies\nfrequencies = ['0.59', '3.91', '10.16', '19.92']\nfor freq in frequencies:\n    plot_spec(freq)","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:26.799769Z","iopub.execute_input":"2024-01-13T18:22:26.800142Z","iopub.status.idle":"2024-01-13T18:22:28.219213Z","shell.execute_reply.started":"2024-01-13T18:22:26.800109Z","shell.execute_reply":"2024-01-13T18:22:28.218509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id='sub'></a>\n# Test and Submission File","metadata":{}},{"cell_type":"code","source":"t_test = ibis.read_csv('../input/hms-harmful-brain-activity-classification/test.csv')\nt_test","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:31.754487Z","iopub.execute_input":"2024-01-13T18:22:31.754852Z","iopub.status.idle":"2024-01-13T18:22:31.768557Z","shell.execute_reply.started":"2024-01-13T18:22:31.754822Z","shell.execute_reply":"2024-01-13T18:22:31.767739Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"t_sub = ibis.read_csv('../input/hms-harmful-brain-activity-classification/sample_submission.csv')\nt_sub","metadata":{"execution":{"iopub.status.busy":"2024-01-13T18:22:33.372277Z","iopub.execute_input":"2024-01-13T18:22:33.372645Z","iopub.status.idle":"2024-01-13T18:22:33.388568Z","shell.execute_reply.started":"2024-01-13T18:22:33.372614Z","shell.execute_reply":"2024-01-13T18:22:33.387857Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### ","metadata":{}},{"cell_type":"markdown","source":"#### Simply use (grouped) means for a first baseline. See also this notebook: https://www.kaggle.com/code/seshurajup/eda-train-csv","metadata":{}},{"cell_type":"code","source":"mean_values = t_train_unique_votes.agg(\n    t_train_unique_votes[col].mean().name(col) for col in features_vote\n).execute()\nmean_values","metadata":{"execution":{"iopub.status.busy":"2024-01-12T19:18:30.809915Z","iopub.execute_input":"2024-01-12T19:18:30.810645Z","iopub.status.idle":"2024-01-12T19:18:30.863171Z","shell.execute_reply.started":"2024-01-12T19:18:30.810596Z","shell.execute_reply":"2024-01-12T19:18:30.862053Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"t_sub = t_sub.mutate(\n    seizure_vote=float(mean_values['seizure_vote']),\n    lpd_vote=float(mean_values['lpd_vote']),\n    gpd_vote=float(mean_values['gpd_vote']),\n    lrda_vote=float(mean_values['lrda_vote']),\n    grda_vote=float(mean_values['grda_vote']),\n    other_vote=float(mean_values['other_vote'])\n)\nt_sub","metadata":{"execution":{"iopub.status.busy":"2024-01-12T19:18:33.884452Z","iopub.execute_input":"2024-01-12T19:18:33.885226Z","iopub.status.idle":"2024-01-12T19:18:33.909446Z","shell.execute_reply.started":"2024-01-12T19:18:33.885179Z","shell.execute_reply":"2024-01-12T19:18:33.908233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"t_sub.execute()","metadata":{"execution":{"iopub.status.busy":"2024-01-12T19:18:34.895891Z","iopub.execute_input":"2024-01-12T19:18:34.896328Z","iopub.status.idle":"2024-01-12T19:18:34.914430Z","shell.execute_reply.started":"2024-01-12T19:18:34.896290Z","shell.execute_reply":"2024-01-12T19:18:34.913436Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# save submission file\nt_sub.execute().to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2024-01-12T19:18:40.453342Z","iopub.execute_input":"2024-01-12T19:18:40.453739Z","iopub.status.idle":"2024-01-12T19:18:40.465336Z","shell.execute_reply.started":"2024-01-12T19:18:40.453708Z","shell.execute_reply":"2024-01-12T19:18:40.464064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Work in progress","metadata":{}}]}