Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 123 additions & 10 deletions pairem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {
"autoscroll": false,
"collapsed": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'First Name': 'Felix', 'Last Name': 'Adam', 'GSE Email': '[email protected]'}, {'First Name': 'Sixter Leonardo', 'Last Name': 'Alcivar', 'GSE Email': '[email protected]'}, {'First Name': 'Julia Bois', 'Last Name': 'Barnett', 'GSE Email': '[email protected]'}, {'First Name': 'Eric Alan', 'Last Name': 'Beckwith', 'GSE Email': '[email protected]'}, {'First Name': 'Maia', 'Last Name': 'Brenner Stainfeld', 'GSE Email': '[email protected]'}, {'First Name': 'Hannah', 'Last Name': 'Busshoff', 'GSE Email': '[email protected]'}, {'First Name': 'Hector Eulogio', 'Last Name': 'Cano', 'GSE Email': '[email protected]'}, {'First Name': 'Reid', 'Last Name': 'Falconer', 'GSE Email': '[email protected]'}, {'First Name': 'Lucas', 'Last Name': 'Freire', 'GSE Email': '[email protected]'}, {'First Name': 'Hannah', 'Last Name': 'Gerits', 'GSE Email': '[email protected]'}, {'First Name': 'Georgi Konstantinov', 'Last Name': 'Gulyashki', 'GSE Email': '[email protected]'}, {'First Name': 'Ari', 'Last Name': 'Lam', 'GSE Email': '[email protected]'}, {'First Name': 'Sam Peter', 'Last Name': 'MacIntyre', 'GSE Email': '[email protected]'}, {'First Name': 'Oscar', 'Last Name': 'Martínez', 'GSE Email': '[email protected]'}, {'First Name': 'Monika Anna', 'Last Name': 'Matyja', 'GSE Email': '[email protected]'}, {'First Name': 'Evelyn Maria', 'Last Name': 'Molina Bolaños', 'GSE Email': '[email protected]'}, {'First Name': 'Jordi', 'Last Name': 'Morera Serra', 'GSE Email': '[email protected]'}, {'First Name': 'Konstantinos', 'Last Name': 'Niakaros', 'GSE Email': '[email protected]'}, {'First Name': 'Snorri', 'Last Name': 'Petersen', 'GSE Email': '[email protected]'}, {'First Name': 'Maryam', 'Last Name': 'Rahbaralam', 'GSE Email': '[email protected]'}, {'First Name': 'Guillem', 'Last Name': 'Sitges', 'GSE Email': '[email protected]'}, {'First Name': 'Callan James', 'Last Name': 'Windsor', 'GSE Email': '[email protected]'}, {'First Name': 'Sebastian', 'Last Name': 'Wolf', 'GSE Email': '[email protected]'}, {'First Name': 'Kaka', 'Last Name': 'Ye', 'GSE Email': '[email protected]'}, {'First Name': 'Maximilian', 'Last Name': 'Zebhauser', 'GSE Email': '[email protected]'}]\n"
]
}
],
"source": [
"import csv\n",
"\n",
Expand All @@ -53,7 +60,6 @@
"execution_count": null,
"metadata": {
"autoscroll": false,
"collapsed": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
Expand All @@ -68,17 +74,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"autoscroll": false,
"collapsed": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Write your own test for the assignment!\n",
"\n",
Expand All @@ -89,19 +105,116 @@
" {'First Name': 'Qux', 'Last Name': 'Quxson'},\n",
" {'First Name': 'Quux', 'Last Name': 'Quuxson'},\n",
"]\n",
"\n",
"pairs = make_pairs(test_students)\n",
"test_students[1]\n",
"len(test_students)\n",
"#pairs = make_pairs(test_students)\n",
"\n",
"# Write assertions here!\n",
"assert(type(pairs) == list)"
"#assert(type(pairs) == list)"
]
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'First Name': 'Quux', 'Last Name': 'Quuxson'}]"
]
},
"execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"students = [\n",
" {'First Name': 'Foo', 'Last Name': 'Funderson'},\n",
" {'First Name': 'Baz', 'Last Name': 'Bazerson'},\n",
" {'First Name': 'Bar', 'Last Name': 'Barson'},\n",
" {'First Name': 'Qux', 'Last Name': 'Quxson'},\n",
" {'First Name': 'Quux', 'Last Name': 'Quuxson'},\n",
"]\n",
"\n",
"list(students[-1:])"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[({'First Name': 'Quux', 'Last Name': 'Quuxson'},\n",
" {'First Name': 'Foo', 'Last Name': 'Funderson'}),\n",
" ({'First Name': 'Qux', 'Last Name': 'Quxson'},\n",
" {'First Name': 'Bar', 'Last Name': 'Barson'}),\n",
" {'First Name': 'Baz', 'Last Name': 'Bazerson'}]"
]
},
"execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import random\n",
"\n",
"\n",
"students = [\n",
" {'First Name': 'Foo', 'Last Name': 'Funderson'},\n",
" {'First Name': 'Baz', 'Last Name': 'Bazerson'},\n",
" {'First Name': 'Bar', 'Last Name': 'Barson'},\n",
" {'First Name': 'Qux', 'Last Name': 'Quxson'},\n",
" {'First Name': 'Quux', 'Last Name': 'Quuxson'},\n",
"]\n",
"\n",
"def Randomizer(students):\n",
" random.shuffle(students)\n",
" #order = list(range(len(students)))\n",
" #random.shuffle(order)\n",
" #students = [students[i] for i in order]\n",
" return students\n",
" \n",
"def make_pairs(students):\n",
" first_half = students[:len(students)//2]\n",
" second_half = students[len(students)//2:]\n",
" student_pairs = list(zip(first_half, second_half)) + list(students[-1:])\n",
" return student_pairs\n",
"\n",
" #for i in range(len(students)-1):\n",
" #print(students[i],\"is paired with\", students[i+2])\n",
" #for i,k in students:\n",
" #print (students[i] + \"is paired with\" + students[k])\n",
" \n",
"\n",
"Randomizer(students) \n",
"list(make_pairs(students))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
},
"name": "Untitled.ipynb"
},
"nbformat": 4,
Expand Down