From c3cd83c63cb8983fd2e66f09ede99218d49373f4 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 07:22:10 +0400 Subject: [PATCH] summary statistics --- UFCFVQ-15-M Programming Task 1 Template.ipynb | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/UFCFVQ-15-M Programming Task 1 Template.ipynb b/UFCFVQ-15-M Programming Task 1 Template.ipynb index 5dab479..767f526 100644 --- a/UFCFVQ-15-M Programming Task 1 Template.ipynb +++ b/UFCFVQ-15-M Programming Task 1 Template.ipynb @@ -326,11 +326,40 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Statistic Value\n", + "-------------------------\n", + "Mean 14.50\n", + "STD 8.66\n", + "Min 0\n", + "Max 29\n", + "25% 7\n", + "50% 14\n", + "75% 21\n" + ] + } + ], "source": [ - "# add code here" + "\n", + "# A summary of the statistics, including the standard deviation, minimum and maximum values, as well, as percentiles.\n", + "\n", + "header = f\"{'Statistic':<15}{'Value':>10}\"\n", + "separator = '-' * len(header)\n", + "print(header)\n", + "print(separator)\n", + "print(f\"{'Mean':<15}{mean_value:>10.2f}\")\n", + "print(f\"{'STD':<15}{std_value:>10.2f}\")\n", + "print(f\"{'Min':<15}{The_min_value:>10}\")\n", + "print(f\"{'Max':<15}{The_max_value:>10}\")\n", + "print(f\"{'25%':<15}{percentile_25:>10}\")\n", + "print(f\"{'50%':<15}{percentile_50:>10}\")\n", + "print(f\"{'75%':<15}{percentile_75:>10}\")" ] }, { -- GitLab