{"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":"markdown","source":"## Common","metadata":{"id":"JQTVrfChYX7Z"}},{"cell_type":"code","source":"from IPython.display import FileLink\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom keras import optimizers\nfrom keras.models import Sequential, Model\nfrom keras.layers import Dense, Dropout, BatchNormalization, Input","metadata":{"id":"LAuFsQpnRinx","execution":{"iopub.status.busy":"2022-10-30T17:33:39.137277Z","iopub.execute_input":"2022-10-30T17:33:39.137741Z","iopub.status.idle":"2022-10-30T17:33:46.379451Z","shell.execute_reply.started":"2022-10-30T17:33:39.137647Z","shell.execute_reply":"2022-10-30T17:33:46.377950Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import os\nimport glob\nfrom tqdm import tqdm\nfrom time import time\nfrom sklearn.model_selection import train_test_split \nfrom itertools import permutations\n\nfrom sklearn.preprocessing import StandardScaler","metadata":{"id":"iriTZbH-R2eR","execution":{"iopub.status.busy":"2022-10-30T17:33:46.381521Z","iopub.execute_input":"2022-10-30T17:33:46.382148Z","iopub.status.idle":"2022-10-30T17:33:46.928166Z","shell.execute_reply.started":"2022-10-30T17:33:46.382113Z","shell.execute_reply":"2022-10-30T17:33:46.926798Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_model_files():\n  \"\"\"\n  Returns the file classiffied in train files, test files(test_in,test_out)\n  \"\"\"\n  train_files = []\n  test_files = []\n  for dirname, _, filenames in os.walk('/kaggle/input'):\n      for filename in filenames:\n        if \"dtypes\" in filename:\n          continue\n        file_path = os.path.join(dirname, filename)\n        if \"train\" in filename:\n          train_files.append(file_path)\n        else:\n          test_files.append(file_path)\n          \n  return train_files, test_files","metadata":{"id":"cnnN-Nb-bOdY","execution":{"iopub.status.busy":"2022-10-30T17:33:46.929487Z","iopub.execute_input":"2022-10-30T17:33:46.929837Z","iopub.status.idle":"2022-10-30T17:33:46.939662Z","shell.execute_reply.started":"2022-10-30T17:33:46.929805Z","shell.execute_reply":"2022-10-30T17:33:46.938401Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(get_model_files())","metadata":{"execution":{"iopub.status.busy":"2022-10-30T17:33:46.942750Z","iopub.execute_input":"2022-10-30T17:33:46.944007Z","iopub.status.idle":"2022-10-30T17:33:46.955759Z","shell.execute_reply.started":"2022-10-30T17:33:46.943963Z","shell.execute_reply":"2022-10-30T17:33:46.954411Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def reduce_mem_usage(df, keep_float16=True):\n    \"\"\" iterate through all the columns of a dataframe and modify the data type\n        to reduce memory usage.        \n    \"\"\"\n    start_mem = df.memory_usage().sum() / 1024**2\n    print('Memory usage of dataframe is {:.2f} MB'.format(start_mem))\n    \n    for col in df.columns:\n        col_type = df[col].dtype\n        \n        if col_type != object:\n            c_min = df[col].min()\n            c_max = df[col].max()\n            if str(col_type)[:3] == 'int':\n                if c_min > np.iinfo(np.int8).min and c_max < np.iinfo(np.int8).max:\n                    df[col] = df[col].astype(np.int8)\n                elif c_min > np.iinfo(np.int16).min and c_max < np.iinfo(np.int16).max:\n                    df[col] = df[col].astype(np.int16)\n                elif c_min > np.iinfo(np.int32).min and c_max < np.iinfo(np.int32).max:\n                    df[col] = df[col].astype(np.int32)\n                elif c_min > np.iinfo(np.int64).min and c_max < np.iinfo(np.int64).max:\n                    df[col] = df[col].astype(np.int64)  \n            else:\n                #adding condition to remove float16\n                if keep_float16:\n                    if c_min > np.finfo(np.float16).min and c_max < np.finfo(np.float16).max:\n                        df[col] = df[col].astype(np.float16)\n                    elif c_min > np.finfo(np.float32).min and c_max < np.finfo(np.float32).max:\n                        df[col] = df[col].astype(np.float32)\n                    else:\n                        df[col] = df[col].astype(np.float64)\n                else:\n                    if c_min > np.finfo(np.float16).min and c_max < np.finfo(np.float16).max:\n                        df[col] = df[col].astype(np.float32) \n                    elif c_min > np.finfo(np.float32).min and c_max < np.finfo(np.float32).max:\n                        df[col] = df[col].astype(np.float32)\n                    else:\n                        df[col] = df[col].astype(np.float64)\n        else:\n            df[col] = df[col].astype('category')\n\n    end_mem = df.memory_usage().sum() / 1024**2\n    print('Memory usage after optimization is: {:.2f} MB'.format(end_mem))\n    print('Decreased by {:.1f}%'.format(100 * (start_mem - end_mem) / start_mem))\n    \n    return df\n\n\ndef generate_new_columns(df):\n    # generate no_team_scores column\n    df = df.assign(no_team_scores = lambda x: 1 - (df['team_A_scoring_within_10sec'] + df['team_B_scoring_within_10sec']))\n    return df\n\ndef load_optimized_df_from_csv(file, keep_float16=True):\n    \"\"\"create a dataframe and optimize its memory usage\"\"\"\n    df = pd.read_csv(file, parse_dates=True, keep_date_col=True)\n    df = generate_new_columns(df)\n    df = reduce_mem_usage(df, keep_float16)\n    return df","metadata":{"id":"LwXPvYB5Z3Wd","execution":{"iopub.status.busy":"2022-10-30T17:33:46.957570Z","iopub.execute_input":"2022-10-30T17:33:46.958273Z","iopub.status.idle":"2022-10-30T17:33:46.979595Z","shell.execute_reply.started":"2022-10-30T17:33:46.958178Z","shell.execute_reply":"2022-10-30T17:33:46.978267Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def join_all_df(csv_files: list):\n  \"\"\" \n  Function to join all the optimized dataframes in one dataframe. \n  Args: list of file paths\n  \"\"\"\n  \n  df = pd.DataFrame()\n  for csv_path in csv_files:\n    df = pd.concat([df,load_optimized_df_from_csv(csv_path)],ignore_index=True)\n  \n  return df\n\ndef get_train_and_validation(df):\n  \"\"\"\n  Split a dataframe in train and validation.\n  \"\"\"\n\n  X_df = df[X_COLUMNS]\n  Y_df = df[Y_COLUMNS]\n  del df\n\n  X_train,X_val,Y_train,Y_val = train_test_split(X_df,Y_df,train_size=0.97)\n \n  #join x and y in the same df\n  X_train[Y_COLUMNS] = Y_train\n  X_val[Y_COLUMNS] = Y_val\n\n  return X_train,X_val","metadata":{"id":"V0g_SW9TYLLR","execution":{"iopub.status.busy":"2022-10-30T17:33:46.981650Z","iopub.execute_input":"2022-10-30T17:33:46.982240Z","iopub.status.idle":"2022-10-30T17:33:46.996318Z","shell.execute_reply.started":"2022-10-30T17:33:46.982194Z","shell.execute_reply":"2022-10-30T17:33:46.995155Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#MAIN PART - use of functions and declaration of global variables\n# CONSTANTS\nTRAIN_FILES,TEST_FILES = get_model_files()\ntrain_val_df = join_all_df(TRAIN_FILES)\n\n# excluded:  'player_scoring_next', 'team_scoring_next','game_num', 'event_id', 'event_time', \nX_COLUMNS = ['ball_pos_x', 'ball_pos_y', 'ball_pos_z', 'ball_vel_x', 'ball_vel_y', 'ball_vel_z', 'p0_pos_x', 'p0_pos_y', 'p0_pos_z', 'p0_vel_x', 'p0_vel_y', 'p0_vel_z', 'p0_boost', 'p1_pos_x', 'p1_pos_y', 'p1_pos_z', 'p1_vel_x', 'p1_vel_y', 'p1_vel_z', 'p1_boost', 'p2_pos_x', 'p2_pos_y', 'p2_pos_z', 'p2_vel_x', 'p2_vel_y', 'p2_vel_z', 'p2_boost', 'p3_pos_x', 'p3_pos_y', 'p3_pos_z', 'p3_vel_x', 'p3_vel_y', 'p3_vel_z', 'p3_boost', 'p4_pos_x', 'p4_pos_y', 'p4_pos_z', 'p4_vel_x', 'p4_vel_y', 'p4_vel_z', 'p4_boost', 'p5_pos_x', 'p5_pos_y', 'p5_pos_z', 'p5_vel_x', 'p5_vel_y', 'p5_vel_z', 'p5_boost', 'boost0_timer', 'boost1_timer', 'boost2_timer', 'boost3_timer', 'boost4_timer', 'boost5_timer']\nY_COLUMNS = ['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec','no_team_scores']","metadata":{"id":"jN-Mqp5Qc7XN","execution":{"iopub.status.busy":"2022-10-30T17:33:46.998100Z","iopub.execute_input":"2022-10-30T17:33:46.998920Z","iopub.status.idle":"2022-10-30T17:43:02.991376Z","shell.execute_reply.started":"2022-10-30T17:33:46.998871Z","shell.execute_reply":"2022-10-30T17:43:02.989154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Step 1 - Easy clean","metadata":{"id":"lAvKbT6lYSP-"}},{"cell_type":"code","source":"TRAIN_DF,VAL_DF = get_train_and_validation(train_val_df)","metadata":{"id":"_qyjEK8BMfa2","execution":{"iopub.status.busy":"2022-10-30T17:43:02.994681Z","iopub.execute_input":"2022-10-30T17:43:02.995132Z","iopub.status.idle":"2022-10-30T17:43:59.676675Z","shell.execute_reply.started":"2022-10-30T17:43:02.995098Z","shell.execute_reply":"2022-10-30T17:43:59.675318Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#TRAIN_DF.dtypes\nTRAIN_DF.fillna(0, inplace = True)\nVAL_DF.fillna(0, inplace = True)","metadata":{"execution":{"iopub.status.busy":"2022-10-30T17:43:59.679149Z","iopub.execute_input":"2022-10-30T17:43:59.679684Z","iopub.status.idle":"2022-10-30T17:44:05.232599Z","shell.execute_reply.started":"2022-10-30T17:43:59.679647Z","shell.execute_reply":"2022-10-30T17:44:05.230534Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Step 2 - Tensorflow model","metadata":{"id":"QBJ6dZGlYNmL"}},{"cell_type":"code","source":"#Not sure what this does and if it should go here\n#scaler = StandardScaler()\n#TRAIN_DF = scaler.fit_transform(TRAIN_DF)","metadata":{"id":"ZNri2Xkqvluj","outputId":"9622e56c-5f74-443e-ab72-2c6ae82073ea","execution":{"iopub.status.busy":"2022-10-30T17:44:05.237040Z","iopub.execute_input":"2022-10-30T17:44:05.237740Z","iopub.status.idle":"2022-10-30T17:44:05.246040Z","shell.execute_reply.started":"2022-10-30T17:44:05.237692Z","shell.execute_reply":"2022-10-30T17:44:05.244328Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# split into input (X) and output (y) variables\n\nX_TRAIN = TRAIN_DF.iloc[:,:-3]\nY_TRAIN = TRAIN_DF.iloc[:,-3:]\n\nVALIDATION = ((VAL_DF.iloc[:,:-3]),(VAL_DF.iloc[:,-3:]))\n#X_VALID = VAL_DF.iloc[:,:-3]\n#Y_VALID = VAL_DF.iloc[:,-3:]","metadata":{"id":"va5o0O56SPKH","outputId":"15d0b53b-ffb9-4fbe-9907-0594f9148033","execution":{"iopub.status.busy":"2022-10-30T17:44:05.247707Z","iopub.execute_input":"2022-10-30T17:44:05.249005Z","iopub.status.idle":"2022-10-30T17:44:09.761206Z","shell.execute_reply.started":"2022-10-30T17:44:05.248936Z","shell.execute_reply":"2022-10-30T17:44:09.759916Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"modelnn = Sequential()\nmodelnn.add(Dense(512, activation=\"leaky_relu\"))\nmodelnn.add(BatchNormalization())\nmodelnn.add(Dropout(0.2))\nmodelnn.add(Dense(256, activation=\"leaky_relu\"))\nmodelnn.add(BatchNormalization())\nmodelnn.add(Dropout(0.1))\nmodelnn.add(Dense(128, activation=\"leaky_relu\"))\nmodelnn.add(BatchNormalization())\nmodelnn.add(Dropout(0.1))\nmodelnn.add(Dense(64, activation=\"relu\"))\nmodelnn.add(BatchNormalization())\nmodelnn.add(Dropout(0.1))\nmodelnn.add(Dense(32, activation=\"relu\"))\nmodelnn.add(BatchNormalization())\nmodelnn.add(Dense(3, activation=\"softmax\"))\n\n\nopt = keras.optimizers.Adam(learning_rate=0.0001)\nloss_fn = tf.keras.losses.CategoricalCrossentropy()\n\nmodelnn.compile(loss=loss_fn, optimizer=opt, metrics = ['accuracy'])\n\nearly_stopping = keras.callbacks.EarlyStopping(\n    patience=30,\n    min_delta=0.001,\n    restore_best_weights=True,\n)","metadata":{"id":"rvNIPYF1SQsA","execution":{"iopub.status.busy":"2022-10-30T17:44:09.763018Z","iopub.execute_input":"2022-10-30T17:44:09.763528Z","iopub.status.idle":"2022-10-30T17:44:10.405204Z","shell.execute_reply.started":"2022-10-30T17:44:09.763484Z","shell.execute_reply":"2022-10-30T17:44:10.404291Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# fit the keras model on the dataset\nmodelnn.fit(X_TRAIN, Y_TRAIN,\n            epochs=5,\n            verbose=1)\n            \n            #validation_data= [VALIDATION])\n...","metadata":{"execution":{"iopub.status.busy":"2022-10-30T17:44:10.406620Z","iopub.execute_input":"2022-10-30T17:44:10.407554Z","iopub.status.idle":"2022-10-31T00:31:41.921991Z","shell.execute_reply.started":"2022-10-30T17:44:10.407515Z","shell.execute_reply":"2022-10-31T00:31:41.917964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Accuracy calc commented (not necessary ATM)\n\n# evaluate the keras model\n#_, accuracy = modelnn.evaluate(X_TRAIN, Y_TRAIN)\n#print('Accuracy: %.2f' % (accuracy*100))","metadata":{"id":"zhrEURR5STog","outputId":"34424771-0d8e-41a4-bd4a-dd9f9b7c5605","execution":{"iopub.status.busy":"2022-10-31T03:23:03.625691Z","iopub.execute_input":"2022-10-31T03:23:03.626210Z","iopub.status.idle":"2022-10-31T03:23:03.643246Z","shell.execute_reply.started":"2022-10-31T03:23:03.626161Z","shell.execute_reply":"2022-10-31T03:23:03.641405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission, test_input = TEST_FILES","metadata":{"execution":{"iopub.status.busy":"2022-10-31T00:31:41.942596Z","iopub.execute_input":"2022-10-31T00:31:41.943079Z","iopub.status.idle":"2022-10-31T00:31:41.960595Z","shell.execute_reply.started":"2022-10-31T00:31:41.943021Z","shell.execute_reply":"2022-10-31T00:31:41.959278Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# make probability predictions with the model\nTEST = pd.read_csv(test_input)\nX_TEST = TEST[X_COLUMNS]\n\npredictions = pd.DataFrame(modelnn.predict(X_TEST), \n                    columns=['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec','no_team_scores'],\n                    index=TEST.index)\n# round predictions ","metadata":{"id":"KNArn9q1SXVP","outputId":"4c4ca565-2cb1-4190-94c6-231a645a7e3b","execution":{"iopub.status.busy":"2022-10-31T00:31:41.962672Z","iopub.execute_input":"2022-10-31T00:31:41.963195Z","iopub.status.idle":"2022-10-31T00:33:07.990737Z","shell.execute_reply.started":"2022-10-31T00:31:41.963143Z","shell.execute_reply":"2022-10-31T00:33:07.989362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMIT = pd.read_csv(sample_submission)\nSUBMIT[['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec']] = predictions[['team_A_scoring_within_10sec','team_B_scoring_within_10sec']]","metadata":{"execution":{"iopub.status.busy":"2022-10-31T01:48:31.185084Z","iopub.execute_input":"2022-10-31T01:48:31.186236Z","iopub.status.idle":"2022-10-31T01:48:31.352019Z","shell.execute_reply.started":"2022-10-31T01:48:31.186196Z","shell.execute_reply":"2022-10-31T01:48:31.350757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMIT.to_csv('submission.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2022-10-31T00:49:32.935331Z","iopub.execute_input":"2022-10-31T00:49:32.935802Z","iopub.status.idle":"2022-10-31T00:49:35.066407Z","shell.execute_reply.started":"2022-10-31T00:49:32.935764Z","shell.execute_reply":"2022-10-31T00:49:35.065309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"predictions","metadata":{"execution":{"iopub.status.busy":"2022-10-31T01:48:18.189018Z","iopub.execute_input":"2022-10-31T01:48:18.189497Z","iopub.status.idle":"2022-10-31T01:48:18.206919Z","shell.execute_reply.started":"2022-10-31T01:48:18.189461Z","shell.execute_reply":"2022-10-31T01:48:18.205465Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SHARE = Y_TRAIN[Y_TRAIN['no_team_scores'] == 0].count() / Y_TRAIN['no_team_scores'].count()\nSHARE = SHARE[0]\nprint(SHARE)","metadata":{"execution":{"iopub.status.busy":"2022-10-31T01:43:51.222121Z","iopub.execute_input":"2022-10-31T01:43:51.223274Z","iopub.status.idle":"2022-10-31T01:43:51.379625Z","shell.execute_reply.started":"2022-10-31T01:43:51.223194Z","shell.execute_reply":"2022-10-31T01:43:51.378366Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMIT_v2 = SUBMIT\nSUBMIT_v2['order_goals'] = SUBMIT_v2['team_A_scoring_within_10sec'] + SUBMIT_v2['team_B_scoring_within_10sec']","metadata":{"execution":{"iopub.status.busy":"2022-10-31T01:48:49.158052Z","iopub.execute_input":"2022-10-31T01:48:49.158501Z","iopub.status.idle":"2022-10-31T01:48:49.166462Z","shell.execute_reply.started":"2022-10-31T01:48:49.158465Z","shell.execute_reply":"2022-10-31T01:48:49.164957Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"GOALS = round(SHARE * 701143)","metadata":{"execution":{"iopub.status.busy":"2022-10-31T02:32:48.259034Z","iopub.execute_input":"2022-10-31T02:32:48.259528Z","iopub.status.idle":"2022-10-31T02:32:48.265575Z","shell.execute_reply.started":"2022-10-31T02:32:48.259485Z","shell.execute_reply":"2022-10-31T02:32:48.264266Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ids = []\nids = SUBMIT_v2.nlargest(GOALS, ['order_goals'])['id'].tolist()\nprint(max(ids))","metadata":{"execution":{"iopub.status.busy":"2022-10-31T02:34:02.138362Z","iopub.execute_input":"2022-10-31T02:34:02.138862Z","iopub.status.idle":"2022-10-31T02:34:02.193461Z","shell.execute_reply.started":"2022-10-31T02:34:02.138826Z","shell.execute_reply":"2022-10-31T02:34:02.192322Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(SUBMIT_v2['team_A_scoring_within_10sec'][0])\nprint(SUBMIT_v2[['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec']].max(axis=1)[0])\nprint(SUBMIT_v2[['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec']].min(axis=1)[0])","metadata":{"execution":{"iopub.status.busy":"2022-10-31T02:34:17.348941Z","iopub.execute_input":"2022-10-31T02:34:17.349404Z","iopub.status.idle":"2022-10-31T02:34:17.385245Z","shell.execute_reply.started":"2022-10-31T02:34:17.349360Z","shell.execute_reply":"2022-10-31T02:34:17.384300Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for index, row in SUBMIT_v2.iterrows():\n    if index in ids:\n        print(index)\n        print(row['team_A_scoring_within_10sec'])","metadata":{"execution":{"iopub.status.busy":"2022-10-31T02:38:32.733884Z","iopub.execute_input":"2022-10-31T02:38:32.734428Z","iopub.status.idle":"2022-10-31T02:38:34.745572Z","shell.execute_reply.started":"2022-10-31T02:38:32.734391Z","shell.execute_reply":"2022-10-31T02:38:34.744089Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data = []\n\nfor index, row in SUBMIT_v2.iterrows():\n    if index in ids:\n        if row['team_A_scoring_within_10sec'] == row[['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec']].max():\n            data.append([index, 1, 0])\n        if row['team_B_scoring_within_10sec'] == row[['team_A_scoring_within_10sec', 'team_B_scoring_within_10sec']].max():\n            data.append([index, 0, 1])\n    else:\n        data.append([index, 0, 0])\n        ","metadata":{"execution":{"iopub.status.busy":"2022-10-31T03:00:07.241370Z","iopub.execute_input":"2022-10-31T03:00:07.241757Z","iopub.status.idle":"2022-10-31T03:19:54.741615Z","shell.execute_reply.started":"2022-10-31T03:00:07.241726Z","shell.execute_reply":"2022-10-31T03:19:54.740547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMISSION = pd.DataFrame(data)","metadata":{"execution":{"iopub.status.busy":"2022-10-31T03:19:54.745030Z","iopub.execute_input":"2022-10-31T03:19:54.745419Z","iopub.status.idle":"2022-10-31T03:19:55.358803Z","shell.execute_reply.started":"2022-10-31T03:19:54.745384Z","shell.execute_reply":"2022-10-31T03:19:55.357372Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMISSION = SUBMISSION.rename(columns={0: \"id\", 1:\"team_A_scoring_within_10sec\", 2:\"team_B_scoring_within_10sec\"})","metadata":{"execution":{"iopub.status.busy":"2022-10-31T03:19:55.360383Z","iopub.execute_input":"2022-10-31T03:19:55.361296Z","iopub.status.idle":"2022-10-31T03:19:55.372242Z","shell.execute_reply.started":"2022-10-31T03:19:55.361263Z","shell.execute_reply":"2022-10-31T03:19:55.371103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMISSION.to_csv('submission_v2.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2022-10-31T03:19:55.374894Z","iopub.execute_input":"2022-10-31T03:19:55.375656Z","iopub.status.idle":"2022-10-31T03:19:56.180885Z","shell.execute_reply.started":"2022-10-31T03:19:55.375610Z","shell.execute_reply":"2022-10-31T03:19:56.180025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"SUBMISSION","metadata":{"execution":{"iopub.status.busy":"2022-10-31T03:20:50.600421Z","iopub.execute_input":"2022-10-31T03:20:50.600849Z","iopub.status.idle":"2022-10-31T03:20:50.616062Z","shell.execute_reply.started":"2022-10-31T03:20:50.600817Z","shell.execute_reply":"2022-10-31T03:20:50.615049Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}