{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 11455,
     "status": "ok",
     "timestamp": 1752747527269,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "mCpodkBoLAo2",
    "outputId": "a3bfe9e6-67bb-4378-9815-d840765346dd"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: openpyxl in /usr/local/lib/python3.11/dist-packages (3.1.5)\n",
      "Requirement already satisfied: et-xmlfile in /usr/local/lib/python3.11/dist-packages (from openpyxl) (2.0.0)\n",
      "Requirement already satisfied: xlwings in /usr/local/lib/python3.11/dist-packages (0.33.15)\n"
     ]
    }
   ],
   "source": [
    "!pip install openpyxl\n",
    "!pip install xlwings\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTML report written to: reports/excel_evaluation_report.html\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Volumes/MacSSD/Areas/Github_Repositories/evaluator/src/instantgrade/reporting/reporting_service.py:172: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n",
      "  df[\"best_n_total\"] = df[\"best_n_total\"].fillna(0).astype(float)\n",
      "/Volumes/MacSSD/Areas/Github_Repositories/evaluator/src/instantgrade/reporting/reporting_service.py:174: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n",
      "  df[\"scaled\"] = df[\"scaled\"].fillna(0).astype(float)\n"
     ]
    }
   ],
   "source": [
    "import sys, pathlib\n",
    "from pathlib import Path\n",
    "\n",
    "# Setup paths\n",
    "repo = pathlib.Path('.').resolve().parent.parent\n",
    "sys.path.insert(0, str(repo))\n",
    "sys.path.insert(0, str(repo / 'src'))\n",
    "\n",
    "\n",
    "# in a notebook or Python script (after ensuring project is on sys.path or installed):\n",
    "from instantgrade import InstantGrader\n",
    "from pathlib import Path\n",
    "\n",
    "# Point to the solution and submissions in the repo\n",
    "solution = Path(\"./Assignment_ sol 1.xlsx\")\n",
    "subs = Path(\"./submissions\")\n",
    "report_dir = Path(\"./reports\")\n",
    "report_dir.mkdir(parents=True, exist_ok=True)\n",
    "\n",
    "# Instantiate router and force Excel evaluator\n",
    "grader = InstantGrader(\n",
    "    solution_file_path=solution,\n",
    "    submission_folder_path=subs,\n",
    "    override_type=\"excel\",        # forces Excel evaluator\n",
    "    column_name=\"B\",              # same defaults as the example notebook\n",
    "    row_number=5,\n",
    "    number_of_question=10,\n",
    ")\n",
    "\n",
    "report = grader.run()             # returns a ReportingService instance\n",
    "html_path = report.to_html(report_dir / \"excel_evaluation_report.html\")\n",
    "print(\"HTML report written to:\", html_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 1798,
     "status": "ok",
     "timestamp": 1752747529070,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "84O4LidbLsb4",
    "outputId": "83cd6a3e-ae12-4ef2-97e2-4337b81854f9"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n"
     ]
    }
   ],
   "source": [
    "from google.colab import drive\n",
    "drive.mount('/content/drive')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "ZZd5vSkvNZJE"
   },
   "source": [
    "# Checking Excel sheets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "executionInfo": {
     "elapsed": 1,
     "status": "ok",
     "timestamp": 1752747529074,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "HwBtchZ-5uMq"
   },
   "outputs": [],
   "source": [
    "assignment_number = \"Assignment_3\"\n",
    "assignment1_folder_path = \"/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3\"\n",
    "assignment2_excel_answer_key_path = \"/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Assignments Files/Assignment_sol 3.xlsx\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "executionInfo": {
     "elapsed": 34,
     "status": "ok",
     "timestamp": 1752747529141,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "h_67fJLiY4AB"
   },
   "outputs": [],
   "source": [
    "import openpyxl\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "def write_to_file(string_data, file_path=f\"logfile_{assignment_number}.txt\"):\n",
    "  file_path = os.path.join(os.getcwd(), file_path)\n",
    "  # print('write to file is executed', file_path)\n",
    "  with open(file_path, 'a+') as file:\n",
    "    file.writelines(string_data)\n",
    "\n",
    "\n",
    "def get_all_excel_filenames(folder_path):\n",
    "    files = os.listdir(folder_path)\n",
    "    excel_files = []\n",
    "    for f in files:\n",
    "        if f.endswith('.xlsx'):\n",
    "            excel_files.append(f)\n",
    "    write_to_file(f\"Found {len(excel_files)} excel files to evaluate. \\n\\n\\n\\n \")\n",
    "    return excel_files\n",
    "\n",
    "\n",
    "def check_value(cell_address, worksheet, log=True):\n",
    "    if log:\n",
    "        write_to_file(f\" \\n {worksheet[cell_address].value} \\n \")\n",
    "    return worksheet[cell_address].value\n",
    "\n",
    "\n",
    "def check_data_type(cell_address, worksheet):\n",
    "    write_to_file(f\" \\n {worksheet[cell_address].data_type} (__data_type) \\n \")\n",
    "    return worksheet[cell_address].data_type\n",
    "\n",
    "\n",
    "def empty_data_structure():\n",
    "    data_structure = dict()\n",
    "    data_structure['Name'] = None\n",
    "    data_structure['Roll Number'] = None\n",
    "    data_structure['Result'] = 0\n",
    "    data_structure['Error Sum'] = 0\n",
    "    data_structure['Value Sum'] = 0\n",
    "    data_structure['Formula Sum'] = 0\n",
    "\n",
    "    return data_structure\n",
    "\n",
    "try:\n",
    "    import xlwings as xw\n",
    "    xlwings_available = True\n",
    "except ImportError:\n",
    "    xlwings_available = False\n",
    "\n",
    "def get_formula_multiengine(file_path, sheet_name, cell_address):\n",
    "    # Try openpyxl first\n",
    "    try:\n",
    "        wb = openpyxl.load_workbook(file_path)\n",
    "        ws = wb[sheet_name] if sheet_name in wb.sheetnames else wb.active\n",
    "        cell = ws[cell_address]\n",
    "\n",
    "        # Case 1: Cell has .formula attribute (rare)\n",
    "        if hasattr(cell, \"formula\") and isinstance(cell.formula, str):\n",
    "            return cell.formula, \"openpyxl (cell.formula)\"\n",
    "\n",
    "        # Case 2: cell.value is a string starting with =\n",
    "        if isinstance(cell.value, str) and cell.value.startswith(\"=\"):\n",
    "            return cell.value, \"openpyxl (cell.value)\"\n",
    "\n",
    "        # Case 3: cell.value is an ArrayFormula or object, reject and fall back\n",
    "        if hasattr(cell.value, 'text'):\n",
    "            return cell.value.text, \"openpyxl (ArrayFormula.text)\"\n",
    "\n",
    "        # Case 4: Unusable object (e.g., openpyxl ArrayFormula), fall through to xlwings\n",
    "    except Exception as e:\n",
    "        # Continue to xlwings\n",
    "        pass\n",
    "\n",
    "    # Try xlwings if openpyxl didn't return usable formula\n",
    "    if xlwings_available:\n",
    "        try:\n",
    "            app = xw.App(visible=False)\n",
    "            wb = app.books.open(file_path)\n",
    "            sht = wb.sheets[sheet_name] if sheet_name in [s.name for s in wb.sheets] else wb.sheets[0]\n",
    "            formula = sht.range(cell_address).formula\n",
    "            wb.close()\n",
    "            app.quit()\n",
    "            return formula, \"xlwings\"\n",
    "        except Exception as e:\n",
    "            return None, f\"xlwings error: {str(e)}\"\n",
    "\n",
    "    return None, \"No formula found\"\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "def check_specific_answers(empty_data, column_name, row_number, number_of_question, formula_worksheet, value_worksheet,\n",
    "                           values_answer_key, formula_answer_key, file_path):\n",
    "    values_answer_key = values_answer_key or {}\n",
    "    formula_answer_key = formula_answer_key or {}\n",
    "\n",
    "    for i in range(number_of_question):\n",
    "        write_to_file(f\"{'-'* 4} \\n \\n Checking question number: {i+1}\")\n",
    "\n",
    "        cell_address = column_name + str(row_number + i)\n",
    "        write_to_file(f\"        checking cell:     [{cell_address}]  \\n \")\n",
    "\n",
    "        write_to_file(f\"Checking formula output for any errors  \\n \")\n",
    "        value = check_value(cell_address, value_worksheet, False)\n",
    "        is_error_value = value in (\n",
    "            \"#N/A\", \"#DIV/0!\", \"#NAME?\", \"#NULL!\", \"#NUM!\", \"#REF!\", \"#VALUE!\", \"#####\", \"Circular Reference\"\n",
    "        )\n",
    "\n",
    "        if is_error_value:\n",
    "            write_to_file(\n",
    "                f\"Error detected in value: >>{value}<<  \\n \"\n",
    "            )\n",
    "            empty_data['Error Sum'] += 1\n",
    "            write_to_file(f\"Your ERROR count increased: {empty_data['Error Sum']}  \\n \")\n",
    "\n",
    "        # Proceed with value checking anyway\n",
    "        if values_answer_key is not None and cell_address in values_answer_key:\n",
    "            if checking_if_values_are_correct(value, values_answer_key[cell_address]):\n",
    "                empty_data['Value Sum'] += 1\n",
    "                write_to_file(f\"Your VALUE count increased: {empty_data['Value Sum']}  \\n \")\n",
    "            else:\n",
    "                write_to_file(\n",
    "                    f\"   Warning: Output {value} of {type(value)} must be as specified in assignment : {values_answer_key[cell_address]}  of {type(values_answer_key[cell_address])}. \\n \"\n",
    "                )\n",
    "        else:\n",
    "            write_to_file(f\"          No output compulsion for this cell. \\n \")\n",
    "\n",
    "        # Proceed with formula checking regardless\n",
    "        if formula_answer_key is not None and cell_address in formula_answer_key:\n",
    "            formula_string, engine_used = get_formula_multiengine(file_path=file_path, sheet_name=formula_worksheet.title, cell_address=cell_address)\n",
    "\n",
    "            try:\n",
    "                if hasattr(formula_string, 'text'):\n",
    "                    formula_string = formula_string.text\n",
    "                elif not isinstance(formula_string, str):\n",
    "                    formula_string = str(formula_string)\n",
    "            except Exception as e:\n",
    "                write_to_file(f\"Error parsing formula: {e}\\n\")\n",
    "\n",
    "            if not formula_string or not isinstance(formula_string, str):\n",
    "                write_to_file(\"Could not retrieve usable formula from any engine.\\n\")\n",
    "            else:\n",
    "                write_to_file(f\"Formula found using {engine_used}: {formula_string}\\n\")\n",
    "\n",
    "                expected_results = formula_answer_key[cell_address]\n",
    "                if isinstance(expected_results, str):\n",
    "                    expected_results = [expected_results]\n",
    "\n",
    "                formula_upper = formula_string.upper()\n",
    "\n",
    "                if any(func.upper() in formula_upper for func in expected_results):\n",
    "                    empty_data['Formula Sum'] += 1\n",
    "                    write_to_file(f\"Your FORMULA count increased: {empty_data['Formula Sum']}  \\n \")\n",
    "                else:\n",
    "                    write_to_file(\n",
    "                        f\"   Warning: You should have used one of: {', '.join(expected_results)} but you used: {formula_string}.\\n \"\n",
    "                    )\n",
    "        else:\n",
    "            write_to_file(f\"          No formula compulsion for this cell. \\n \")\n",
    "\n",
    "        if cell_address in values_answer_key or cell_address in formula_answer_key:\n",
    "            empty_data['Result'] += 1\n",
    "            write_to_file(f\"#####Your RESULT count increased: {empty_data['Result']} ###### \\n \")\n",
    "\n",
    "\n",
    "    return empty_data\n",
    "\n",
    "def checking_if_values_are_correct(returned_value, actual_value):\n",
    "    if returned_value == None or actual_value == None:\n",
    "      return False\n",
    "\n",
    "    if returned_value == actual_value:\n",
    "        return True\n",
    "\n",
    "    try:\n",
    "        temp_returned_value = float(returned_value)\n",
    "        temp_actual_value = float(actual_value)\n",
    "\n",
    "        if temp_returned_value == temp_actual_value:\n",
    "            return True\n",
    "    except ValueError:\n",
    "        pass\n",
    "\n",
    "    if isinstance(actual_value, list):\n",
    "      if returned_value in actual_value:\n",
    "        return True\n",
    "\n",
    "    if returned_value in (\"True\", \"TRUE\", \"true\", True) and actual_value in (\"True\", \"TRUE\", \"true\", True):\n",
    "        return True\n",
    "\n",
    "    elif returned_value in (\"False\", \"FALSE\", \"false\", False) and actual_value in (\"False\", \"FALSE\", \"false\", False):\n",
    "        return True\n",
    "\n",
    "    else:\n",
    "        return False\n",
    "\n",
    "\n",
    "def evaluate_excel_file(file_path, column_name, row_number, number_of_question, values_answer_key, formula_answer_key,\n",
    "                        worksheet_name='Answers', student_name_cell='B2', student_roll_no_cell='B3'):\n",
    "    write_to_file(f\"{'~' * 80} \\n\\n \\n \")\n",
    "\n",
    "    if file_path:\n",
    "        file_name = file_path.split('/')[-1]\n",
    "        write_to_file(f\" \\n \\n {'+'* 25} \\n Working with {file_name}   \\n \\n\")\n",
    "    else:\n",
    "        write_to_file(\"No file_path  \\n \")\n",
    "        return\n",
    "\n",
    "    try:\n",
    "        formula_wb = openpyxl.load_workbook(file_path)\n",
    "    except:\n",
    "        write_to_file(f\"Could not find the {file_path}  \\n \")\n",
    "        return\n",
    "\n",
    "    if worksheet_name not in formula_wb.sheetnames:\n",
    "        new_worksheet = formula_wb.sheetnames[0]\n",
    "        write_to_file(f\"Since '{worksheet_name}' is not there. This tools is using {new_worksheet}  \\n \")\n",
    "        worksheet_name = new_worksheet\n",
    "    try:\n",
    "        formula_worksheet = formula_wb[worksheet_name]\n",
    "    except KeyError:\n",
    "        write_to_file(\"sheet named 'Answers' must be there and contain answers.  \\n \")\n",
    "        return\n",
    "\n",
    "    try:\n",
    "        value_wb = openpyxl.load_workbook(file_path, data_only=True)\n",
    "    except:\n",
    "        write_to_file(f\"Could not find the {file_path}  \\n \")\n",
    "        return\n",
    "\n",
    "    try:\n",
    "        value_worksheet = value_wb[worksheet_name]\n",
    "    except KeyError:\n",
    "        write_to_file(\"sheet named 'Answers' must be there and contain answers.  \\n \")\n",
    "        return\n",
    "\n",
    "    try:\n",
    "        name = check_value(student_name_cell, formula_worksheet)\n",
    "    except:\n",
    "        write_to_file(f'Could not find your official Name in B1.  \\n ')\n",
    "        return\n",
    "\n",
    "    try:\n",
    "        roll_no = check_value(student_roll_no_cell, formula_worksheet)\n",
    "    except:\n",
    "        write_to_file(f'Could not find your roll number in B2.  \\n ')\n",
    "        return\n",
    "\n",
    "    result_data = check_specific_answers(empty_data_structure(), column_name, row_number, number_of_question,\n",
    "                                     formula_worksheet, value_worksheet, values_answer_key, formula_answer_key, file_path)\n",
    "\n",
    "    result_data['Name'] = name\n",
    "    result_data['Roll Number'] = roll_no\n",
    "\n",
    "    write_to_file(str(result_data))\n",
    "    write_to_file(f\"{'*' * 80} \\n\\n \\n \")\n",
    "\n",
    "    return result_data\n",
    "\n",
    "\n",
    "class CheckExcelFiles:\n",
    "    def __init__(self, folder_path, formula_answer_key={}, values_answer_key={}):\n",
    "        self.values_answer_key = values_answer_key\n",
    "        self.path = folder_path\n",
    "        self.formula_answer_key = formula_answer_key\n",
    "\n",
    "\n",
    "    def evaluate_all_excel_files(self, column_name, row_number, number_of_question):\n",
    "        result_data_list = []\n",
    "        excel_filenames = get_all_excel_filenames(self.path)\n",
    "\n",
    "        for filename in excel_filenames:\n",
    "\n",
    "            file_path = os.path.join(self.path, filename)\n",
    "            print(file_path)\n",
    "            data = evaluate_excel_file(file_path, column_name, row_number, number_of_question, self.values_answer_key,\n",
    "                                       self.formula_answer_key)\n",
    "            print(data)\n",
    "            if data:\n",
    "                result_data_list.append(data)\n",
    "        df = pd.DataFrame.from_records(result_data_list)\n",
    "\n",
    "        return df\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "executionInfo": {
     "elapsed": 1,
     "status": "ok",
     "timestamp": 1752747529141,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "eWAIz_3BKMSI"
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "executionInfo": {
     "elapsed": 6,
     "status": "ok",
     "timestamp": 1752749262907,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "UPGjSHSs3Jj0"
   },
   "outputs": [],
   "source": [
    "import re\n",
    "from openpyxl.utils import column_index_from_string, get_column_letter\n",
    "\n",
    "def extract_functions_from_formula(formula_string):\n",
    "    if not isinstance(formula_string, str):\n",
    "        return []\n",
    "    return re.findall(r\"\\b[A-Z]+(?=\\()\", formula_string.upper())\n",
    "\n",
    "def extract_nested_functions(formula: str, main_functions: list):\n",
    "    \"\"\"\n",
    "    Extract functions nested inside the main function(s) only.\n",
    "    Assumes formula starts with = and is a valid Excel formula.\n",
    "    \"\"\"\n",
    "    if not isinstance(formula, str) or not formula.startswith(\"=\"):\n",
    "        return []\n",
    "\n",
    "    formula = formula[1:].strip()  # remove '='\n",
    "\n",
    "    def parse_nested(func_str):\n",
    "        stack = []\n",
    "        tokens = []\n",
    "        token = \"\"\n",
    "        for char in func_str:\n",
    "            if char == \"(\":\n",
    "                if token:\n",
    "                    stack.append(token.strip())\n",
    "                    token = \"\"\n",
    "                tokens.append(\"(\")\n",
    "            elif char == \")\":\n",
    "                if token:\n",
    "                    tokens.append(token.strip())\n",
    "                    token = \"\"\n",
    "                tokens.append(\")\")\n",
    "            elif char == \",\":\n",
    "                if token:\n",
    "                    tokens.append(token.strip())\n",
    "                    token = \"\"\n",
    "                tokens.append(\",\")\n",
    "            else:\n",
    "                token += char\n",
    "        if token:\n",
    "            tokens.append(token.strip())\n",
    "        return stack, tokens\n",
    "\n",
    "    root_func = formula.split(\"(\", 1)[0].strip().upper()\n",
    "\n",
    "    # If the root function is not in the answer key, skip it\n",
    "    if root_func not in [f.upper() for f in main_functions]:\n",
    "        return []\n",
    "\n",
    "    # Recursively extract functions inside parentheses\n",
    "    nested_functions = set()\n",
    "    stack = []\n",
    "    buffer = \"\"\n",
    "    for char in formula:\n",
    "        if char == \"(\":\n",
    "            if buffer:\n",
    "                func_name = buffer.strip().upper()\n",
    "                if func_name.isalpha():  # avoid numbers etc.\n",
    "                    nested_functions.add(func_name)\n",
    "                stack.append(func_name)\n",
    "                buffer = \"\"\n",
    "        elif char == \")\":\n",
    "            if buffer:\n",
    "                buffer = \"\"\n",
    "            if stack:\n",
    "                stack.pop()\n",
    "        else:\n",
    "            buffer += char\n",
    "\n",
    "    return list(nested_functions)\n",
    "\n",
    "def create_formula_answers_loop(column_name, row_number, number_of_question, worksheet, nearby_columns=15):\n",
    "    result = dict()\n",
    "    start_col_idx = column_index_from_string(column_name)\n",
    "\n",
    "    for i in range(number_of_question):\n",
    "        row_idx = row_number + i\n",
    "        main_cell = f\"{column_name}{row_idx}\"\n",
    "        nested_functions = set()\n",
    "\n",
    "        for offset in range(nearby_columns):\n",
    "            col_idx = start_col_idx + offset\n",
    "            col_letter = get_column_letter(col_idx)\n",
    "            cell_address = f\"{col_letter}{row_idx}\"\n",
    "\n",
    "            try:\n",
    "                cell_value = check_value(cell_address, worksheet)\n",
    "                if isinstance(cell_value, openpyxl.worksheet.formula.ArrayFormula):\n",
    "                    cell_value = cell_value.text\n",
    "                if isinstance(cell_value, str) and cell_value.startswith(\"=\"):\n",
    "                    # Extract main function from the formula in the main cell\n",
    "                    root_func = cell_value[1:].split(\"(\", 1)[0].strip().upper()\n",
    "                    nested = extract_nested_functions(cell_value, [root_func])\n",
    "                    nested_functions.update(nested)\n",
    "                else:\n",
    "                    break  # stop if it's not a formula\n",
    "            except Exception as e:\n",
    "                write_to_file(f\"Formula error at {cell_address}: {e}\\n\")\n",
    "                break\n",
    "\n",
    "        result[main_cell] = list(nested_functions)\n",
    "\n",
    "    return result\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "def create_answers_loop(column_name, row_number, number_of_question, worksheet, nearby_columns=15):\n",
    "    result = dict()\n",
    "    start_col_idx = column_index_from_string(column_name)\n",
    "\n",
    "    for i in range(number_of_question):\n",
    "        row_idx = row_number + i\n",
    "        main_cell = f\"{column_name}{row_idx}\"\n",
    "        answer_values = set()\n",
    "\n",
    "        for offset in range(nearby_columns):\n",
    "            col_idx = start_col_idx + offset\n",
    "            col_letter = get_column_letter(col_idx)\n",
    "            cell_address = f\"{col_letter}{row_idx}\"\n",
    "\n",
    "            try:\n",
    "                cell_value = check_value(cell_address, worksheet)\n",
    "                if cell_value is not None and str(cell_value).strip() != \"\":\n",
    "                    answer_values.add(cell_value)\n",
    "                else:\n",
    "                    break  # stop at first empty cell\n",
    "            except Exception as e:\n",
    "                write_to_file(f\"Value error at {cell_address}: {e}\\n\")\n",
    "                break\n",
    "\n",
    "        result[main_cell] = list(answer_values)\n",
    "\n",
    "    return result\n",
    "\n",
    "def create_answer_key(excel_file_path, column_name, row_number, number_of_question, worksheet_name=None, nearby_columns=15):\n",
    "    # Load the formula workbook (with formulas)\n",
    "    formula_wb = openpyxl.load_workbook(excel_file_path)\n",
    "    if worksheet_name is None or worksheet_name not in formula_wb.sheetnames:\n",
    "        worksheet_name = formula_wb.sheetnames[0]\n",
    "        write_to_file(f\"Using first sheet '{worksheet_name}' as answer sheet.\\n\")\n",
    "    formula_ws = formula_wb[worksheet_name]\n",
    "\n",
    "    # Load the value workbook (with evaluated values)\n",
    "    value_wb = openpyxl.load_workbook(excel_file_path, data_only=True)\n",
    "    if worksheet_name not in value_wb.sheetnames:\n",
    "        worksheet_name = value_wb.sheetnames[0]\n",
    "        write_to_file(f\"Using first sheet '{worksheet_name}' from value workbook as answer sheet.\\n\")\n",
    "    value_ws = value_wb[worksheet_name]\n",
    "\n",
    "    # Create the answer keys\n",
    "    formula_answer_key = create_formula_answers_loop(column_name, row_number, number_of_question, formula_ws, nearby_columns)\n",
    "    value_answer_key = create_answers_loop(column_name, row_number, number_of_question, value_ws, nearby_columns)\n",
    "\n",
    "    return formula_answer_key, value_answer_key\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "executionInfo": {
     "elapsed": 12,
     "status": "ok",
     "timestamp": 1752749263323,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "EWBEcI5s3Jfn"
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "executionInfo": {
     "elapsed": 5,
     "status": "ok",
     "timestamp": 1752749263688,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "dErdOmD23JYq"
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "oSpqHDym3t6w"
   },
   "source": [
    "### **Instructions for Using the Tool**\n",
    "\n",
    "**Step 1:** Provide the folder path where your solution Excel file is located.\n",
    "\n",
    "**Step 2:** Mention the starting cell from where the answers begin in that Excel file. The evaluate_excel_file function tells which cell contain student_name_cell='B2', student_roll_no_cell='B3'\n",
    "\n",
    "---\n",
    "\n",
    "### **Example for Better Understanding**\n",
    "\n",
    "* In the next input cell, enter the folder path where your solution Excel file is stored.\n",
    "* The tool will look for answers starting from **cell B5** to **B14**, meaning a total of **10 questions**.\n",
    "* Ensure that your answers are placed in **column B**, from row 5 to row 14.\n",
    "* The tool will specifically check the sheet named **\"Sheet1\"** in your Excel file.\n",
    "\n",
    "---\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "executionInfo": {
     "elapsed": 704,
     "status": "ok",
     "timestamp": 1752749265447,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "nYBz4BCf3JU3"
   },
   "outputs": [],
   "source": [
    "# creating the answer key from answer excel sheet\n",
    "\n",
    "formula_answer_key, value_answer_key = create_answer_key(\n",
    "    excel_file_path=assignment2_excel_answer_key_path,\n",
    "    column_name='B',\n",
    "    row_number=5,\n",
    "    number_of_question=10,\n",
    "    worksheet_name=None, nearby_columns=15\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 65,
     "status": "ok",
     "timestamp": 1752749280267,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "UiuM6m2y_4G0",
    "outputId": "ba42b4aa-ff10-4e6b-a33e-4e7f96aebd91"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'B5': ['FILTER', 'IFERROR'],\n",
       " 'B6': ['MATCH', 'MAXIFS'],\n",
       " 'B7': ['COUNTIFS'],\n",
       " 'B8': ['SUMIFS'],\n",
       " 'B9': ['AVERAGEIFS', 'IFERROR'],\n",
       " 'B10': ['INDEX', 'MINIFS'],\n",
       " 'B11': ['COUNTIFS'],\n",
       " 'B12': ['XLOOKUP', 'MAXIFS'],\n",
       " 'B13': ['SUMIFS'],\n",
       " 'B14': ['INDEX', 'MAXIFS']}"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "formula_answer_key"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 7,
     "status": "ok",
     "timestamp": 1752749266257,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "pz3LzkZskSaP",
    "outputId": "439cb03b-c1c0-484e-bdd7-e185fdaff339"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'B5': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B6': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B7': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B8': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B9': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B10': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B11': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B12': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B13': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE'],\n",
       " 'B14': ['IFERROR',\n",
       "  'MATCH',\n",
       "  'COUNTIF',\n",
       "  'IFERROR',\n",
       "  'INDEX',\n",
       "  'COUNTIFS',\n",
       "  'XLOOKUP',\n",
       "  'SUMIFS',\n",
       "  'INDEX',\n",
       "  'FILTER',\n",
       "  'MAXIFS',\n",
       "  'SUMIF',\n",
       "  'AVERAGEIFS',\n",
       "  'MINIFS',\n",
       "  'VLOOKUP',\n",
       "  'AVERAGEIF',\n",
       "  'MAX',\n",
       "  'AVERAGE',\n",
       "  'PERCENTILE',\n",
       "  'QUARTILE']}"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "formula_answer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 8,
     "status": "ok",
     "timestamp": 1752749023111,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "uK-jn_3c25rk",
    "outputId": "01b6653b-8e3d-4f17-8ef9-76e100550ef5"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'B5': 32,\n",
       " 'B6': 467,\n",
       " 'B7': 46,\n",
       " 'B8': 116,\n",
       " 'B9': 2318.987854,\n",
       " 'B10': 'Austin',\n",
       " 'B11': 87,\n",
       " 'B12': 'MODEL S',\n",
       " 'B13': 350750,\n",
       " 'B14': 'Battery Electric Vehicle (BEV)'}"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "value_answer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "executionInfo": {
     "elapsed": 3,
     "status": "ok",
     "timestamp": 1752749023885,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "hU5hA5hXCHA1"
   },
   "outputs": [],
   "source": [
    "values = ['IFERROR',\n",
    "  'MATCH',\n",
    "  'COUNTIF',\n",
    "  'IFERROR',\n",
    "  'INDEX',\n",
    "  'COUNTIFS',\n",
    "  'XLOOKUP',\n",
    "  'SUMIFS',\n",
    "  'INDEX', 'FILTER', 'MAXIFS', 'SUMIF', 'AVERAGEIFS', 'MINIFS', 'VLOOKUP', 'AVERAGEIF', 'MAX', 'AVERAGE', 'PERCENTILE', 'QUARTILE', ]\n",
    "\n",
    "formula_answer = {\n",
    "    key: list(values)\n",
    "    for key in formula_answer\n",
    "}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "executionInfo": {
     "elapsed": 12,
     "status": "ok",
     "timestamp": 1752749024707,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "uHLkR2v6CNRq"
   },
   "outputs": [],
   "source": [
    "custom_formula_answer = {'B5': '=IFERROR',\n",
    " 'B6': '=MATCH',\n",
    " 'B7': '=COUNTIFS',\n",
    " 'B8': '=SUMIFS',\n",
    " 'B9': '=IFERROR',\n",
    " 'B10': '=INDEX',\n",
    " 'B11': '=COUNTIFS',\n",
    " 'B12': '=XLOOKUP',\n",
    " 'B13': '=SUMIFS',\n",
    " 'B14': '=INDEX'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "executionInfo": {
     "elapsed": 5,
     "status": "ok",
     "timestamp": 1752749025223,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "n7ZOuaIHug1i"
   },
   "outputs": [],
   "source": [
    "custom_value_answer = {'B5': 32,\n",
    " 'B6': 467,\n",
    " 'B7': 46,\n",
    " 'B8': 116,\n",
    " 'B9': 2318.987854,\n",
    " 'B10': 'Austin',\n",
    " 'B11': 87,\n",
    " 'B12': 'MODEL S',\n",
    " 'B13': 350750,\n",
    " 'B14': 'Battery Electric Vehicle (BEV)'}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "fXLu8ID44sy-"
   },
   "source": [
    "# Step 3\n",
    "You have to give the path of folder which consist students excel files. It will check from B5 till 10 questions for each students."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "executionInfo": {
     "elapsed": 116592,
     "status": "ok",
     "timestamp": 1752749244553,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "YSXCJVJgkk4S",
    "outputId": "66754352-73c0-4c92-b21d-cb312483601a"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (17).xlsx\n",
      "{'Name': 'Prapti Das', 'Roll Number': 2423142, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (1) (4).xlsx\n",
      "{'Name': None, 'Roll Number': None, 'Result': 10, 'Error Sum': 1, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Kabir 2423123.xlsx\n",
      "{'Name': 'Kabir Sengupta', 'Roll Number': 2423123, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Asmee.xlsx\n",
      "{'Name': None, 'Roll Number': None, 'Result': 10, 'Error Sum': 0, 'Value Sum': 3, 'Formula Sum': 1}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (16).xlsx\n",
      "{'Name': 'Manya Lakhmani', 'Roll Number': 2423136, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (1) (3).xlsx\n",
      "{'Name': None, 'Roll Number': None, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (15).xlsx\n",
      "{'Name': 'Sanika khoche', 'Roll Number': 2423149, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (14).xlsx\n",
      "{'Name': 'Sanika khoche', 'Roll Number': 2423149, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (13).xlsx\n",
      "{'Name': 'Sanika khoche', 'Roll Number': 2423149, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (12).xlsx\n",
      "{'Name': 'Sanika khoche', 'Roll Number': 2423149, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (11).xlsx\n",
      "{'Name': 'Kavyasree G', 'Roll Number': 2423126, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/ANKISHA JAIN ASSIGNMENT 3 (1).xlsx\n",
      "{'Name': 'ANKISHA JAIN ', 'Roll Number': 2423111, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/ANKISHA JAIN ASSIGNMENT 3.xlsx\n",
      "{'Name': 'ANKISHA JAIN ', 'Roll Number': 2423111, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment3 Noor Aminah 243140.xlsx\n",
      "{'Name': 'Noor Aminah', 'Roll Number': 2423140.0, 'Result': 10, 'Error Sum': 1, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/excel assingment 3 (2).xlsx\n",
      "{'Name': 'sakshi venugopal', 'Roll Number': 2423147, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/excel assingment 3 (1).xlsx\n",
      "{'Name': 'sakshi venugopal', 'Roll Number': 2423147, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 Akshay Shah.xlsx\n",
      "{'Name': 'Akshay Shah', 'Roll Number': 2423106, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 Juhi_2423122.xlsx\n",
      "{'Name': 'Juhi Dujari', 'Roll Number': 2423122, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (10).xlsx\n",
      "{'Name': 'VANKADARA KRITHIKA', 'Roll Number': 2423128, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (9).xlsx\n",
      "{'Name': 'VANKADARA KRITHIKA', 'Roll Number': 2423128, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_1 name roll no. final.xlsx\n",
      "{'Name': 'Asmee Zenith Lakra', 'Roll Number': 2423116, 'Result': 10, 'Error Sum': 0, 'Value Sum': 0, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (8).xlsx\n",
      "{'Name': 'Ritu Dhumal', 'Roll Number': 2423144, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (7).xlsx\n",
      "{'Name': 'VANKADARA KRITHIKA', 'Roll Number': 2423128, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (6).xlsx\n",
      "{'Name': 'VANKADARA KRITHIKA', 'Roll Number': 2423128, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Kshitij Test 3.xlsx\n",
      "{'Name': 'Kshitij H', 'Roll Number': 2423130, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 ANKISHA 2423111.xlsx\n",
      "{'Name': 'ANKISHA JAIN', 'Roll Number': 2423111.0, 'Result': 10, 'Error Sum': 4, 'Value Sum': 3, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (5).xlsx\n",
      "{'Name': 'Abhir Deepak', 'Roll Number': 2423103, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Test 3 (1).xlsx\n",
      "{'Name': 'Sasmit Das', 'Roll Number': 2423150, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Ritika Sahay_2423163 (1).xlsx\n",
      "{'Name': 'Ritika Sahay', 'Roll Number': 2423163, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/2423109_Assignment_3 name roll no.xlsx\n",
      "{'Name': 'Anirudh Rajesh Ponoth', 'Roll Number': 2423109, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Abraham Varghese_2423104_Assignment_3.xlsx\n",
      "{'Name': 'Abraham Varghese', 'Roll Number': 2423104, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (4).xlsx\n",
      "{'Name': None, 'Roll Number': None, 'Result': 10, 'Error Sum': 1, 'Value Sum': 1, 'Formula Sum': 9}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_2 name roll no (1).xlsx\n",
      "{'Name': 'aanchal baligar', 'Roll Number': None, 'Result': 10, 'Error Sum': 0, 'Value Sum': 1, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (1) (2).xlsx\n",
      "{'Name': 'Aanchal baligar', 'Roll Number': 2423102, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/utk.xlsx\n",
      "{'Name': 'Utkarsh Karwa', 'Roll Number': 2423159, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/utk (1).xlsx\n",
      "{'Name': 'Utkarsh Karwa', 'Roll Number': 2423159, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/3.xlsx\n",
      "{'Name': 'Aanchal baligar', 'Roll Number': 2423102, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/2.xlsx\n",
      "{'Name': 'aanchal baligar', 'Roll Number': 2423102, 'Result': 10, 'Error Sum': 0, 'Value Sum': 1, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 solved.xlsx\n",
      "{'Name': 'Maheeya Lalwani', 'Roll Number': 2423133, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/ARNAV K EXCEL.xlsx\n",
      "{'Name': 'ARNAV KALRA', 'Roll Number': 2423114, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/3.. 2.xlsx\n",
      "{'Name': 'Aanchal baligar', 'Roll Number': 2423102, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/2 2.xlsx\n",
      "{'Name': 'aanchal baligar', 'Roll Number': 2423102, 'Result': 10, 'Error Sum': 0, 'Value Sum': 1, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Nidhish Agarwal 2423138.xlsx\n",
      "{'Name': 'Nidhish Agarwal', 'Roll Number': 2423138, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (3).xlsx\n",
      "{'Name': 'Jiya Mehta ', 'Roll Number': 2423121, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/utkarsh fft (1).xlsx\n",
      "{'Name': 'Utkarsh Karwa', 'Roll Number': 2423159, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 solved 2.xlsx\n",
      "{'Name': 'Lakshya Goyal', 'Roll Number': 2423131, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 solved 1.xlsx\n",
      "{'Name': 'AADITYA JAIN', 'Roll Number': 2423101, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (2).xlsx\n",
      "{'Name': 'Rudra Sharma', 'Roll Number': 2423145, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/TFF ASSINGMENT 3.xlsx\n",
      "{'Name': 'KAVYA SINGH', 'Roll Number': 2423125, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Yug Mehta 2423162.xlsx\n",
      "{'Name': 'Yug Mehta', 'Roll Number': 2423162, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/utkarsh fft.xlsx\n",
      "{'Name': 'Utkarsh Karwa', 'Roll Number': 2423159, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Ritika Sahay_2423163.xlsx\n",
      "{'Name': 'Ritika Sahay', 'Roll Number': 2423163, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/ASSIGNMENT 3_TFF.xlsx\n",
      "{'Name': 'Arnav Pokhriyal', 'Roll Number': 2423165, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/ARNAV NEW EXCEL.xlsx\n",
      "{'Name': 'ARNAV KALRA', 'Roll Number': 2423114, 'Result': 10, 'Error Sum': 5, 'Value Sum': 2, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Stuti_Sinha_2423156.xlsx\n",
      "{'Name': 'Stuti Sinha', 'Roll Number': 2423156, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (1) (1).xlsx\n",
      "{'Name': 'Anhad Ahluwalia', 'Roll Number': 2423108, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Manan 2423134.xlsx\n",
      "{'Name': 'Manan Rander ', 'Roll Number': 2423134, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/utkarsh fft 3.xlsx\n",
      "{'Name': 'Utkarsh Karwa ', 'Roll Number': 2423159, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (6).xlsx\n",
      "{'Name': 'Akshat Kumar Shaw ', 'Roll Number': 2423164.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (5).xlsx\n",
      "{'Name': 'Vishesh Jaiswal', 'Roll Number': 2423160.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (4).xlsx\n",
      "{'Name': 'Aryan Duggal', 'Roll Number': 2423115.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 1}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (3).xlsx\n",
      "{'Name': 'Vishesh Jaiswal', 'Roll Number': 2423160.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_ mean median mode Surya.xlsx\n",
      "{'Name': 'Suryashish Dey Sarkar', 'Roll Number': 2423157, 'Result': 10, 'Error Sum': 0, 'Value Sum': 0, 'Formula Sum': 1}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (2).xlsx\n",
      "{'Name': 'Suryashish Dey Sarkar', 'Roll Number': 2423157.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 9, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 Shubhayan-2423155 (1).xlsx\n",
      "{'Name': 'Shubhayan Dutta Gupta', 'Roll Number': 2423155.0, 'Result': 10, 'Error Sum': 1, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 (1).xlsx\n",
      "{'Name': 'Nethra', 'Roll Number': 2423137, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Test 3.xlsx\n",
      "{'Name': 'Asmee Zenith Lakra', 'Roll Number': 2423116, 'Result': 10, 'Error Sum': 0, 'Value Sum': 3, 'Formula Sum': 1}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3.xlsx\n",
      "{'Name': 'Nethra', 'Roll Number': 2423137, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no (1).xlsx\n",
      "{'Name': 'Pranav S Hegde', 'Roll Number': 2423141, 'Result': 10, 'Error Sum': 0, 'Value Sum': 5, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/test 3.xlsx\n",
      "{'Name': 'Aishwarya Gaggar', 'Roll Number': 2423105, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3_Sameeksha Sathish_2423148.xlsx\n",
      "{'Name': 'Sameeksha Sathish ', 'Roll Number': 2423148, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no.xlsx\n",
      "{'Name': 'Anjaney Agrawal', 'Roll Number': 2423110, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 Shubhayan-2423155.xlsx\n",
      "{'Name': 'Shubhayan Dutta Gupta', 'Roll Number': 2423155.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3 name roll no 39.xlsx\n",
      "{'Name': 'Nistha Jindal', 'Roll Number': 2423139, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3  excel (1).xlsx\n",
      "{'Name': 'sakshi venugopal', 'Roll Number': 2423147, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment_3  excel.xlsx\n",
      "{'Name': 'sakshi venugopal', 'Roll Number': 2423147, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/assingment 3.xlsx\n",
      "{'Name': 'sakshi venugopal ', 'Roll Number': 2423147, 'Result': 10, 'Error Sum': 1, 'Value Sum': 7, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/excel assingment 3.xlsx\n",
      "{'Name': 'sakshi venugopal', 'Roll Number': 2423147.0, 'Result': 10, 'Error Sum': 0, 'Value Sum': 7, 'Formula Sum': 9}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/TEST 3.xlsx\n",
      "{'Name': 'SELVA GANAPATHY', 'Roll Number': 2423151, 'Result': 10, 'Error Sum': 0, 'Value Sum': 8, 'Formula Sum': 10}\n",
      "/content/drive/MyDrive/Classroom/Technology For Financial Forecasting 3BBAF&E B BRC 109/Test 3/Assignment 3 Sheril 2423152.xlsx\n",
      "{'Name': 'Sheril Bothra', 'Roll Number': 2423152.0, 'Result': 10, 'Error Sum': 1, 'Value Sum': 8, 'Formula Sum': 10}\n"
     ]
    }
   ],
   "source": [
    "\n",
    "checker_object = CheckExcelFiles(assignment1_folder_path, formula_answer, value_answer)\n",
    "\n",
    "result = checker_object.evaluate_all_excel_files('B',  5, 10)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "4BsItph930XA"
   },
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "executionInfo": {
     "elapsed": 6,
     "status": "ok",
     "timestamp": 1752749244580,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "p8YX9r2rkk4k"
   },
   "outputs": [],
   "source": [
    "result['Name'] = result['Name'].apply(lambda x: str(x).strip().title())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "executionInfo": {
     "elapsed": 458,
     "status": "ok",
     "timestamp": 1752749245058,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "P9yTWux2kk4l",
    "outputId": "5668fbdd-3fb9-492b-cd75-9de7c93eb0d1"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "summary": "{\n  \"name\": \"clean_df\",\n  \"rows\": 48,\n  \"fields\": [\n    {\n      \"column\": \"Name\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 48,\n        \"samples\": [\n          \"Lakshya Goyal\",\n          \"Shubhayan Dutta Gupta\",\n          \"Aaditya Jain\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Roll Number\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 19.696400587790375,\n        \"min\": 2423101.0,\n        \"max\": 2423165.0,\n        \"num_unique_values\": 47,\n        \"samples\": [\n          2423145.0,\n          2423155.0,\n          2423131.0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Result\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 10,\n        \"max\": 10,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          10\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Error Sum\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 1,\n        \"num_unique_values\": 2,\n        \"samples\": [\n          0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Value Sum\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1,\n        \"min\": 0,\n        \"max\": 9,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          8\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Formula Sum\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1,\n        \"min\": 1,\n        \"max\": 10,\n        \"num_unique_values\": 2,\n        \"samples\": [\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
       "type": "dataframe",
       "variable_name": "clean_df"
      },
      "text/html": [
       "\n",
       "  <div id=\"df-fadfb5d3-791d-4731-aa97-961c64d035dd\" class=\"colab-df-container\">\n",
       "    <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>Name</th>\n",
       "      <th>Roll Number</th>\n",
       "      <th>Result</th>\n",
       "      <th>Error Sum</th>\n",
       "      <th>Value Sum</th>\n",
       "      <th>Formula Sum</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Prapti Das</td>\n",
       "      <td>2423142.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Kabir Sengupta</td>\n",
       "      <td>2423123.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Manya Lakhmani</td>\n",
       "      <td>2423136.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sanika Khoche</td>\n",
       "      <td>2423149.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Ankisha Jain</td>\n",
       "      <td>2423111.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kavyasree G</td>\n",
       "      <td>2423126.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sakshi Venugopal</td>\n",
       "      <td>2423147.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Noor Aminah</td>\n",
       "      <td>2423140.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Akshay Shah</td>\n",
       "      <td>2423106.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Juhi Dujari</td>\n",
       "      <td>2423122.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Vankadara Krithika</td>\n",
       "      <td>2423128.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Asmee Zenith Lakra</td>\n",
       "      <td>2423116.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Ritu Dhumal</td>\n",
       "      <td>2423144.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Kshitij H</td>\n",
       "      <td>2423130.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>Abhir Deepak</td>\n",
       "      <td>2423103.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Sasmit Das</td>\n",
       "      <td>2423150.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>Ritika Sahay</td>\n",
       "      <td>2423163.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Anirudh Rajesh Ponoth</td>\n",
       "      <td>2423109.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>Abraham Varghese</td>\n",
       "      <td>2423104.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>Aanchal Baligar</td>\n",
       "      <td>2423102.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>Utkarsh Karwa</td>\n",
       "      <td>2423159.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>Maheeya Lalwani</td>\n",
       "      <td>2423133.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>Arnav Kalra</td>\n",
       "      <td>2423114.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>Nidhish Agarwal</td>\n",
       "      <td>2423138.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>Jiya Mehta</td>\n",
       "      <td>2423121.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>Aaditya Jain</td>\n",
       "      <td>2423101.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>Lakshya Goyal</td>\n",
       "      <td>2423131.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>Rudra Sharma</td>\n",
       "      <td>2423145.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>Kavya Singh</td>\n",
       "      <td>2423125.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>Sheril Bothra</td>\n",
       "      <td>2423152.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>Yug Mehta</td>\n",
       "      <td>2423162.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>Arnav Pokhriyal</td>\n",
       "      <td>2423165.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>Stuti Sinha</td>\n",
       "      <td>2423156.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>Anhad Ahluwalia</td>\n",
       "      <td>2423108.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>Manan Rander</td>\n",
       "      <td>2423134.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>Akshat Kumar Shaw</td>\n",
       "      <td>2423164.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>Vishesh Jaiswal</td>\n",
       "      <td>2423160.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>Suryashish Dey Sarkar</td>\n",
       "      <td>2423157.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>Nethra</td>\n",
       "      <td>2423137.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>Shubhayan Dutta Gupta</td>\n",
       "      <td>2423155.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>Nistha Jindal</td>\n",
       "      <td>2423139.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>Pranav S Hegde</td>\n",
       "      <td>2423141.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>Sameeksha Sathish</td>\n",
       "      <td>2423148.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>Aishwarya Gaggar</td>\n",
       "      <td>2423105.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>Anjaney Agrawal</td>\n",
       "      <td>2423110.0</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>Selva Ganapathy</td>\n",
       "      <td>2423151.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>Aryan Duggal</td>\n",
       "      <td>2423115.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-fadfb5d3-791d-4731-aa97-961c64d035dd')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-fadfb5d3-791d-4731-aa97-961c64d035dd button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-fadfb5d3-791d-4731-aa97-961c64d035dd');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    <div id=\"df-c2033d95-e118-4680-a1bb-f94bd32a8de5\">\n",
       "      <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-c2033d95-e118-4680-a1bb-f94bd32a8de5')\"\n",
       "                title=\"Suggest charts\"\n",
       "                style=\"display:none;\">\n",
       "\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "     width=\"24px\">\n",
       "    <g>\n",
       "        <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
       "    </g>\n",
       "</svg>\n",
       "      </button>\n",
       "\n",
       "<style>\n",
       "  .colab-df-quickchart {\n",
       "      --bg-color: #E8F0FE;\n",
       "      --fill-color: #1967D2;\n",
       "      --hover-bg-color: #E2EBFA;\n",
       "      --hover-fill-color: #174EA6;\n",
       "      --disabled-fill-color: #AAA;\n",
       "      --disabled-bg-color: #DDD;\n",
       "  }\n",
       "\n",
       "  [theme=dark] .colab-df-quickchart {\n",
       "      --bg-color: #3B4455;\n",
       "      --fill-color: #D2E3FC;\n",
       "      --hover-bg-color: #434B5C;\n",
       "      --hover-fill-color: #FFFFFF;\n",
       "      --disabled-bg-color: #3B4455;\n",
       "      --disabled-fill-color: #666;\n",
       "  }\n",
       "\n",
       "  .colab-df-quickchart {\n",
       "    background-color: var(--bg-color);\n",
       "    border: none;\n",
       "    border-radius: 50%;\n",
       "    cursor: pointer;\n",
       "    display: none;\n",
       "    fill: var(--fill-color);\n",
       "    height: 32px;\n",
       "    padding: 0;\n",
       "    width: 32px;\n",
       "  }\n",
       "\n",
       "  .colab-df-quickchart:hover {\n",
       "    background-color: var(--hover-bg-color);\n",
       "    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "    fill: var(--button-hover-fill-color);\n",
       "  }\n",
       "\n",
       "  .colab-df-quickchart-complete:disabled,\n",
       "  .colab-df-quickchart-complete:disabled:hover {\n",
       "    background-color: var(--disabled-bg-color);\n",
       "    fill: var(--disabled-fill-color);\n",
       "    box-shadow: none;\n",
       "  }\n",
       "\n",
       "  .colab-df-spinner {\n",
       "    border: 2px solid var(--fill-color);\n",
       "    border-color: transparent;\n",
       "    border-bottom-color: var(--fill-color);\n",
       "    animation:\n",
       "      spin 1s steps(1) infinite;\n",
       "  }\n",
       "\n",
       "  @keyframes spin {\n",
       "    0% {\n",
       "      border-color: transparent;\n",
       "      border-bottom-color: var(--fill-color);\n",
       "      border-left-color: var(--fill-color);\n",
       "    }\n",
       "    20% {\n",
       "      border-color: transparent;\n",
       "      border-left-color: var(--fill-color);\n",
       "      border-top-color: var(--fill-color);\n",
       "    }\n",
       "    30% {\n",
       "      border-color: transparent;\n",
       "      border-left-color: var(--fill-color);\n",
       "      border-top-color: var(--fill-color);\n",
       "      border-right-color: var(--fill-color);\n",
       "    }\n",
       "    40% {\n",
       "      border-color: transparent;\n",
       "      border-right-color: var(--fill-color);\n",
       "      border-top-color: var(--fill-color);\n",
       "    }\n",
       "    60% {\n",
       "      border-color: transparent;\n",
       "      border-right-color: var(--fill-color);\n",
       "    }\n",
       "    80% {\n",
       "      border-color: transparent;\n",
       "      border-right-color: var(--fill-color);\n",
       "      border-bottom-color: var(--fill-color);\n",
       "    }\n",
       "    90% {\n",
       "      border-color: transparent;\n",
       "      border-bottom-color: var(--fill-color);\n",
       "    }\n",
       "  }\n",
       "</style>\n",
       "\n",
       "      <script>\n",
       "        async function quickchart(key) {\n",
       "          const quickchartButtonEl =\n",
       "            document.querySelector('#' + key + ' button');\n",
       "          quickchartButtonEl.disabled = true;  // To prevent multiple clicks.\n",
       "          quickchartButtonEl.classList.add('colab-df-spinner');\n",
       "          try {\n",
       "            const charts = await google.colab.kernel.invokeFunction(\n",
       "                'suggestCharts', [key], {});\n",
       "          } catch (error) {\n",
       "            console.error('Error during call to suggestCharts:', error);\n",
       "          }\n",
       "          quickchartButtonEl.classList.remove('colab-df-spinner');\n",
       "          quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
       "        }\n",
       "        (() => {\n",
       "          let quickchartButtonEl =\n",
       "            document.querySelector('#df-c2033d95-e118-4680-a1bb-f94bd32a8de5 button');\n",
       "          quickchartButtonEl.style.display =\n",
       "            google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "        })();\n",
       "      </script>\n",
       "    </div>\n",
       "\n",
       "  <div id=\"id_da2e60cc-a676-45d2-90df-30765d38ccc4\">\n",
       "    <style>\n",
       "      .colab-df-generate {\n",
       "        background-color: #E8F0FE;\n",
       "        border: none;\n",
       "        border-radius: 50%;\n",
       "        cursor: pointer;\n",
       "        display: none;\n",
       "        fill: #1967D2;\n",
       "        height: 32px;\n",
       "        padding: 0 0 0 0;\n",
       "        width: 32px;\n",
       "      }\n",
       "\n",
       "      .colab-df-generate:hover {\n",
       "        background-color: #E2EBFA;\n",
       "        box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "        fill: #174EA6;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate {\n",
       "        background-color: #3B4455;\n",
       "        fill: #D2E3FC;\n",
       "      }\n",
       "\n",
       "      [theme=dark] .colab-df-generate:hover {\n",
       "        background-color: #434B5C;\n",
       "        box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "        filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "        fill: #FFFFFF;\n",
       "      }\n",
       "    </style>\n",
       "    <button class=\"colab-df-generate\" onclick=\"generateWithVariable('clean_df')\"\n",
       "            title=\"Generate code using this dataframe.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
       "       width=\"24px\">\n",
       "    <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    <script>\n",
       "      (() => {\n",
       "      const buttonEl =\n",
       "        document.querySelector('#id_da2e60cc-a676-45d2-90df-30765d38ccc4 button.colab-df-generate');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      buttonEl.onclick = () => {\n",
       "        google.colab.notebook.generateWithVariable('clean_df');\n",
       "      }\n",
       "      })();\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "text/plain": [
       "                     Name  Roll Number  Result  Error Sum  Value Sum  \\\n",
       "0              Prapti Das    2423142.0      10          1          7   \n",
       "1                    None          NaN      10          1          8   \n",
       "2          Kabir Sengupta    2423123.0      10          0          9   \n",
       "4          Manya Lakhmani    2423136.0      10          1          7   \n",
       "6           Sanika Khoche    2423149.0      10          0          5   \n",
       "12           Ankisha Jain    2423111.0      10          0          5   \n",
       "10            Kavyasree G    2423126.0      10          0          7   \n",
       "14       Sakshi Venugopal    2423147.0      10          1          7   \n",
       "13            Noor Aminah    2423140.0      10          1          8   \n",
       "16            Akshay Shah    2423106.0      10          1          7   \n",
       "17            Juhi Dujari    2423122.0      10          1          7   \n",
       "18     Vankadara Krithika    2423128.0      10          0          7   \n",
       "20     Asmee Zenith Lakra    2423116.0      10          0          0   \n",
       "21            Ritu Dhumal    2423144.0      10          1          7   \n",
       "24              Kshitij H    2423130.0      10          0          5   \n",
       "26           Abhir Deepak    2423103.0      10          0          5   \n",
       "27             Sasmit Das    2423150.0      10          0          5   \n",
       "28           Ritika Sahay    2423163.0      10          0          8   \n",
       "29  Anirudh Rajesh Ponoth    2423109.0      10          0          5   \n",
       "30       Abraham Varghese    2423104.0      10          0          5   \n",
       "40        Aanchal Baligar    2423102.0      10          0          5   \n",
       "34          Utkarsh Karwa    2423159.0      10          0          8   \n",
       "38        Maheeya Lalwani    2423133.0      10          0          5   \n",
       "39            Arnav Kalra    2423114.0      10          0          8   \n",
       "42        Nidhish Agarwal    2423138.0      10          0          5   \n",
       "43             Jiya Mehta    2423121.0      10          0          8   \n",
       "46           Aaditya Jain    2423101.0      10          0          5   \n",
       "45          Lakshya Goyal    2423131.0      10          0          5   \n",
       "47           Rudra Sharma    2423145.0      10          0          8   \n",
       "48            Kavya Singh    2423125.0      10          0          9   \n",
       "79          Sheril Bothra    2423152.0      10          1          8   \n",
       "49              Yug Mehta    2423162.0      10          0          8   \n",
       "52        Arnav Pokhriyal    2423165.0      10          0          9   \n",
       "54            Stuti Sinha    2423156.0      10          0          8   \n",
       "55        Anhad Ahluwalia    2423108.0      10          1          7   \n",
       "56           Manan Rander    2423134.0      10          0          9   \n",
       "58      Akshat Kumar Shaw    2423164.0      10          0          9   \n",
       "59        Vishesh Jaiswal    2423160.0      10          0          9   \n",
       "63  Suryashish Dey Sarkar    2423157.0      10          0          9   \n",
       "65                 Nethra    2423137.0      10          0          8   \n",
       "64  Shubhayan Dutta Gupta    2423155.0      10          1          8   \n",
       "73          Nistha Jindal    2423139.0      10          1          7   \n",
       "68         Pranav S Hegde    2423141.0      10          0          5   \n",
       "70      Sameeksha Sathish    2423148.0      10          0          8   \n",
       "69       Aishwarya Gaggar    2423105.0      10          0          8   \n",
       "71        Anjaney Agrawal    2423110.0      10          1          7   \n",
       "78        Selva Ganapathy    2423151.0      10          0          8   \n",
       "60           Aryan Duggal    2423115.0      10          0          9   \n",
       "\n",
       "    Formula Sum  \n",
       "0            10  \n",
       "1            10  \n",
       "2            10  \n",
       "4            10  \n",
       "6            10  \n",
       "12           10  \n",
       "10           10  \n",
       "14           10  \n",
       "13           10  \n",
       "16           10  \n",
       "17           10  \n",
       "18           10  \n",
       "20           10  \n",
       "21           10  \n",
       "24           10  \n",
       "26           10  \n",
       "27           10  \n",
       "28           10  \n",
       "29           10  \n",
       "30           10  \n",
       "40           10  \n",
       "34           10  \n",
       "38           10  \n",
       "39           10  \n",
       "42           10  \n",
       "43           10  \n",
       "46           10  \n",
       "45           10  \n",
       "47           10  \n",
       "48           10  \n",
       "79           10  \n",
       "49           10  \n",
       "52           10  \n",
       "54           10  \n",
       "55           10  \n",
       "56           10  \n",
       "58           10  \n",
       "59           10  \n",
       "63           10  \n",
       "65           10  \n",
       "64           10  \n",
       "73           10  \n",
       "68           10  \n",
       "70           10  \n",
       "69           10  \n",
       "71           10  \n",
       "78           10  \n",
       "60            1  "
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_df = result.sort_values(by='Formula Sum', ascending= False)\n",
    "\n",
    "# new_df.to_csv(\"Assignment_1 Metrics\", index = False)\n",
    "clean_df = new_df.drop_duplicates(subset=['Roll Number'])\n",
    "clean_df.to_csv(f\"{assignment_number} Metrics.csv\", index = False)\n",
    "\n",
    "clean_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "x2JVLvRAu_lX"
   },
   "source": [
    "# EOF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "executionInfo": {
     "elapsed": 2,
     "status": "ok",
     "timestamp": 1752747752387,
     "user": {
      "displayName": "Chandravesh Chaudhari Business and Management (BGR)",
      "userId": "14503359536136720323"
     },
     "user_tz": -330
    },
    "id": "6Z4ubcC1y5M6"
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": ".venv (3.13.7)",
   "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.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
