{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceType":"competition","sourceId":127283,"databundleVersionId":15634477}],"dockerImageVersionId":31259,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport glob\nimport os\nimport numpy as np\nimport random\n\nvideo_paths = glob.glob(\"/kaggle/input/accident/videos/*.mp4\")\n\nsubmission_paths = [p.replace(\"/kaggle/input/accident/\", \"\") for p in video_paths]\n\n# Get the number of videos\nn = len(submission_paths)\n\n# Set random seed for reproducibility (optional)\nnp.random.seed(42)\nrandom.seed(42)  # Also seed Python's random for consistency\n\n# Define accident types\n#accident_types = ['head-on', 'rear-end', 'sideswipe', 'single', 't-bone']\n\naccident_types = ['single']\n\n# Create dataframe with random values using numpy and random\ndf = pd.DataFrame({\n    'path': submission_paths,\n    'accident_time': np.round(np.random.uniform(3.5, 5.5, n), 2),\n    'center_x': np.round(np.random.uniform(0.35, 0.55555, n), 5),\n    'center_y': np.round(np.random.uniform(0.35, 0.55555, n), 5),\n    'type': [random.choice(accident_types) for _ in range(n)]\n})\n\ndf.to_csv(\"submission.csv\", index=False)\n\ndf.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-14T05:22:08.089821Z","iopub.execute_input":"2026-02-14T05:22:08.090726Z","iopub.status.idle":"2026-02-14T05:22:08.123421Z","shell.execute_reply.started":"2026-02-14T05:22:08.090690Z","shell.execute_reply":"2026-02-14T05:22:08.122316Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(f\"\\nTotal videos: {n}\")\nprint(f\"Accident time range: {df['accident_time'].min():.2f} - {df['accident_time'].max():.2f}\")\nprint(f\"Center X range: {df['center_x'].min():.5f} - {df['center_x'].max():.5f}\")\nprint(f\"Center Y range: {df['center_y'].min():.5f} - {df['center_y'].max():.5f}\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-14T05:22:08.124991Z","iopub.execute_input":"2026-02-14T05:22:08.125349Z","iopub.status.idle":"2026-02-14T05:22:08.132862Z","shell.execute_reply.started":"2026-02-14T05:22:08.125324Z","shell.execute_reply":"2026-02-14T05:22:08.131383Z"}},"outputs":[],"execution_count":null}]}