This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit 753a0f2c authored by henrycwong's avatar henrycwong

add team histories

parent c91e3031
......@@ -2,17 +2,18 @@
"cells": [
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np"
"import numpy as np\n",
"import json"
]
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
......@@ -21,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 39,
"metadata": {},
"outputs": [
{
......@@ -226,7 +227,7 @@
"[5 rows x 99 columns]"
]
},
"execution_count": 20,
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
......@@ -237,7 +238,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
......@@ -246,7 +247,66 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
"with open('teamDict.json') as f:\n",
" teamDict = json.load(f)"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Team Liquid': 0,\n",
" 'Team SoloMid': 1,\n",
" '100 Thieves': 2,\n",
" 'OpTic Gaming': 3,\n",
" 'Clutch Gaming': 4,\n",
" 'Golden Guardians': 5,\n",
" 'Echo Fox': 6,\n",
" 'FlyQuest': 7,\n",
" 'Counter Logic Gaming': 8,\n",
" 'Cloud9': 9}"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"teamDict"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['Team Liquid', 'Team SoloMid', '100 Thieves', 'OpTic Gaming', 'Clutch Gaming', 'Golden Guardians', 'Echo Fox', 'FlyQuest', 'Counter Logic Gaming', 'Cloud9'])"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"teamDict.keys()"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
......@@ -274,13 +334,18 @@
"array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int64)"
]
},
"execution_count": 22,
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"teams = newDF[\"team\"].unique()\n",
"keys = teamDict.keys()\n",
"for team in teams:\n",
" if team not in keys:\n",
" teamDict[team] = len(teamDict)\n",
" \n",
"teamDict = dict(zip(teams,range(len(teams))))\n",
"newDF.loc[newDF.index,\"team\"] = newDF.loc[newDF.index,\"team\"].replace(teamDict)\n",
"print(teamDict)\n",
......@@ -289,7 +354,18 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 52,
"metadata": {},
"outputs": [],
"source": [
"#throw team into a json file\n",
"with open('teamDict.json', 'w') as f:\n",
" json.dump(teamDict, f)"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
......@@ -411,7 +487,7 @@
"4 0.0 1.0 0.0 "
]
},
"execution_count": 23,
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
......@@ -422,7 +498,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 50,
"metadata": {},
"outputs": [
{
......@@ -637,7 +713,7 @@
"[236 rows x 10 columns]"
]
},
"execution_count": 24,
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
......@@ -648,7 +724,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
......
This diff is collapsed.
{"Team Liquid": 0, "Team SoloMid": 1, "100 Thieves": 2, "OpTic Gaming": 3, "Clutch Gaming": 4, "Golden Guardians": 5, "Echo Fox": 6, "FlyQuest": 7, "Counter Logic Gaming": 8, "Cloud9": 9}
\ No newline at end of file
{"Cloud9": 0, "Team Liquid": 1, "Counter Logic Gaming": 2, "Dignitas": 3, "100 Thieves": 4, "Golden Guardians": 5, "Immortals": 6, "FlyQuest": 7, "Evil Geniuses": 8, "Team SoloMid": 9}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment