Commit 07f552e8 authored by Luke Ng's avatar Luke Ng
Browse files

Display initial data and processed data.

parent bff48218
Loading
Loading
Loading
Loading
+45 −3
Changes for Topic_03_Presentation/universities-intake-enrolment-and-graduates-by-course.ipynb: 45 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -9,9 +9,42 @@
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Initial Data:\n",
      "     year sex       course intake enrolment graduates\n",
      "0    2005  MF  Accountancy    876      2561       706\n",
      "1    2005   F  Accountancy    530      1732       495\n",
      "30   2006  MF  Accountancy    934      2844       644\n",
      "31   2006   F  Accountancy    557      1819       468\n",
      "60   2007  MF  Accountancy   1000      3074       834\n",
      "61   2007   F  Accountancy    625      1914       574\n",
      "90   2008  MF  Accountancy   1055      3139       831\n",
      "91   2008   F  Accountancy    638      1910       536\n",
      "120  2009  MF  Accountancy   1142      3471       937\n",
      "121  2009   F  Accountancy    663      2059       595\n",
      "\n",
      "\n",
      "Processed Data:\n",
      "   year sex       course  intake  enrolment  graduates\n",
      "0  2009   F  Accountancy     663       2059        595\n",
      "1  2009   M  Accountancy     479       1412        342\n",
      "2  2010   F  Accountancy     689       2159        553\n",
      "3  2010   M  Accountancy     480       1486        380\n",
      "4  2011   F  Accountancy     618       2244        507\n",
      "5  2011   M  Accountancy     482       1627        332\n",
      "6  2012   F  Accountancy     682       2316        589\n",
      "7  2012   M  Accountancy     531       1685        447\n",
      "8  2013   F  Accountancy     679       2274        688\n",
      "9  2013   M  Accountancy     506       1768        399\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\r\n",
    "import locale\r\n",
@@ -72,7 +105,16 @@
    "data_course_year_final[\"graduates\"] = data_course_year_final[\"graduates\"].astype(int)\r\n",
    "\r\n",
    "# Reset DataFrame indices.\r\n",
    "data_course_year_final.reset_index(drop=True, inplace=True)"
    "data_course_year_final.reset_index(drop=True, inplace=True)\r\n",
    "\r\n",
    "# Initial data.\r\n",
    "print(\"Initial Data:\")\r\n",
    "print(data_raw.sort_values([\"course\", \"year\"]).head(10))\r\n",
    "print(\"\\n\")\r\n",
    "\r\n",
    "# Processed data.\r\n",
    "print(\"Processed Data:\")\r\n",
    "print(data_course_year_final.head(10))"
   ]
  },
  {