{"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\n\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":"2022-11-11T06:27:05.888000Z","iopub.execute_input":"2022-11-11T06:27:05.888935Z","iopub.status.idle":"2022-11-11T06:27:05.922511Z","shell.execute_reply.started":"2022-11-11T06:27:05.888790Z","shell.execute_reply":"2022-11-11T06:27:05.921095Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import 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 #graphing\nimport plotly.express as px #graphing\nimport seaborn as sns #graphing\n\nfrom plotly.offline import plot, iplot, init_notebook_mode\nimport plotly.graph_objs as go\ninit_notebook_mode(connected=True)\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n        \npd.set_option('display.max_columns', None)  ","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:27:21.038894Z","iopub.execute_input":"2022-11-11T06:27:21.039442Z","iopub.status.idle":"2022-11-11T06:27:22.976854Z","shell.execute_reply.started":"2022-11-11T06:27:21.039389Z","shell.execute_reply":"2022-11-11T06:27:22.975277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/tabular-playground-series-oct-2022/train_0.csv\")\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:27:59.580895Z","iopub.execute_input":"2022-11-11T06:27:59.581306Z","iopub.status.idle":"2022-11-11T06:28:44.951670Z","shell.execute_reply.started":"2022-11-11T06:27:59.581271Z","shell.execute_reply":"2022-11-11T06:28:44.950515Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:29:45.532465Z","iopub.execute_input":"2022-11-11T06:29:45.532875Z","iopub.status.idle":"2022-11-11T06:29:45.603631Z","shell.execute_reply.started":"2022-11-11T06:29:45.532809Z","shell.execute_reply":"2022-11-11T06:29:45.602331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:30:06.677692Z","iopub.execute_input":"2022-11-11T06:30:06.678094Z","iopub.status.idle":"2022-11-11T06:30:06.686628Z","shell.execute_reply.started":"2022-11-11T06:30:06.678061Z","shell.execute_reply":"2022-11-11T06:30:06.685321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:30:16.181045Z","iopub.execute_input":"2022-11-11T06:30:16.181458Z","iopub.status.idle":"2022-11-11T06:30:16.210974Z","shell.execute_reply.started":"2022-11-11T06:30:16.181422Z","shell.execute_reply":"2022-11-11T06:30:16.209253Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"corr = df.corr()\nsns.set(rc = {\"figure.figsize\": (15, 8)})\n\nsns.heatmap(corr, xticklabels = corr.columns, yticklabels = corr.columns, cmap = \"Spectral\")","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:30:33.543468Z","iopub.execute_input":"2022-11-11T06:30:33.543934Z","iopub.status.idle":"2022-11-11T06:30:58.534674Z","shell.execute_reply.started":"2022-11-11T06:30:33.543895Z","shell.execute_reply":"2022-11-11T06:30:58.533626Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.ball_pos_x.max()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:31:10.895096Z","iopub.execute_input":"2022-11-11T06:31:10.895516Z","iopub.status.idle":"2022-11-11T06:31:10.909621Z","shell.execute_reply.started":"2022-11-11T06:31:10.895484Z","shell.execute_reply":"2022-11-11T06:31:10.908296Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.ball_pos_x.min()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:31:19.389516Z","iopub.execute_input":"2022-11-11T06:31:19.389982Z","iopub.status.idle":"2022-11-11T06:31:19.403987Z","shell.execute_reply.started":"2022-11-11T06:31:19.389943Z","shell.execute_reply":"2022-11-11T06:31:19.402637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_x = df.iloc[:1540]\ndf_x.ball_pos_x.plot()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:31:32.547031Z","iopub.execute_input":"2022-11-11T06:31:32.547460Z","iopub.status.idle":"2022-11-11T06:31:32.883586Z","shell.execute_reply.started":"2022-11-11T06:31:32.547427Z","shell.execute_reply":"2022-11-11T06:31:32.882282Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_x.ball_pos_y.plot()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:31:42.808508Z","iopub.execute_input":"2022-11-11T06:31:42.809829Z","iopub.status.idle":"2022-11-11T06:31:43.082084Z","shell.execute_reply.started":"2022-11-11T06:31:42.809782Z","shell.execute_reply":"2022-11-11T06:31:43.080902Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.ball_pos_y.max()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:31:53.922552Z","iopub.execute_input":"2022-11-11T06:31:53.923011Z","iopub.status.idle":"2022-11-11T06:31:53.938446Z","shell.execute_reply.started":"2022-11-11T06:31:53.922973Z","shell.execute_reply":"2022-11-11T06:31:53.937186Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.ball_pos_y.min()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:04.794826Z","iopub.execute_input":"2022-11-11T06:32:04.795304Z","iopub.status.idle":"2022-11-11T06:32:04.810628Z","shell.execute_reply.started":"2022-11-11T06:32:04.795263Z","shell.execute_reply":"2022-11-11T06:32:04.808891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.ball_pos_z.min()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:13.514192Z","iopub.execute_input":"2022-11-11T06:32:13.514593Z","iopub.status.idle":"2022-11-11T06:32:13.529095Z","shell.execute_reply.started":"2022-11-11T06:32:13.514561Z","shell.execute_reply":"2022-11-11T06:32:13.527327Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_team_A = df.iloc[:15000]\ndf_team_A.team_A_scoring_within_10sec.plot()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:24.788976Z","iopub.execute_input":"2022-11-11T06:32:24.789419Z","iopub.status.idle":"2022-11-11T06:32:25.046694Z","shell.execute_reply.started":"2022-11-11T06:32:24.789376Z","shell.execute_reply":"2022-11-11T06:32:25.045561Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_team_A.player_scoring_next.plot()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:38.256696Z","iopub.execute_input":"2022-11-11T06:32:38.257886Z","iopub.status.idle":"2022-11-11T06:32:38.580666Z","shell.execute_reply.started":"2022-11-11T06:32:38.257809Z","shell.execute_reply":"2022-11-11T06:32:38.579269Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.p0_vel_x.hist()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:49.339769Z","iopub.execute_input":"2022-11-11T06:32:49.341102Z","iopub.status.idle":"2022-11-11T06:32:49.713691Z","shell.execute_reply.started":"2022-11-11T06:32:49.341056Z","shell.execute_reply":"2022-11-11T06:32:49.712552Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.p0_vel_y.hist()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:32:59.017729Z","iopub.execute_input":"2022-11-11T06:32:59.018933Z","iopub.status.idle":"2022-11-11T06:32:59.391450Z","shell.execute_reply.started":"2022-11-11T06:32:59.018881Z","shell.execute_reply":"2022-11-11T06:32:59.390316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.p0_boost.hist()\n","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:33:07.869893Z","iopub.execute_input":"2022-11-11T06:33:07.870307Z","iopub.status.idle":"2022-11-11T06:33:08.232353Z","shell.execute_reply.started":"2022-11-11T06:33:07.870275Z","shell.execute_reply":"2022-11-11T06:33:08.231132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_pos = df.iloc[:30000]\nfig = px.density_heatmap(df_pos, x=\"ball_pos_y\", y=\"ball_pos_x\", nbinsx = 250, nbinsy = 175, color_continuous_scale = \"Portland\", range_color=(0, 3.6))\nfig.update_layout(template = \"plotly_dark\", font = dict(family = \"PT Sans\", size = 12, color = \"#FFFFFF\"))\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:33:23.321557Z","iopub.execute_input":"2022-11-11T06:33:23.322728Z","iopub.status.idle":"2022-11-11T06:33:24.480024Z","shell.execute_reply.started":"2022-11-11T06:33:23.322666Z","shell.execute_reply":"2022-11-11T06:33:24.478825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.density_heatmap(df_pos, x=\"ball_pos_y\", y=\"ball_pos_z\", nbinsx = 250, nbinsy = 200, color_continuous_scale = \"Portland\", range_color=(0, 3.6))\nfig.update_layout(template = \"plotly_dark\", font = dict(family = \"PT Sans\", size = 12, color = \"#FFFFFF\"))\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:33:39.051593Z","iopub.execute_input":"2022-11-11T06:33:39.052733Z","iopub.status.idle":"2022-11-11T06:33:39.207266Z","shell.execute_reply.started":"2022-11-11T06:33:39.052692Z","shell.execute_reply":"2022-11-11T06:33:39.206045Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df0 = df.iloc[:5000]\ncolors = [\"#9B000A\", \"#9B000A\", \"#9B000A\", \"#0A009B\", \"#0A009B\", \"#0A009B\"]\n\nfor i in range(6):\n    \n    fig = px.line_3d(df0, x=f\"p{i}_pos_x\", y=f\"p{i}_pos_y\", z=f\"p{i}_pos_z\")\n    fig.update_layout(template = \"plotly_dark\", font = dict(family = \"PT Sans\", size = 12, color = \"#FFFFFF\"))\n    fig.update_layout(scene = dict(\n                    xaxis = dict(\n                         backgroundcolor=\"#00B60C\",\n                         gridcolor=\"white\",\n                         showbackground=True,\n                         zerolinecolor=\"white\",),\n                    yaxis = dict(\n                        backgroundcolor=\"#00B60C\",\n                        gridcolor=\"white\",\n                        showbackground=True,\n                        zerolinecolor=\"white\"),\n                    zaxis = dict(\n                        backgroundcolor=\"#00B60C\",\n                        gridcolor=\"white\",\n                        showbackground=True,\n                        zerolinecolor=\"white\",),),\n                    width=700,\n                    margin=dict(\n                    r=10, l=10,\n                    b=10, t=10)\n                  )\n    fig.update_traces(line_color = colors[i], textposition = \"top center\")\n    fig.show()","metadata":{"execution":{"iopub.status.busy":"2022-11-11T06:34:04.984221Z","iopub.execute_input":"2022-11-11T06:34:04.984698Z","iopub.status.idle":"2022-11-11T06:34:05.705061Z","shell.execute_reply.started":"2022-11-11T06:34:04.984654Z","shell.execute_reply":"2022-11-11T06:34:05.703656Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}