" \"/home/prayush/Documents/ICTS/icts-housing/Housing allotment request form (Responses) - Form Responses 1.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Timestamp</th>\n",
" <th>Email Address</th>\n",
" <th>Name</th>\n",
" <th>Please indicate your order of preference for campus housing [On-campus accommodation]</th>\n",
" <th>Please indicate your order of preference for campus housing [Hostel 1]</th>\n",
" <th>Please indicate your order of preference for campus housing [Hostel 2]</th>\n",
" <th>Please indicate your order of preference for campus housing [Hostel 3]</th>\n",
" <th>Please indicate your order of preference for campus housing [Hostel 4]</th>\n",
" <th>Please indicate your order of preference for campus housing [Hostel 5]</th>\n",
" <th>Year of Study</th>\n",
" <th>Program enrolled</th>\n",
" <th>Are you a female student?</th>\n",
" <th>Please indicate your order of preference for campus housing [On-campus studio apartment (only applicable for postdoctoral fellows)]</th>\n",
" <th>Please indicate your order of preference for campus housing [Off-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)]</th>\n",
" <th>Please indicate your order of preference for campus housing [On-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)]</th>\n",
" Please indicate your order of preference for campus housing [On-campus accommodation] \\\n",
"0 NaN \n",
"1 5.0 \n",
"2 NaN \n",
"3 1.0 \n",
"4 1.0 \n",
"\n",
" Please indicate your order of preference for campus housing [Hostel 1] \\\n",
"0 4.0 \n",
"1 NaN \n",
"2 NaN \n",
"3 5.0 \n",
"4 NaN \n",
"\n",
" Please indicate your order of preference for campus housing [Hostel 2] \\\n",
"0 1.0 \n",
"1 1.0 \n",
"2 1.0 \n",
"3 2.0 \n",
"4 2.0 \n",
"\n",
" Please indicate your order of preference for campus housing [Hostel 3] \\\n",
"0 5.0 \n",
"1 3.0 \n",
"2 NaN \n",
"3 4.0 \n",
"4 5.0 \n",
"\n",
" Please indicate your order of preference for campus housing [Hostel 4] \\\n",
"0 2.0 \n",
"1 2.0 \n",
"2 NaN \n",
"3 1.0 \n",
"4 3.0 \n",
"\n",
" Please indicate your order of preference for campus housing [Hostel 5] \\\n",
"0 3.0 \n",
"1 4.0 \n",
"2 NaN \n",
"3 3.0 \n",
"4 4.0 \n",
"\n",
" Year of Study Program enrolled Are you a female student? \\\n",
"0 Second year IPhD Yes \n",
"1 Second year IPhD Yes \n",
"2 Third year IPhD No \n",
"3 Second year PhD Yes \n",
"4 Third year PhD No \n",
"\n",
" Please indicate your order of preference for campus housing [On-campus studio apartment (only applicable for postdoctoral fellows)] \\\n",
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
"\n",
" Please indicate your order of preference for campus housing [Off-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)] \\\n",
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN \n",
"\n",
" Please indicate your order of preference for campus housing [On-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)] \n",
"0 NaN \n",
"1 NaN \n",
"2 NaN \n",
"3 NaN \n",
"4 NaN "
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw_responses.head()"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"# Replacing empty entries with a constant number that is large enough,\n",
"# This amounts to treating those choices for which students have filled\n",
"# no preferences as being equally preferred by them\n",
"3 Please indicate your order of preference for campus housing [On-campus accommodation]\n",
"4 Please indicate your order of preference for campus housing [Hostel 1]\n",
"5 Please indicate your order of preference for campus housing [Hostel 2]\n",
"6 Please indicate your order of preference for campus housing [Hostel 3]\n",
"7 Please indicate your order of preference for campus housing [Hostel 4]\n",
"8 Please indicate your order of preference for campus housing [Hostel 5]\n",
"9 Year of Study\n",
"10 Program enrolled\n",
"11 Are you a female student?\n",
"12 Please indicate your order of preference for campus housing [On-campus studio apartment (only applicable for postdoctoral fellows)]\n",
"13 Please indicate your order of preference for campus housing [Off-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)]\n",
"14 Please indicate your order of preference for campus housing [On-campus accommodation with spouse/partner (applicable only if the partner stays for at least 220 days out of 365 days)]\n"
]
}
],
"source": [
"# Standardizing column names to be used in rest of the notebook\n",
"proc_responses.columns\n",
"\n",
"for idx, cname in enumerate(proc_responses.columns):\n",