From aab70cdd8b16edc84a452d4f79671969959d9b2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CMSS3-ALSULAIMA=E2=80=9D?=
 <Mohammed3.Alsulaimani@live.uwe.ac.uk>
Date: Fri, 10 Nov 2023 05:58:45 +0400
Subject: [PATCH] the 75th percentile

---
 ...ogramming Task 1 Template-checkpoint.ipynb | 455 ++++++++++++++++++
 UFCFVQ-15-M Programming Task 1 Template.ipynb |  33 +-
 2 files changed, 484 insertions(+), 4 deletions(-)
 create mode 100644 .ipynb_checkpoints/UFCFVQ-15-M Programming Task 1 Template-checkpoint.ipynb

diff --git a/.ipynb_checkpoints/UFCFVQ-15-M Programming Task 1 Template-checkpoint.ipynb b/.ipynb_checkpoints/UFCFVQ-15-M Programming Task 1 Template-checkpoint.ipynb
new file mode 100644
index 0000000..9bac290
--- /dev/null
+++ b/.ipynb_checkpoints/UFCFVQ-15-M Programming Task 1 Template-checkpoint.ipynb	
@@ -0,0 +1,455 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# UFCFVQ-15-M Programming for Data Science\n",
+    "# Programming Task 1\n",
+    "\n",
+    "## Student Id: "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.1 -Find the arithmetic mean using function"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The mean value is: 14.5\n"
+     ]
+    }
+   ],
+   "source": [
+    "numbers_list = [\n",
+    "    29, 17, 28, 6, 14, 7, 4, 27, 21, 15,\n",
+    "    10, 16, 24, 26, 3, 11, 13, 8, 23, 9,\n",
+    "    0, 22, 12, 2, 18, 19, 5, 1, 20, 25\n",
+    "]\n",
+    "\n",
+    "#  Find the average of a given list of numbers\n",
+    "\n",
+    "def arithmetic_mean(numbers):\n",
+    "    total_sum = sum(numbers)  \n",
+    "    mean_value = total_sum / len(numbers)  \n",
+    "    return mean_value  \n",
+    "\n",
+    "#  Execute the function and save the resulting value\n",
+    "\n",
+    "mean_value = arithmetic_mean(numbers_list)  \n",
+    "\n",
+    "#  Display the average value(mean)\n",
+    "\n",
+    "print(f\"The mean value is: {mean_value}\") \n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    \n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.2 - Find the standard deviation using function"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The standard deviation is: 8.65544144839919\n"
+     ]
+    }
+   ],
+   "source": [
+    "def find_std(numbers, mean):\n",
+    "\n",
+    "#  Find the variance by averaging the squared differences, from the mean.\n",
+    "#  Then take the root to obtain the standard deviation.\n",
+    "\n",
+    "    std_value =  (sum([(x - mean) ** 2 for x in numbers]) / len(numbers)) ** 0.5\n",
+    "    return (std_value)\n",
+    "\n",
+    "#  Determine the mean of the numbers_list using the function we defined earlier.\n",
+    "\n",
+    "mean_value = arithmetic_mean(numbers_list)\n",
+    "\n",
+    "#  Calculate the deviation using the find_std function and the mean_value.\n",
+    "\n",
+    "std_value = find_std(numbers_list, mean_value)\n",
+    "\n",
+    "# Print the calculated standard deviation\n",
+    "\n",
+    "print(f\"The standard deviation is: {std_value}\")\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.3 - Find the min/max values using functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The minimum value is: 0\n",
+      "The maximum value is: 29\n"
+     ]
+    }
+   ],
+   "source": [
+    "numbers_list = [\n",
+    "    29, 17, 28, 6, 14, 7, 4, 27, 21, 15,\n",
+    "    10, 16, 24, 26, 3, 11, 13, 8, 23, 9,\n",
+    "    0, 22, 12, 2, 18, 19, 5, 1, 20, 25\n",
+    "]\n",
+    "\n",
+    "# Create two functions that will allow you to find the min/max  values, in a given list.\n",
+    "\n",
+    "def min_value(numbers):\n",
+    "    return min(numbers)\n",
+    "\n",
+    "def max_value(numbers):\n",
+    "    return max(numbers)\n",
+    "\n",
+    "# Find the min/max values within the list\n",
+    "\n",
+    "The_min_value = min_value(numbers_list)\n",
+    "The_max_value = max_value(numbers_list)\n",
+    "\n",
+    "# Display the result\n",
+    "\n",
+    "print(f\"The minimum value is: {The_min_value}\")\n",
+    "print(f\"The maximum value is: {The_max_value}\")\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "\n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.4 - Find the 25th percentile using functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The 25th percentile is: 7\n"
+     ]
+    }
+   ],
+   "source": [
+    "numbers_list = [\n",
+    "    29, 17, 28, 6, 14, 7, 4, 27, 21, 15,\n",
+    "    10, 16, 24, 26, 3, 11, 13, 8, 23, 9,\n",
+    "    0, 22, 12, 2, 18, 19, 5, 1, 20, 25\n",
+    "]\n",
+    "\n",
+    "# Function to calculate a percentile within a given list of numbers\n",
+    "\n",
+    "def calculate_percentile(numbers, percentile):\n",
+    "    sorted_list = sorted(numbers)\n",
+    "    index = int((len(sorted_list) - 1) * (percentile / 100.0))\n",
+    "    return sorted_list[index]\n",
+    "\n",
+    "# Calculate the 25th percentile of the list\n",
+    "\n",
+    "percentile_25 = calculate_percentile(numbers_list, 25)\n",
+    "\n",
+    "\n",
+    "# Display the 25th percentile value\n",
+    "\n",
+    "print(f\"The 25th percentile is: {percentile_25}\")\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.5 - Find the 50th percentile using functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The 50th percentile is: 14\n"
+     ]
+    }
+   ],
+   "source": [
+    "\n",
+    "numbers_list = [\n",
+    "    29, 17, 28, 6, 14, 7, 4, 27, 21, 15,\n",
+    "    10, 16, 24, 26, 3, 11, 13, 8, 23, 9,\n",
+    "    0, 22, 12, 2, 18, 19, 5, 1, 20, 25\n",
+    "]\n",
+    "\n",
+    "# Function to calculate a percentile within a given list of numbers\n",
+    "\n",
+    "def calculate_percentile(numbers, percentile):\n",
+    "    sorted_list = sorted(numbers)\n",
+    "    index = int((len(sorted_list) - 1) * (percentile / 100.0))\n",
+    "    return sorted_list[index]\n",
+    "\n",
+    "#  Calculate the percentile_50, which is also known as the median using the function we already have.\n",
+    "\n",
+    "percentile_50 = calculate_percentile(numbers_list, 50)\n",
+    "print(f\"The 50th percentile is: {percentile_50}\")\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.6 - Find the 75th percentile using functions"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# add code here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.7 - Print the set of summary statistics in tabular form"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# add code here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.8 - Read data from a file into memory"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# add code here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:     \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.9 - Design and build a data structure to store CSV data in memory"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# add code here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:     \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.10 - Create a generic statistical summary function "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# add code here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.11  Adherence to good coding standards"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Requirement FR1.12 - Process Development report"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# write  here"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "##### MARK:      \n",
+    "#### FEEDBACK:    "
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "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.11.5"
+  },
+  "vscode": {
+   "interpreter": {
+    "hash": "9ef62a9e119055cb3f7e8378d4eaf3b008dbaf8b8298b9c44f87df8240f3e8bc"
+   }
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 4
+}
diff --git a/UFCFVQ-15-M Programming Task 1 Template.ipynb b/UFCFVQ-15-M Programming Task 1 Template.ipynb
index 1b3d3e4..5dab479 100644
--- a/UFCFVQ-15-M Programming Task 1 Template.ipynb	
+++ b/UFCFVQ-15-M Programming Task 1 Template.ipynb	
@@ -277,11 +277,36 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 6,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "The 75th percentile is: 21\n"
+     ]
+    }
+   ],
    "source": [
-    "# add code here"
+    "numbers_list = [\n",
+    "    29, 17, 28, 6, 14, 7, 4, 27, 21, 15,\n",
+    "    10, 16, 24, 26, 3, 11, 13, 8, 23, 9,\n",
+    "    0, 22, 12, 2, 18, 19, 5, 1, 20, 25\n",
+    "]\n",
+    "\n",
+    "# Function to calculate a percentile within a given list of numbers\n",
+    "\n",
+    "def calculate_percentile(numbers, percentile):\n",
+    "    sorted_list = sorted(numbers)\n",
+    "    index = int((len(sorted_list) - 1) * (percentile / 100.0))\n",
+    "    return sorted_list[index]\n",
+    "\n",
+    "#  Calculate the percentile_75, using the function we already have.\n",
+    "\n",
+    "percentile_75 = calculate_percentile(numbers_list, 75)\n",
+    "\n",
+    "print(f\"The 75th percentile is: {percentile_75}\")\n"
    ]
   },
   {
@@ -442,7 +467,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.9.6"
+   "version": "3.11.5"
   },
   "vscode": {
    "interpreter": {
-- 
GitLab