{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":112899,"databundleVersionId":13449579,"sourceType":"competition"}],"dockerImageVersionId":31089,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## Setup & Data Loading","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport warnings\nwarnings.filterwarnings('ignore')\n\n!pip install --upgrade plotly\n\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom datetime import datetime, timedelta\n\nplt.style.use('seaborn-v0_8-darkgrid')\nsns.set_palette(\"husl\")\n\nprint(\"Libraries loaded successfully!\")","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Load both weeks' data for comparison\ndf_w2 = pd.read_csv('/kaggle/input/division-a-leaderboard-w3/Leaderboard_A_W2.csv')\ndf_w3 = pd.read_csv('/kaggle/input/division-a-leaderboard-w3/Leaderboard_A_W3.csv')\n\nprint(f\"Week 2 leaderboard: {len(df_w2)} teams\")\nprint(f\"Week 3 leaderboard: {len(df_w3)} teams\")\nprint(f\"New teams this week: {len(df_w3) - len(df_w2)}\")\n\nprint(\"\\n📊 WEEK 3 TOP 5 TEAMS:\")\nprint(\"=\" * 60)\ntop_5 = df_w3.head()\nfor _, row in top_5.iterrows():\n    print(f\"{row['Rank']:2d}. {row['TeamName'][:25]:<25} | Score: {row['Score']:.6f}\")","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Week-over-week metrics\nmetrics_comparison = {\n    'Metric': ['Total Entrants', 'Active Participants', 'Competing Teams', 'Total Submissions'],\n    'Week 2': [217, 34, 34, 99],\n    'Week 3': [320, 63, 61, 256],\n    'Growth': [103, 29, 27, 157],\n    'Growth %': [47.5, 85.3, 79.4, 158.6]\n}\n\nmetrics_df = pd.DataFrame(metrics_comparison)\n\nfig = make_subplots(\n    rows=2, cols=2,\n    subplot_titles=('Growth in Numbers', 'Growth Percentage', 'Submission Trends', 'Team Activity'),\n    specs=[[{'type': 'bar'}, {'type': 'bar'}], \n           [{'type': 'scatter'}, {'type': 'histogram'}]]\n)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Growth in absolute numbers\nfig.add_trace(\n    go.Bar(x=metrics_df['Metric'], y=metrics_df['Week 2'], name='Week 2', marker_color='lightblue'),\n    row=1, col=1\n)\nfig.add_trace(\n    go.Bar(x=metrics_df['Metric'], y=metrics_df['Week 3'], name='Week 3', marker_color='darkblue'),\n    row=1, col=1\n)\n\n# Growth percentage\nfig.add_trace(\n    go.Bar(x=metrics_df['Metric'], y=metrics_df['Growth %'], \n           name='Growth %', marker_color='green', showlegend=False),\n    row=1, col=2\n)\n\n# Submission trends\nweeks = ['Week 2', 'Week 3']\nsubmissions = [99, 256]\nfig.add_trace(\n    go.Scatter(x=weeks, y=submissions, mode='lines+markers', \n               name='Submissions', line=dict(width=4), showlegend=False),\n    row=2, col=1\n)\n\n# Team activity distribution\nfig.add_trace(\n    go.Histogram(x=df_w3['SubmissionCount'], nbinsx=15, \n                 name='Team Activity', marker_color='orange', showlegend=False),\n    row=2, col=2\n)\n\nfig.update_layout(\n    height=800,\n    title_text=\"📈 Week 2 → Week 3 Growth Analysis\",\n    showlegend=True\n)\n\nfig.show()\n\nprint(\"🚀 GROWTH HIGHLIGHTS:\")\nprint(f\"   • Submissions surged by {metrics_df.loc[3, 'Growth %']:.1f}% - highest growth metric\")\nprint(f\"   • Active participants increased by {metrics_df.loc[1, 'Growth %']:.1f}%\")\nprint(f\"   • Competition intensity: {(256/61):.1f} submissions per team avg\")","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}