{"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":"# Is the Analysis Target only during the Game? [EDA]\n\nWhen I checked the mp4 file, I noticed that it included pre- and post-match footage.  \nTherefore, it is checked whether the analysis target is only during the game.  \n\n[DFL - Bundesliga Data Shootout](https://www.kaggle.com/competitions/dfl-bundesliga-data-shootout) challenge    \n","metadata":{}},{"cell_type":"code","source":"!pip install moviepy -q","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:13.932890Z","iopub.execute_input":"2022-08-01T20:14:13.933309Z","iopub.status.idle":"2022-08-01T20:14:46.491113Z","shell.execute_reply.started":"2022-08-01T20:14:13.933275Z","shell.execute_reply":"2022-08-01T20:14:46.489827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"####################\n# Import libraries\n####################\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sn\nplt.style.use(['default']) \n\nfrom moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip\nfrom IPython.display import Video\nfrom IPython.display import display","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.494324Z","iopub.execute_input":"2022-08-01T20:14:46.495013Z","iopub.status.idle":"2022-08-01T20:14:46.863441Z","shell.execute_reply.started":"2022-08-01T20:14:46.494951Z","shell.execute_reply":"2022-08-01T20:14:46.861779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def show_df(df, head=True):\n    \"\"\"Just show DataFrame\n    \"\"\"\n    print(df.shape)\n    if head:\n        display(df.head())\n    else:\n        display(df.tail())","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.865529Z","iopub.execute_input":"2022-08-01T20:14:46.865920Z","iopub.status.idle":"2022-08-01T20:14:46.873426Z","shell.execute_reply.started":"2022-08-01T20:14:46.865882Z","shell.execute_reply":"2022-08-01T20:14:46.872033Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Read_csv","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv(\"../input/dfl-bundesliga-data-shootout/train.csv\")\nshow_df(df)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.875392Z","iopub.execute_input":"2022-08-01T20:14:46.875948Z","iopub.status.idle":"2022-08-01T20:14:46.939116Z","shell.execute_reply.started":"2022-08-01T20:14:46.875883Z","shell.execute_reply":"2022-08-01T20:14:46.937942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Check the \"min_time\" and \"max_time\" of each video_id. ","metadata":{}},{"cell_type":"code","source":"tmp = pd.concat([\n    df[['video_id', 'time']].groupby(['video_id']).min(),\n    df[['video_id', 'time']].groupby(['video_id']).max()\n    ],\n          axis=1\n)\ntmp.columns = [\"Min_time\", 'Max_time']\ntmp","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.942623Z","iopub.execute_input":"2022-08-01T20:14:46.942998Z","iopub.status.idle":"2022-08-01T20:14:46.977465Z","shell.execute_reply.started":"2022-08-01T20:14:46.942965Z","shell.execute_reply":"2022-08-01T20:14:46.976321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"↑ [Notice]  \nThere are no events for the first three minutes (about) of any video.  ","metadata":{}},{"cell_type":"markdown","source":"# Visualize and Check the Video \nVisualize the video to see what Min_Time and Max_Time look like.  ","metadata":{}},{"cell_type":"code","source":"def vis_event(row, before=5, after=5):\n    '''前後5secの動画をmp.4から出力する。\n    '''\n    print(row[\"event_attributes\"])\n    filename = f\"test_{row['index']}.mp4\"\n    ffmpeg_extract_subclip(\n        f\"../input/dfl-bundesliga-data-shootout/train/{row['video_id']}.mp4\", \n        int(row['time']) - before, \n        int(row['time']) + after, \n        targetname=filename,\n    )\n    \n    return Video(filename, width=800)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.979017Z","iopub.execute_input":"2022-08-01T20:14:46.979342Z","iopub.status.idle":"2022-08-01T20:14:46.986990Z","shell.execute_reply.started":"2022-08-01T20:14:46.979313Z","shell.execute_reply":"2022-08-01T20:14:46.985658Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"###### ↑ This method is from [⚽DFL - Bundesliga Data Shootout⚽ - Exploratory Data Analysis](https://www.kaggle.com/code/ihelon/bundesliga-data-shootout-eda) by Yaroslav Isaienkov","metadata":{}},{"cell_type":"markdown","source":"#### 01. Case of \"1606b0e6_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"1606b0e6_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:46.988365Z","iopub.execute_input":"2022-08-01T20:14:46.988893Z","iopub.status.idle":"2022-08-01T20:14:47.001036Z","shell.execute_reply.started":"2022-08-01T20:14:46.988861Z","shell.execute_reply":"2022-08-01T20:14:47Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:47.002539Z","iopub.execute_input":"2022-08-01T20:14:47.003309Z","iopub.status.idle":"2022-08-01T20:14:47.411268Z","shell.execute_reply.started":"2022-08-01T20:14:47.003269Z","shell.execute_reply":"2022-08-01T20:14:47.409829Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:47.413557Z","iopub.execute_input":"2022-08-01T20:14:47.414047Z","iopub.status.idle":"2022-08-01T20:14:48.099292Z","shell.execute_reply.started":"2022-08-01T20:14:47.413995Z","shell.execute_reply":"2022-08-01T20:14:48.097827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"↑ [Notice]  \nThe min_time of the video is \"Kick_off\".   \nThe max_time of the video is \"Time_up\".   \n\nSo, the events is only on the game.  ","metadata":{}},{"cell_type":"markdown","source":"#### 02. Case of \"1606b0e6_1\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"1606b0e6_1\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:48.101300Z","iopub.execute_input":"2022-08-01T20:14:48.101650Z","iopub.status.idle":"2022-08-01T20:14:48.106117Z","shell.execute_reply.started":"2022-08-01T20:14:48.101616Z","shell.execute_reply":"2022-08-01T20:14:48.105268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:48.107630Z","iopub.execute_input":"2022-08-01T20:14:48.108285Z","iopub.status.idle":"2022-08-01T20:14:48.387745Z","shell.execute_reply.started":"2022-08-01T20:14:48.108251Z","shell.execute_reply":"2022-08-01T20:14:48.386355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:48.389998Z","iopub.execute_input":"2022-08-01T20:14:48.391235Z","iopub.status.idle":"2022-08-01T20:14:48.893652Z","shell.execute_reply.started":"2022-08-01T20:14:48.391186Z","shell.execute_reply":"2022-08-01T20:14:48.892595Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 03. Case of \"35bd9041_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"35bd9041_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:48.895362Z","iopub.execute_input":"2022-08-01T20:14:48.896529Z","iopub.status.idle":"2022-08-01T20:14:48.901170Z","shell.execute_reply.started":"2022-08-01T20:14:48.896489Z","shell.execute_reply":"2022-08-01T20:14:48.900269Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:48.908020Z","iopub.execute_input":"2022-08-01T20:14:48.908697Z","iopub.status.idle":"2022-08-01T20:14:49.122030Z","shell.execute_reply.started":"2022-08-01T20:14:48.908660Z","shell.execute_reply":"2022-08-01T20:14:49.120560Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:49.124714Z","iopub.execute_input":"2022-08-01T20:14:49.125217Z","iopub.status.idle":"2022-08-01T20:14:49.698111Z","shell.execute_reply.started":"2022-08-01T20:14:49.125165Z","shell.execute_reply":"2022-08-01T20:14:49.697003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 04. Case of \"35bd9041_1\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"35bd9041_1\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:49.700075Z","iopub.execute_input":"2022-08-01T20:14:49.700763Z","iopub.status.idle":"2022-08-01T20:14:49.706531Z","shell.execute_reply.started":"2022-08-01T20:14:49.700712Z","shell.execute_reply":"2022-08-01T20:14:49.705374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:49.708275Z","iopub.execute_input":"2022-08-01T20:14:49.709301Z","iopub.status.idle":"2022-08-01T20:14:49.943042Z","shell.execute_reply.started":"2022-08-01T20:14:49.709253Z","shell.execute_reply":"2022-08-01T20:14:49.942004Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:49.945448Z","iopub.execute_input":"2022-08-01T20:14:49.945891Z","iopub.status.idle":"2022-08-01T20:14:50.648496Z","shell.execute_reply.started":"2022-08-01T20:14:49.945849Z","shell.execute_reply":"2022-08-01T20:14:50.647040Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 05. Case of \"3c993bd2_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"3c993bd2_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:50.650325Z","iopub.execute_input":"2022-08-01T20:14:50.650824Z","iopub.status.idle":"2022-08-01T20:14:50.660074Z","shell.execute_reply.started":"2022-08-01T20:14:50.650773Z","shell.execute_reply":"2022-08-01T20:14:50.659022Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:50.661570Z","iopub.execute_input":"2022-08-01T20:14:50.662433Z","iopub.status.idle":"2022-08-01T20:14:51.134272Z","shell.execute_reply.started":"2022-08-01T20:14:50.662392Z","shell.execute_reply":"2022-08-01T20:14:51.133087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:51.136920Z","iopub.execute_input":"2022-08-01T20:14:51.138413Z","iopub.status.idle":"2022-08-01T20:14:51.852093Z","shell.execute_reply.started":"2022-08-01T20:14:51.138372Z","shell.execute_reply":"2022-08-01T20:14:51.850664Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 06. Case of \"3c993bd2_1\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"3c993bd2_1\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:51.854174Z","iopub.execute_input":"2022-08-01T20:14:51.855378Z","iopub.status.idle":"2022-08-01T20:14:51.861410Z","shell.execute_reply.started":"2022-08-01T20:14:51.855328Z","shell.execute_reply":"2022-08-01T20:14:51.860322Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:51.863084Z","iopub.execute_input":"2022-08-01T20:14:51.863670Z","iopub.status.idle":"2022-08-01T20:14:52.123004Z","shell.execute_reply.started":"2022-08-01T20:14:51.863635Z","shell.execute_reply":"2022-08-01T20:14:52.121766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:52.125322Z","iopub.execute_input":"2022-08-01T20:14:52.126612Z","iopub.status.idle":"2022-08-01T20:14:52.947841Z","shell.execute_reply.started":"2022-08-01T20:14:52.126558Z","shell.execute_reply":"2022-08-01T20:14:52.946395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 07. Case of \"407c5a9e_1\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"407c5a9e_1\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:52.949698Z","iopub.execute_input":"2022-08-01T20:14:52.950190Z","iopub.status.idle":"2022-08-01T20:14:52.956549Z","shell.execute_reply.started":"2022-08-01T20:14:52.950146Z","shell.execute_reply":"2022-08-01T20:14:52.955599Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:52.957849Z","iopub.execute_input":"2022-08-01T20:14:52.959111Z","iopub.status.idle":"2022-08-01T20:14:53.177566Z","shell.execute_reply.started":"2022-08-01T20:14:52.959069Z","shell.execute_reply":"2022-08-01T20:14:53.176206Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:53.179763Z","iopub.execute_input":"2022-08-01T20:14:53.180154Z","iopub.status.idle":"2022-08-01T20:14:53.791172Z","shell.execute_reply.started":"2022-08-01T20:14:53.180118Z","shell.execute_reply":"2022-08-01T20:14:53.788911Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 08. Case of \"4ffd5986_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"4ffd5986_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:53.794113Z","iopub.execute_input":"2022-08-01T20:14:53.795122Z","iopub.status.idle":"2022-08-01T20:14:53.801111Z","shell.execute_reply.started":"2022-08-01T20:14:53.795064Z","shell.execute_reply":"2022-08-01T20:14:53.799895Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:53.803219Z","iopub.execute_input":"2022-08-01T20:14:53.804104Z","iopub.status.idle":"2022-08-01T20:14:54.189893Z","shell.execute_reply.started":"2022-08-01T20:14:53.804056Z","shell.execute_reply":"2022-08-01T20:14:54.188431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:54.192556Z","iopub.execute_input":"2022-08-01T20:14:54.193479Z","iopub.status.idle":"2022-08-01T20:14:54.975596Z","shell.execute_reply.started":"2022-08-01T20:14:54.193428Z","shell.execute_reply":"2022-08-01T20:14:54.974272Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 09. Case of \"cfbe2e94_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"cfbe2e94_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:54.977370Z","iopub.execute_input":"2022-08-01T20:14:54.977746Z","iopub.status.idle":"2022-08-01T20:14:54.983405Z","shell.execute_reply.started":"2022-08-01T20:14:54.977707Z","shell.execute_reply":"2022-08-01T20:14:54.982475Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:54.984943Z","iopub.execute_input":"2022-08-01T20:14:54.985623Z","iopub.status.idle":"2022-08-01T20:14:55.268865Z","shell.execute_reply.started":"2022-08-01T20:14:54.985588Z","shell.execute_reply":"2022-08-01T20:14:55.267819Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:55.270631Z","iopub.execute_input":"2022-08-01T20:14:55.271027Z","iopub.status.idle":"2022-08-01T20:14:55.878175Z","shell.execute_reply.started":"2022-08-01T20:14:55.270987Z","shell.execute_reply":"2022-08-01T20:14:55.877068Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 10. Case of \"cfbe2e94_1\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"cfbe2e94_1\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:55.879569Z","iopub.execute_input":"2022-08-01T20:14:55.880054Z","iopub.status.idle":"2022-08-01T20:14:55.885733Z","shell.execute_reply.started":"2022-08-01T20:14:55.879905Z","shell.execute_reply":"2022-08-01T20:14:55.884594Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:55.887232Z","iopub.execute_input":"2022-08-01T20:14:55.888129Z","iopub.status.idle":"2022-08-01T20:14:56.174886Z","shell.execute_reply.started":"2022-08-01T20:14:55.888091Z","shell.execute_reply":"2022-08-01T20:14:56.173852Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:56.176589Z","iopub.execute_input":"2022-08-01T20:14:56.177738Z","iopub.status.idle":"2022-08-01T20:14:56.703561Z","shell.execute_reply.started":"2022-08-01T20:14:56.177699Z","shell.execute_reply":"2022-08-01T20:14:56.702281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 11. Case of \"ecf251d4_0\"","metadata":{}},{"cell_type":"code","source":"vide0_id = \"ecf251d4_0\"","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:56.705876Z","iopub.execute_input":"2022-08-01T20:14:56.707091Z","iopub.status.idle":"2022-08-01T20:14:56.715287Z","shell.execute_reply.started":"2022-08-01T20:14:56.707032Z","shell.execute_reply":"2022-08-01T20:14:56.713757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the min_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video)\nvis_event(df_video.iloc[0])","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:56.717521Z","iopub.execute_input":"2022-08-01T20:14:56.718393Z","iopub.status.idle":"2022-08-01T20:14:57.062320Z","shell.execute_reply.started":"2022-08-01T20:14:56.718343Z","shell.execute_reply":"2022-08-01T20:14:57.061180Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Check the max_time of the video\ndf_video = df[df.video_id==vide0_id].reset_index()\nshow_df(df_video, head=False)\nvis_event(df_video.iloc[-1], before=5, after=30)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T20:14:57.064257Z","iopub.execute_input":"2022-08-01T20:14:57.064599Z","iopub.status.idle":"2022-08-01T20:14:57.800621Z","shell.execute_reply.started":"2022-08-01T20:14:57.064566Z","shell.execute_reply":"2022-08-01T20:14:57.799474Z"},"trusted":true},"execution_count":null,"outputs":[]}]}