{"cells":[{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"import os\nimport pandas as pd\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nf = open('/kaggle/input/leaderboard-scores/private_scores.csv')\nlines = f.readlines()\nlines = [v.rstrip('\\n') for v in lines]\n\nteams = lines[2::8]\nscores = lines[5::8]\n\n\nteams = []\nscores = []\n\nfor i in range(len(lines)):\n    line = lines[i]\n    if line.isnumeric():\n        if i >= 8:\n            prev_score = float(lines[i - 3][1:])\n            scores.append(prev_score)\n            \n        team = lines[i + 2][1:]\n        teams.append(team)\nlast_score = float(lines[-3][1:])\nscores.append(last_score)\n\n\npriv_scores = {}\nfor team, score in zip(teams, scores):\n    priv_scores[team] = score\n    \n#priv_scores\n\npub_df = pd.read_csv('/kaggle/input/leaderboard-scores/public_scores.csv')\n#pub_df\n\npub_scores = {}\nfor idx, row in pub_df.iterrows():\n    team = row.TeamName\n    score = row.Score\n    pub_scores[team] = score\n\npriv_sc = []\npub_sc = []\n\nfor team, priv_score in priv_scores.items():\n    if team in pub_scores:\n        pub_score = pub_scores[team]\n        priv_sc.append(priv_score)\n        pub_sc.append(pub_score)\n        #print(team, pub_score, priv_score)\n\npriv_sc = np.array(priv_sc)\npub_sc = np.array(pub_sc)\n\nthreshold = 1\n\nx = pub_sc[np.logical_and(pub_sc < threshold, priv_sc < threshold)]\ny = priv_sc[np.logical_and(pub_sc < threshold, priv_sc < threshold)]\n\nplt.figure(figsize=(16,12))\nplt.scatter(x, y, marker='.')\nplt.plot(x, x)\nplt.xlabel('Public Score')\n_=plt.ylabel('Private Score')\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"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":4,"nbformat_minor":4}