Skip to content

Instantly share code, notes, and snippets.

@mkfeuhrer
Created September 2, 2018 12:17
Show Gist options
  • Save mkfeuhrer/df05ef86c54b028b9f89f1a2547dd4ee to your computer and use it in GitHub Desktop.
Save mkfeuhrer/df05ef86c54b028b9f89f1a2547dd4ee to your computer and use it in GitHub Desktop.
Softathlon Round 1 result generaton scipt
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Read files\n",
"apti = pd.read_excel('softa-r1-apti-3-result.xls')\n",
"code = pd.read_excel('softa-r1-coding-3-result.xls')\n",
"tech = pd.read_excel('softa-r1-tech-3-result.xls')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Make score\n",
"email = code['Email']\n",
"scores = {}\n",
"for i in range(email.shape[0]):\n",
" scores[email[i]] = [\"\",0,0,0,0]\n",
"email = apti['Email']\n",
"for i in range(email.shape[0]):\n",
" scores[email[i]] = [\"\",0,0,0,0]\n",
"email = tech['Email']\n",
"for i in range(email.shape[0]):\n",
" scores[email[i]] = [\"\",0,0,0,0]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Adding scores here\n",
"# Name\n",
"for i in range(code['Email'].shape[0]):\n",
" scores[code['Email'][i]][0] = code['Name'][i] \n",
"# Apti\n",
"for i in range(apti['Email'].shape[0]):\n",
" scores[apti['Email'][i]][1] = apti['Total Score(60.0)'][i]\n",
"# Tech\n",
"for i in range(tech['Email'].shape[0]):\n",
" scores[tech['Email'][i]][2] = tech['Total Score(120.0)'][i]\n",
"# Code\n",
"for i in range(code['Email'].shape[0]):\n",
" scores[code['Email'][i]][3] = code['Total Score(80.0)'][i]\n",
"# Total Score\n",
"for i,j in scores.items():\n",
" scores[i][4] = j[1]*0.3 + j[2]*0.3 + j[3]*0.4"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"df = pd.DataFrame(data=scores)\n",
"df = (df.T)\n",
"df.to_excel('result3ndYear.xlsx')"
]
}
],
"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.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment