├── .gitattributes ├── Control Structures and String Manipulations.ipynb ├── Heart.ipynb ├── How to Deal with Missing Data in Python ├── 04_02b.ipynb └── students.xlsx ├── How to Import Data in Python ├── 02_02b.ipynb ├── brics.csv └── brics.xlsx ├── How to Normalize Data in Python ├── 04_04b.ipynb └── vehicles.csv ├── How to Sample Data in Python ├── 04_06b.ipynb └── vehicles.csv ├── How to Summarize Data in Python ├── 03_02b.ipynb └── washers.csv ├── How to Visualize Data in Python ├── 03_04b.ipynb └── vehicles.csv ├── NestedLoops.ipynb ├── README.md ├── covid_data_explorer ├── README.md ├── covid_explorer.py ├── covid_explorer_ui.py ├── data │ └── covid-data.csv ├── requirements.txt └── saved_reports │ ├── Afghanistan_statistics.txt │ └── Afghanistan_total_cases_trend.png └── model-check.ipynb /.gitattributes: -------------------------------------------------------------------------------- 1 | covid_data_explorer/data/covid-data.csv filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /Control Structures and String Manipulations.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "63be4439-5f0a-4d77-9b82-ff4a651bff6f", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdin", 11 | "output_type": "stream", 12 | "text": [ 13 | "Enter a number: 2\n" 14 | ] 15 | }, 16 | { 17 | "name": "stdout", 18 | "output_type": "stream", 19 | "text": [ 20 | "The positive number entered is: 2\n" 21 | ] 22 | } 23 | ], 24 | "source": [ 25 | "num = int(input(\"Enter a number: \"))\n", 26 | "if num < 0:\n", 27 | " print(\"Please input a positive number\")\n", 28 | "else:\n", 29 | " print(\"The positive number entered is:\", num)" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 3, 35 | "id": "36c891f9-808a-4051-8608-4976ba3994d5", 36 | "metadata": {}, 37 | "outputs": [ 38 | { 39 | "name": "stdin", 40 | "output_type": "stream", 41 | "text": [ 42 | "Enter a number: -2\n" 43 | ] 44 | }, 45 | { 46 | "name": "stdout", 47 | "output_type": "stream", 48 | "text": [ 49 | "The number is negative\n" 50 | ] 51 | } 52 | ], 53 | "source": [ 54 | "num = int(input(\"Enter a number: \"))\n", 55 | "if num >= 0:\n", 56 | " print(\"The number is positive\")\n", 57 | "else:\n", 58 | " print(\"The number is negative\")\n" 59 | ] 60 | }, 61 | { 62 | "cell_type": "code", 63 | "execution_count": 4, 64 | "id": "15b2be2c-c519-4b96-b9f6-c807db5ef89c", 65 | "metadata": {}, 66 | "outputs": [ 67 | { 68 | "name": "stdin", 69 | "output_type": "stream", 70 | "text": [ 71 | "Enter a number: 0\n" 72 | ] 73 | }, 74 | { 75 | "name": "stdout", 76 | "output_type": "stream", 77 | "text": [ 78 | "The number is zero\n" 79 | ] 80 | } 81 | ], 82 | "source": [ 83 | "num = int(input(\"Enter a number: \"))\n", 84 | "if num > 0:\n", 85 | " print(\"The number is positive\")\n", 86 | "elif num < 0:\n", 87 | " print(\"The number is negative\")\n", 88 | "else:\n", 89 | " print(\"The number is zero\")\n" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": 5, 95 | "id": "87780f1a-d084-4fa3-bb4d-b8173fc43e8b", 96 | "metadata": {}, 97 | "outputs": [ 98 | { 99 | "name": "stdin", 100 | "output_type": "stream", 101 | "text": [ 102 | "Enter the first number: 5\n", 103 | "Enter the second number: 2.5\n", 104 | "Enter the operation (+, -, *, /): +\n" 105 | ] 106 | }, 107 | { 108 | "name": "stdout", 109 | "output_type": "stream", 110 | "text": [ 111 | "Result: 7.5\n" 112 | ] 113 | } 114 | ], 115 | "source": [ 116 | "num1 = float(input(\"Enter the first number: \"))\n", 117 | "num2 = float(input(\"Enter the second number: \"))\n", 118 | "operation = input(\"Enter the operation (+, -, *, /): \")\n", 119 | "\n", 120 | "if operation == '+':\n", 121 | " print(\"Result:\", num1 + num2)\n", 122 | "elif operation == '-':\n", 123 | " print(\"Result:\", num1 - num2)\n", 124 | "elif operation == '*':\n", 125 | " print(\"Result:\", num1 * num2)\n", 126 | "elif operation == '/':\n", 127 | " if num2 != 0:\n", 128 | " print(\"Result:\", num1 / num2)\n", 129 | " else:\n", 130 | " print(\"Cannot divide by zero\")\n", 131 | "else:\n", 132 | " print(\"Invalid operation\")\n" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 7, 138 | "id": "c6f53bb0-2d37-4104-9d8b-bb733eb4c237", 139 | "metadata": {}, 140 | "outputs": [ 141 | { 142 | "name": "stdin", 143 | "output_type": "stream", 144 | "text": [ 145 | "Enter a string: ali\n", 146 | "Enter a substring to search for: i\n" 147 | ] 148 | }, 149 | { 150 | "name": "stdout", 151 | "output_type": "stream", 152 | "text": [ 153 | "Substring found at index: 2\n" 154 | ] 155 | } 156 | ], 157 | "source": [ 158 | "string = input(\"Enter a string: \")\n", 159 | "substring = input(\"Enter a substring to search for: \")\n", 160 | "\n", 161 | "index = 0\n", 162 | "while index < len(string):\n", 163 | " index = string.find(substring, index)\n", 164 | " if index == -1:\n", 165 | " break\n", 166 | " print(\"Substring found at index:\", index)\n", 167 | " index += 1\n" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": 9, 173 | "id": "6f2e44ea-2d13-4070-bb1b-ace75daafc12", 174 | "metadata": {}, 175 | "outputs": [ 176 | { 177 | "name": "stdin", 178 | "output_type": "stream", 179 | "text": [ 180 | "Enter your name: saqib\n" 181 | ] 182 | }, 183 | { 184 | "name": "stdout", 185 | "output_type": "stream", 186 | "text": [ 187 | "Menu:\n", 188 | "Enter 1 for calling .islower() method\n", 189 | "Enter 2 for calling .isupper() method\n", 190 | "Enter 3 for calling .lower() method\n" 191 | ] 192 | }, 193 | { 194 | "name": "stdin", 195 | "output_type": "stream", 196 | "text": [ 197 | "Enter your choice: 2\n" 198 | ] 199 | }, 200 | { 201 | "name": "stdout", 202 | "output_type": "stream", 203 | "text": [ 204 | "False\n" 205 | ] 206 | } 207 | ], 208 | "source": [ 209 | "userName = input(\"Enter your name: \")\n", 210 | "print(\"Menu:\")\n", 211 | "print(\"Enter 1 for calling .islower() method\")\n", 212 | "print(\"Enter 2 for calling .isupper() method\")\n", 213 | "print(\"Enter 3 for calling .lower() method\")\n", 214 | "\n", 215 | "choice = int(input(\"Enter your choice: \"))\n", 216 | "if choice == 1:\n", 217 | " print(userName.islower())\n", 218 | "elif choice == 2:\n", 219 | " print(userName.isupper())\n", 220 | "elif choice == 3:\n", 221 | " print(userName.lower())\n", 222 | "else:\n", 223 | " print(\"Invalid choice\")\n" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": 10, 229 | "id": "e7343dd3-4868-4f83-be98-ab0a99e5626a", 230 | "metadata": {}, 231 | "outputs": [ 232 | { 233 | "name": "stdin", 234 | "output_type": "stream", 235 | "text": [ 236 | "Enter a string: solangi\n" 237 | ] 238 | }, 239 | { 240 | "name": "stdout", 241 | "output_type": "stream", 242 | "text": [ 243 | "Middle character: a\n" 244 | ] 245 | } 246 | ], 247 | "source": [ 248 | "string = input(\"Enter a string: \")\n", 249 | "length = len(string)\n", 250 | "if length % 2 == 0:\n", 251 | " middle = length // 2\n", 252 | " print(\"Middle characters:\", string[middle - 1:middle + 1])\n", 253 | "else:\n", 254 | " middle = length // 2\n", 255 | " print(\"Middle character:\", string[middle])\n" 256 | ] 257 | }, 258 | { 259 | "cell_type": "code", 260 | "execution_count": null, 261 | "id": "f41d08b5-fed3-4ae5-ab52-3f58d0a1c18d", 262 | "metadata": {}, 263 | "outputs": [], 264 | "source": [] 265 | } 266 | ], 267 | "metadata": { 268 | "kernelspec": { 269 | "display_name": "Python 3 (ipykernel)", 270 | "language": "python", 271 | "name": "python3" 272 | }, 273 | "language_info": { 274 | "codemirror_mode": { 275 | "name": "ipython", 276 | "version": 3 277 | }, 278 | "file_extension": ".py", 279 | "mimetype": "text/x-python", 280 | "name": "python", 281 | "nbconvert_exporter": "python", 282 | "pygments_lexer": "ipython3", 283 | "version": "3.11.7" 284 | } 285 | }, 286 | "nbformat": 4, 287 | "nbformat_minor": 5 288 | } 289 | -------------------------------------------------------------------------------- /Heart.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 27, 6 | "id": "19c94908", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "from turtle import *" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 28, 16 | "id": "a3609e7d", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "bgcolor(\"black\")\n", 21 | "color(\"red\")\n", 22 | "title(\"StudyMuch\")\n", 23 | "begin_fill()\n", 24 | "pensize(3)\n", 25 | "left(50)\n", 26 | "forward(133)\n", 27 | "circle(50,200)\n", 28 | "right(140)\n", 29 | "circle(50,200)\n", 30 | "forward(133)\n", 31 | "end_fill()\n", 32 | "\n", 33 | "penup()\n", 34 | "goto(0,-50)\n", 35 | "pendown()\n", 36 | "color(\"red\")\n", 37 | "write(\"I Love You\",align=\"center\",\n", 38 | " font=(\"Brush Script TM\",45, \"normal\"))\n", 39 | "hideturtle()\n", 40 | "done()" 41 | ] 42 | } 43 | ], 44 | "metadata": { 45 | "kernelspec": { 46 | "display_name": "Python 3 (ipykernel)", 47 | "language": "python", 48 | "name": "python3" 49 | }, 50 | "language_info": { 51 | "codemirror_mode": { 52 | "name": "ipython", 53 | "version": 3 54 | }, 55 | "file_extension": ".py", 56 | "mimetype": "text/x-python", 57 | "name": "python", 58 | "nbconvert_exporter": "python", 59 | "pygments_lexer": "ipython3", 60 | "version": "3.11.4" 61 | } 62 | }, 63 | "nbformat": 4, 64 | "nbformat_minor": 5 65 | } 66 | -------------------------------------------------------------------------------- /How to Deal with Missing Data in Python/students.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaikh-Yaqoob/Python-Hello-World/e4bb413c5e69e98701bc8597f9224b465509dc89/How to Deal with Missing Data in Python/students.xlsx -------------------------------------------------------------------------------- /How to Import Data in Python/02_02b.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# How to Import Data in Python" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Learning Objectives\n", 15 | "One of the reasons why Python is such a popular programming language for machine learning is because it supports some very powerful and easy to use packages which are purpose-built for data analysis. One of these packages is the **pandas** package. In this exercise, you will get a brief introduction to the pandas package and how to import data using functions provided by the pandas package. By the end of this tutorial, you will have learned:\n", 16 | "\n", 17 | "+ what a pandas Series is\n", 18 | "+ what a pandas DataFrame is\n", 19 | "+ how to import data from a CSV file\n", 20 | "+ how to import data from an Excel file" 21 | ] 22 | }, 23 | { 24 | "cell_type": "markdown", 25 | "metadata": { 26 | "colab_type": "text", 27 | "id": "rgzeumtubBxE" 28 | }, 29 | "source": [ 30 | "## The pandas Package" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 4, 36 | "metadata": { 37 | "colab": {}, 38 | "colab_type": "code", 39 | "id": "i8NQe2iYbBxK" 40 | }, 41 | "outputs": [], 42 | "source": [ 43 | "import pandas as pd" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "## The pandas Series" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 6, 56 | "metadata": {}, 57 | "outputs": [ 58 | { 59 | "data": { 60 | "text/plain": [ 61 | "0 Brazil\n", 62 | "1 Russia\n", 63 | "2 India\n", 64 | "3 China\n", 65 | "4 South Africa\n", 66 | "dtype: object" 67 | ] 68 | }, 69 | "execution_count": 6, 70 | "metadata": {}, 71 | "output_type": "execute_result" 72 | } 73 | ], 74 | "source": [ 75 | "members = [\"Brazil\", \"Russia\", \"India\", \"China\", \"South Africa\"]\n", 76 | "brics1 = pd.Series(members)\n", 77 | "brics1" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": 7, 83 | "metadata": {}, 84 | "outputs": [ 85 | { 86 | "data": { 87 | "text/plain": [ 88 | "pandas.core.series.Series" 89 | ] 90 | }, 91 | "execution_count": 7, 92 | "metadata": {}, 93 | "output_type": "execute_result" 94 | } 95 | ], 96 | "source": [ 97 | "type(brics1)" 98 | ] 99 | }, 100 | { 101 | "cell_type": "markdown", 102 | "metadata": {}, 103 | "source": [ 104 | "## The pandas DataFrame" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 8, 110 | "metadata": { 111 | "colab": {}, 112 | "colab_type": "code", 113 | "id": "Nzcoz81tbByT" 114 | }, 115 | "outputs": [ 116 | { 117 | "data": { 118 | "text/html": [ 119 | "
\n", 120 | "\n", 133 | "\n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | "
countrycapitalgdpliteracyexpectancypopulation
0BrazilBrasilia27500.94476.8210.87
1RussiaMoscow16580.99772.7143.96
2IndiaNew Delhi32020.72168.81367.09
3ChinaBeijing152700.96476.41415.05
4South AfricaPretoria3700.94363.657.40
\n", 193 | "
" 194 | ], 195 | "text/plain": [ 196 | " country capital gdp literacy expectancy population\n", 197 | "0 Brazil Brasilia 2750 0.944 76.8 210.87\n", 198 | "1 Russia Moscow 1658 0.997 72.7 143.96\n", 199 | "2 India New Delhi 3202 0.721 68.8 1367.09\n", 200 | "3 China Beijing 15270 0.964 76.4 1415.05\n", 201 | "4 South Africa Pretoria 370 0.943 63.6 57.40" 202 | ] 203 | }, 204 | "execution_count": 8, 205 | "metadata": {}, 206 | "output_type": "execute_result" 207 | } 208 | ], 209 | "source": [ 210 | "members = {\"country\": [\"Brazil\", \"Russia\", \"India\", \"China\", \"South Africa\"],\n", 211 | " \"capital\": [\"Brasilia\", \"Moscow\", \"New Delhi\", \"Beijing\", \"Pretoria\"],\n", 212 | " \"gdp\": [2750, 1658, 3202, 15270, 370],\n", 213 | " \"literacy\":[.944, .997, .721, .964, .943],\n", 214 | " \"expectancy\": [76.8, 72.7, 68.8, 76.4, 63.6],\n", 215 | " \"population\": [210.87, 143.96, 1367.09, 1415.05, 57.4]}\n", 216 | "brics2 = pd.DataFrame(members)\n", 217 | "brics2" 218 | ] 219 | }, 220 | { 221 | "cell_type": "code", 222 | "execution_count": 9, 223 | "metadata": { 224 | "scrolled": true 225 | }, 226 | "outputs": [ 227 | { 228 | "data": { 229 | "text/plain": [ 230 | "pandas.core.frame.DataFrame" 231 | ] 232 | }, 233 | "execution_count": 9, 234 | "metadata": {}, 235 | "output_type": "execute_result" 236 | } 237 | ], 238 | "source": [ 239 | "type(brics2)" 240 | ] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "execution_count": 10, 245 | "metadata": {}, 246 | "outputs": [ 247 | { 248 | "data": { 249 | "text/html": [ 250 | "
\n", 251 | "\n", 264 | "\n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | "
countrycapitalgdpliteracyexpectancypopulation
0BrazilBrasilia27500.94476.8210.87
1RussiaMoscow16580.99772.7143.96
2IndiaNew Delhi32020.72168.81367.09
3ChinaBeijing152700.96476.41415.05
4South AfricaPretoria3700.94363.657.40
\n", 324 | "
" 325 | ], 326 | "text/plain": [ 327 | " country capital gdp literacy expectancy population\n", 328 | "0 Brazil Brasilia 2750 0.944 76.8 210.87\n", 329 | "1 Russia Moscow 1658 0.997 72.7 143.96\n", 330 | "2 India New Delhi 3202 0.721 68.8 1367.09\n", 331 | "3 China Beijing 15270 0.964 76.4 1415.05\n", 332 | "4 South Africa Pretoria 370 0.943 63.6 57.40" 333 | ] 334 | }, 335 | "execution_count": 10, 336 | "metadata": {}, 337 | "output_type": "execute_result" 338 | } 339 | ], 340 | "source": [ 341 | "members = [[\"Brazil\", \"Brasilia\", 2750, 0.944, 76.8, 210.87],\n", 342 | " [\"Russia\", \"Moscow\", 1658, 0.997, 72.7, 143.96],\n", 343 | " [\"India\", \"New Delhi\", 3202, 0.721, 68.8, 1367.09],\n", 344 | " [\"China\", \"Beijing\", 15270, 0.964, 76.4, 1415.05],\n", 345 | " [\"South Africa\", \"Pretoria\", 370, 0.943, 63.6, 57.4]]\n", 346 | "labels = [\"country\", \"capital\", \"gdp\", \"literacy\", \"expectancy\", \"population\"]\n", 347 | "brics3 = pd.DataFrame(members, columns = labels)\n", 348 | "brics3" 349 | ] 350 | }, 351 | { 352 | "cell_type": "markdown", 353 | "metadata": {}, 354 | "source": [ 355 | "## How to import data from a CSV file" 356 | ] 357 | }, 358 | { 359 | "cell_type": "code", 360 | "execution_count": 11, 361 | "metadata": {}, 362 | "outputs": [ 363 | { 364 | "data": { 365 | "text/html": [ 366 | "
\n", 367 | "\n", 380 | "\n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | "
countrycapitalgdpliteracyexpectancypopulation
0BrazilBrasilia27500.94476.8210.87
1RussiaMoscow16580.99772.7143.96
2IndiaNew Delhi32020.72168.81367.09
3ChinaBeijing152700.96476.41415.05
4South AfricaPretoria3700.94363.657.40
\n", 440 | "
" 441 | ], 442 | "text/plain": [ 443 | " country capital gdp literacy expectancy population\n", 444 | "0 Brazil Brasilia 2750 0.944 76.8 210.87\n", 445 | "1 Russia Moscow 1658 0.997 72.7 143.96\n", 446 | "2 India New Delhi 3202 0.721 68.8 1367.09\n", 447 | "3 China Beijing 15270 0.964 76.4 1415.05\n", 448 | "4 South Africa Pretoria 370 0.943 63.6 57.40" 449 | ] 450 | }, 451 | "execution_count": 11, 452 | "metadata": {}, 453 | "output_type": "execute_result" 454 | } 455 | ], 456 | "source": [ 457 | "brics4 = pd.read_csv(\"brics.csv\")\n", 458 | "brics4" 459 | ] 460 | }, 461 | { 462 | "cell_type": "markdown", 463 | "metadata": {}, 464 | "source": [ 465 | "## How to import data from an Excel file" 466 | ] 467 | }, 468 | { 469 | "cell_type": "code", 470 | "execution_count": 12, 471 | "metadata": {}, 472 | "outputs": [ 473 | { 474 | "data": { 475 | "text/html": [ 476 | "
\n", 477 | "\n", 490 | "\n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | "
countrycapitalgdpliteracyexpectancypopulation
0BrazilBrasilia27500.94476.8210.87
1RussiaMoscow16580.99772.7143.96
2IndiaNew Delhi32020.72168.81367.09
3ChinaBeijing152700.96476.41415.05
4South AfricaPretoria3700.94363.657.40
\n", 550 | "
" 551 | ], 552 | "text/plain": [ 553 | " country capital gdp literacy expectancy population\n", 554 | "0 Brazil Brasilia 2750 0.944 76.8 210.87\n", 555 | "1 Russia Moscow 1658 0.997 72.7 143.96\n", 556 | "2 India New Delhi 3202 0.721 68.8 1367.09\n", 557 | "3 China Beijing 15270 0.964 76.4 1415.05\n", 558 | "4 South Africa Pretoria 370 0.943 63.6 57.40" 559 | ] 560 | }, 561 | "execution_count": 12, 562 | "metadata": {}, 563 | "output_type": "execute_result" 564 | } 565 | ], 566 | "source": [ 567 | "brics5 = pd.read_excel(\"brics.xlsx\")\n", 568 | "brics5" 569 | ] 570 | }, 571 | { 572 | "cell_type": "code", 573 | "execution_count": 15, 574 | "metadata": {}, 575 | "outputs": [ 576 | { 577 | "data": { 578 | "text/html": [ 579 | "
\n", 580 | "\n", 593 | "\n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | " \n", 635 | " \n", 636 | " \n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | " \n", 666 | " \n", 667 | " \n", 668 | " \n", 669 | " \n", 670 | " \n", 671 | " \n", 672 | " \n", 673 | " \n", 674 | " \n", 675 | " \n", 676 | " \n", 677 | " \n", 678 | " \n", 679 | " \n", 680 | " \n", 681 | " \n", 682 | " \n", 683 | " \n", 684 | " \n", 685 | " \n", 686 | " \n", 687 | " \n", 688 | " \n", 689 | " \n", 690 | " \n", 691 | " \n", 692 | " \n", 693 | " \n", 694 | " \n", 695 | " \n", 696 | " \n", 697 | " \n", 698 | " \n", 699 | " \n", 700 | " \n", 701 | " \n", 702 | " \n", 703 | " \n", 704 | " \n", 705 | " \n", 706 | " \n", 707 | " \n", 708 | " \n", 709 | " \n", 710 | "
summitdatehostleaderlocation
01stJune 16th, 2009RussiaDmitry MedvedevYekaterinburg (Sevastianov's House)
12ndApril 15th, 2010BrazilLuiz Inácio Lula da SilvaBrasília (Itamaraty Palace)
23rdApril 14th, 2011ChinaHu JintaoSanya (Sheraton Sanya Resort)
34thMarch 29th, 2012IndiaManmohan SinghNew Delhi (Taj Mahal Hotel)
45thMarch 26th – 27th, 2013South AfricaJacob ZumaDurban (Durban ICC)
56thJuly 14th – 17th, 2014BrazilDilma RousseffFortaleza (Centro de Eventos do Ceará)
67thJuly 8th – 9th, 2015RussiaVladimir PutinUfa (Congress Hall)
78thOctober 15th – 16th, 2016IndiaNarendra ModiBenaulim (Taj Exotica)
89thSeptember 3th – 5th, 2017ChinaXi JinpingXiamen (Xiamen International Conference Center)
910thJuly 25th – 27th, 2018South AfricaCyril RamaphosaJohannesburg (Sandton Convention Centre)
1011thNovember 13th – 14th, 2019BrazilJair BolsonaroBrasília (Itamaraty Palace)
1112thNovember 17th, 2020RussiaVladimir PutinSaint Petersburg (video conference)
1213thTBAIndiaNarendra ModiNew Delhi
\n", 711 | "
" 712 | ], 713 | "text/plain": [ 714 | " summit date host \\\n", 715 | "0 1st June 16th, 2009 Russia \n", 716 | "1 2nd April 15th, 2010 Brazil \n", 717 | "2 3rd April 14th, 2011 China \n", 718 | "3 4th March 29th, 2012 India \n", 719 | "4 5th March 26th – 27th, 2013 South Africa \n", 720 | "5 6th July 14th – 17th, 2014 Brazil \n", 721 | "6 7th July 8th – 9th, 2015 Russia \n", 722 | "7 8th October 15th – 16th, 2016 India \n", 723 | "8 9th September 3th – 5th, 2017 China \n", 724 | "9 10th July 25th – 27th, 2018 South Africa \n", 725 | "10 11th November 13th – 14th, 2019 Brazil \n", 726 | "11 12th November 17th, 2020 Russia \n", 727 | "12 13th TBA India \n", 728 | "\n", 729 | " leader location \n", 730 | "0 Dmitry Medvedev Yekaterinburg (Sevastianov's House) \n", 731 | "1 Luiz Inácio Lula da Silva Brasília (Itamaraty Palace) \n", 732 | "2 Hu Jintao Sanya (Sheraton Sanya Resort) \n", 733 | "3 Manmohan Singh New Delhi (Taj Mahal Hotel) \n", 734 | "4 Jacob Zuma Durban (Durban ICC) \n", 735 | "5 Dilma Rousseff Fortaleza (Centro de Eventos do Ceará) \n", 736 | "6 Vladimir Putin Ufa (Congress Hall) \n", 737 | "7 Narendra Modi Benaulim (Taj Exotica) \n", 738 | "8 Xi Jinping Xiamen (Xiamen International Conference Center) \n", 739 | "9 Cyril Ramaphosa Johannesburg (Sandton Convention Centre) \n", 740 | "10 Jair Bolsonaro Brasília (Itamaraty Palace) \n", 741 | "11 Vladimir Putin Saint Petersburg (video conference) \n", 742 | "12 Narendra Modi New Delhi " 743 | ] 744 | }, 745 | "execution_count": 15, 746 | "metadata": {}, 747 | "output_type": "execute_result" 748 | } 749 | ], 750 | "source": [ 751 | "brics6 = pd.read_excel(\"brics.xlsx\" , sheet_name = \"Summits\")\n", 752 | "brics6" 753 | ] 754 | }, 755 | { 756 | "cell_type": "code", 757 | "execution_count": null, 758 | "metadata": {}, 759 | "outputs": [], 760 | "source": [] 761 | } 762 | ], 763 | "metadata": { 764 | "kernelspec": { 765 | "display_name": "Python 3 (ipykernel)", 766 | "language": "python", 767 | "name": "python3" 768 | }, 769 | "language_info": { 770 | "codemirror_mode": { 771 | "name": "ipython", 772 | "version": 3 773 | }, 774 | "file_extension": ".py", 775 | "mimetype": "text/x-python", 776 | "name": "python", 777 | "nbconvert_exporter": "python", 778 | "pygments_lexer": "ipython3", 779 | "version": "3.11.4" 780 | } 781 | }, 782 | "nbformat": 4, 783 | "nbformat_minor": 4 784 | } 785 | -------------------------------------------------------------------------------- /How to Import Data in Python/brics.csv: -------------------------------------------------------------------------------- 1 | country,capital,gdp,literacy,expectancy,population 2 | Brazil,Brasilia,2750,0.944,76.8,210.87 3 | Russia,Moscow,1658,0.997,72.7,143.96 4 | India,New Delhi,3202,0.721,68.8,1367.09 5 | China,Beijing,15270,0.964,76.4,1415.05 6 | South Africa,Pretoria,370,0.943,63.6,57.4 -------------------------------------------------------------------------------- /How to Import Data in Python/brics.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaikh-Yaqoob/Python-Hello-World/e4bb413c5e69e98701bc8597f9224b465509dc89/How to Import Data in Python/brics.xlsx -------------------------------------------------------------------------------- /How to Sample Data in Python/04_06b.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# How to Sample Data in Python" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Learning Objectives\n", 15 | "In order to get an unbiased assessment of the performance of a supervised machine learning model, we need to evaluate it based on data that it did not previously encounter during the training process. To accomplish this, we must first split our data into a training subset and a test subset prior to the model build stage. One common way to split data in this fashion is by creating non-overlapping subsets of the original data using one of several **sampling** approaches. By the end of the tutorial, you will have learned:\n", 16 | "\n", 17 | "+ how to split data using simple random sampling\n", 18 | "+ how to split data using stratified random sampling" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 21, 24 | "metadata": { 25 | "colab": {}, 26 | "colab_type": "code", 27 | "id": "ZBtXnome3fr0", 28 | "scrolled": false 29 | }, 30 | "outputs": [ 31 | { 32 | "data": { 33 | "text/html": [ 34 | "
\n", 35 | "\n", 48 | "\n", 49 | " \n", 50 | " \n", 51 | " \n", 52 | " \n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | "
citympgcylindersdisplacementdrivehighwaympgmakemodelclassyeartransmissiontypetransmissionspeedsco2emissions
014.064.12-Wheel Drive19.0BuickElectra/Park AvenueLarge Cars1984Automatic4555.437500
114.085.02-Wheel Drive20.0BuickElectra/Park AvenueLarge Cars1984Automatic4555.437500
218.085.72-Wheel Drive26.0BuickElectra/Park AvenueLarge Cars1984Automatic4484.761905
321.064.3Rear-Wheel Drive31.0CadillacFleetwood/DeVille (FWD)Large Cars1984Automatic4424.166667
414.084.1Rear-Wheel Drive19.0CadillacBrougham/DeVille (RWD)Large Cars1984Automatic4555.437500
.......................................
3697417.084.7Rear-Wheel Drive25.0Mercedes-BenzSL550Two Seaters2018Automatic9442.000000
3697516.086.2Rear-Wheel Drive25.0ChevroletCorvetteTwo Seaters2018Manual7466.000000
3697615.086.2Rear-Wheel Drive22.0ChevroletCorvetteTwo Seaters2018Manual7503.000000
3697712.0126.5Rear-Wheel Drive16.0Ferrari812 SuperfastTwo Seaters2018Automatic7661.000000
3697813.0126.0Rear-Wheel Drive22.0Mercedes-BenzAMG SL65Two Seaters2018Automatic7546.000000
\n", 234 | "

36979 rows × 12 columns

\n", 235 | "
" 236 | ], 237 | "text/plain": [ 238 | " citympg cylinders displacement drive highwaympg \\\n", 239 | "0 14.0 6 4.1 2-Wheel Drive 19.0 \n", 240 | "1 14.0 8 5.0 2-Wheel Drive 20.0 \n", 241 | "2 18.0 8 5.7 2-Wheel Drive 26.0 \n", 242 | "3 21.0 6 4.3 Rear-Wheel Drive 31.0 \n", 243 | "4 14.0 8 4.1 Rear-Wheel Drive 19.0 \n", 244 | "... ... ... ... ... ... \n", 245 | "36974 17.0 8 4.7 Rear-Wheel Drive 25.0 \n", 246 | "36975 16.0 8 6.2 Rear-Wheel Drive 25.0 \n", 247 | "36976 15.0 8 6.2 Rear-Wheel Drive 22.0 \n", 248 | "36977 12.0 12 6.5 Rear-Wheel Drive 16.0 \n", 249 | "36978 13.0 12 6.0 Rear-Wheel Drive 22.0 \n", 250 | "\n", 251 | " make model class year \\\n", 252 | "0 Buick Electra/Park Avenue Large Cars 1984 \n", 253 | "1 Buick Electra/Park Avenue Large Cars 1984 \n", 254 | "2 Buick Electra/Park Avenue Large Cars 1984 \n", 255 | "3 Cadillac Fleetwood/DeVille (FWD) Large Cars 1984 \n", 256 | "4 Cadillac Brougham/DeVille (RWD) Large Cars 1984 \n", 257 | "... ... ... ... ... \n", 258 | "36974 Mercedes-Benz SL550 Two Seaters 2018 \n", 259 | "36975 Chevrolet Corvette Two Seaters 2018 \n", 260 | "36976 Chevrolet Corvette Two Seaters 2018 \n", 261 | "36977 Ferrari 812 Superfast Two Seaters 2018 \n", 262 | "36978 Mercedes-Benz AMG SL65 Two Seaters 2018 \n", 263 | "\n", 264 | " transmissiontype transmissionspeeds co2emissions \n", 265 | "0 Automatic 4 555.437500 \n", 266 | "1 Automatic 4 555.437500 \n", 267 | "2 Automatic 4 484.761905 \n", 268 | "3 Automatic 4 424.166667 \n", 269 | "4 Automatic 4 555.437500 \n", 270 | "... ... ... ... \n", 271 | "36974 Automatic 9 442.000000 \n", 272 | "36975 Manual 7 466.000000 \n", 273 | "36976 Manual 7 503.000000 \n", 274 | "36977 Automatic 7 661.000000 \n", 275 | "36978 Automatic 7 546.000000 \n", 276 | "\n", 277 | "[36979 rows x 12 columns]" 278 | ] 279 | }, 280 | "execution_count": 21, 281 | "metadata": {}, 282 | "output_type": "execute_result" 283 | } 284 | ], 285 | "source": [ 286 | "import pandas as pd\n", 287 | "vehicles = pd.read_csv(\"vehicles.csv\")\n", 288 | "vehicles" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": 22, 294 | "metadata": { 295 | "scrolled": true 296 | }, 297 | "outputs": [ 298 | { 299 | "data": { 300 | "text/html": [ 301 | "
\n", 302 | "\n", 315 | "\n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | "
co2emissions
0555.437500
1555.437500
2484.761905
3424.166667
4555.437500
\n", 345 | "
" 346 | ], 347 | "text/plain": [ 348 | " co2emissions\n", 349 | "0 555.437500\n", 350 | "1 555.437500\n", 351 | "2 484.761905\n", 352 | "3 424.166667\n", 353 | "4 555.437500" 354 | ] 355 | }, 356 | "execution_count": 22, 357 | "metadata": {}, 358 | "output_type": "execute_result" 359 | } 360 | ], 361 | "source": [ 362 | "response = 'co2emissions'\n", 363 | "y = vehicles[[response]]\n", 364 | "y.head()" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 23, 370 | "metadata": {}, 371 | "outputs": [ 372 | { 373 | "data": { 374 | "text/plain": [ 375 | "['citympg',\n", 376 | " 'cylinders',\n", 377 | " 'displacement',\n", 378 | " 'drive',\n", 379 | " 'highwaympg',\n", 380 | " 'make',\n", 381 | " 'model',\n", 382 | " 'class',\n", 383 | " 'year',\n", 384 | " 'transmissiontype',\n", 385 | " 'transmissionspeeds',\n", 386 | " 'co2emissions']" 387 | ] 388 | }, 389 | "execution_count": 23, 390 | "metadata": {}, 391 | "output_type": "execute_result" 392 | } 393 | ], 394 | "source": [ 395 | "predictors = list(vehicles.columns)\n", 396 | "predictors" 397 | ] 398 | }, 399 | { 400 | "cell_type": "code", 401 | "execution_count": 24, 402 | "metadata": {}, 403 | "outputs": [ 404 | { 405 | "data": { 406 | "text/plain": [ 407 | "['citympg',\n", 408 | " 'cylinders',\n", 409 | " 'displacement',\n", 410 | " 'drive',\n", 411 | " 'highwaympg',\n", 412 | " 'make',\n", 413 | " 'model',\n", 414 | " 'class',\n", 415 | " 'year',\n", 416 | " 'transmissiontype',\n", 417 | " 'transmissionspeeds']" 418 | ] 419 | }, 420 | "execution_count": 24, 421 | "metadata": {}, 422 | "output_type": "execute_result" 423 | } 424 | ], 425 | "source": [ 426 | "predictors.remove(response)\n", 427 | "predictors" 428 | ] 429 | }, 430 | { 431 | "cell_type": "code", 432 | "execution_count": 26, 433 | "metadata": { 434 | "scrolled": false 435 | }, 436 | "outputs": [ 437 | { 438 | "data": { 439 | "text/html": [ 440 | "
\n", 441 | "\n", 454 | "\n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | "
citympgcylindersdisplacementdrivehighwaympgmakemodelclassyeartransmissiontypetransmissionspeeds
014.064.12-Wheel Drive19.0BuickElectra/Park AvenueLarge Cars1984Automatic4
114.085.02-Wheel Drive20.0BuickElectra/Park AvenueLarge Cars1984Automatic4
218.085.72-Wheel Drive26.0BuickElectra/Park AvenueLarge Cars1984Automatic4
321.064.3Rear-Wheel Drive31.0CadillacFleetwood/DeVille (FWD)Large Cars1984Automatic4
414.084.1Rear-Wheel Drive19.0CadillacBrougham/DeVille (RWD)Large Cars1984Automatic4
\n", 544 | "
" 545 | ], 546 | "text/plain": [ 547 | " citympg cylinders displacement drive highwaympg make \\\n", 548 | "0 14.0 6 4.1 2-Wheel Drive 19.0 Buick \n", 549 | "1 14.0 8 5.0 2-Wheel Drive 20.0 Buick \n", 550 | "2 18.0 8 5.7 2-Wheel Drive 26.0 Buick \n", 551 | "3 21.0 6 4.3 Rear-Wheel Drive 31.0 Cadillac \n", 552 | "4 14.0 8 4.1 Rear-Wheel Drive 19.0 Cadillac \n", 553 | "\n", 554 | " model class year transmissiontype \\\n", 555 | "0 Electra/Park Avenue Large Cars 1984 Automatic \n", 556 | "1 Electra/Park Avenue Large Cars 1984 Automatic \n", 557 | "2 Electra/Park Avenue Large Cars 1984 Automatic \n", 558 | "3 Fleetwood/DeVille (FWD) Large Cars 1984 Automatic \n", 559 | "4 Brougham/DeVille (RWD) Large Cars 1984 Automatic \n", 560 | "\n", 561 | " transmissionspeeds \n", 562 | "0 4 \n", 563 | "1 4 \n", 564 | "2 4 \n", 565 | "3 4 \n", 566 | "4 4 " 567 | ] 568 | }, 569 | "execution_count": 26, 570 | "metadata": {}, 571 | "output_type": "execute_result" 572 | } 573 | ], 574 | "source": [ 575 | "x = vehicles[predictors]\n", 576 | "x.head()" 577 | ] 578 | }, 579 | { 580 | "cell_type": "markdown", 581 | "metadata": {}, 582 | "source": [ 583 | "## How to split data using Simple Random Sampling" 584 | ] 585 | }, 586 | { 587 | "cell_type": "code", 588 | "execution_count": 28, 589 | "metadata": {}, 590 | "outputs": [], 591 | "source": [ 592 | "from sklearn.model_selection import train_test_split" 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": 29, 598 | "metadata": {}, 599 | "outputs": [], 600 | "source": [ 601 | "x_train , x_test , y_train , y_test = train_test_split(x,y)" 602 | ] 603 | }, 604 | { 605 | "cell_type": "code", 606 | "execution_count": 30, 607 | "metadata": {}, 608 | "outputs": [ 609 | { 610 | "data": { 611 | "text/plain": [ 612 | "(27734, 11)" 613 | ] 614 | }, 615 | "execution_count": 30, 616 | "metadata": {}, 617 | "output_type": "execute_result" 618 | } 619 | ], 620 | "source": [ 621 | "x_train.shape" 622 | ] 623 | }, 624 | { 625 | "cell_type": "code", 626 | "execution_count": 31, 627 | "metadata": {}, 628 | "outputs": [ 629 | { 630 | "data": { 631 | "text/plain": [ 632 | "(27734, 1)" 633 | ] 634 | }, 635 | "execution_count": 31, 636 | "metadata": {}, 637 | "output_type": "execute_result" 638 | } 639 | ], 640 | "source": [ 641 | "y_train.shape" 642 | ] 643 | }, 644 | { 645 | "cell_type": "code", 646 | "execution_count": 32, 647 | "metadata": {}, 648 | "outputs": [ 649 | { 650 | "data": { 651 | "text/plain": [ 652 | "(9245, 11)" 653 | ] 654 | }, 655 | "execution_count": 32, 656 | "metadata": {}, 657 | "output_type": "execute_result" 658 | } 659 | ], 660 | "source": [ 661 | "x_test.shape" 662 | ] 663 | }, 664 | { 665 | "cell_type": "code", 666 | "execution_count": 33, 667 | "metadata": {}, 668 | "outputs": [ 669 | { 670 | "data": { 671 | "text/plain": [ 672 | "(9245, 1)" 673 | ] 674 | }, 675 | "execution_count": 33, 676 | "metadata": {}, 677 | "output_type": "execute_result" 678 | } 679 | ], 680 | "source": [ 681 | "y_test.shape" 682 | ] 683 | }, 684 | { 685 | "cell_type": "code", 686 | "execution_count": 36, 687 | "metadata": {}, 688 | "outputs": [ 689 | { 690 | "data": { 691 | "text/plain": [ 692 | "(14792, 11)" 693 | ] 694 | }, 695 | "execution_count": 36, 696 | "metadata": {}, 697 | "output_type": "execute_result" 698 | } 699 | ], 700 | "source": [ 701 | "x_train, x_test, y_train, y_test = train_test_split(x,y,\n", 702 | " test_size = 0.4)\n", 703 | "x_test.shape" 704 | ] 705 | }, 706 | { 707 | "cell_type": "markdown", 708 | "metadata": {}, 709 | "source": [ 710 | "## How to split data using Stratified Random Sampling" 711 | ] 712 | }, 713 | { 714 | "cell_type": "code", 715 | "execution_count": 38, 716 | "metadata": {}, 717 | "outputs": [], 718 | "source": [ 719 | "x_train, x_test, y_train, y_test = train_test_split(x, y, \n", 720 | " test_size = 0.01, \n", 721 | " random_state = 1234)" 722 | ] 723 | }, 724 | { 725 | "cell_type": "code", 726 | "execution_count": 40, 727 | "metadata": { 728 | "scrolled": false 729 | }, 730 | "outputs": [ 731 | { 732 | "data": { 733 | "text/plain": [ 734 | "Rear-Wheel Drive 0.356797\n", 735 | "Front-Wheel Drive 0.353552\n", 736 | "All-Wheel Drive 0.239893\n", 737 | "4-Wheel Drive 0.036480\n", 738 | "2-Wheel Drive 0.013278\n", 739 | "Name: drive, dtype: float64" 740 | ] 741 | }, 742 | "execution_count": 40, 743 | "metadata": {}, 744 | "output_type": "execute_result" 745 | } 746 | ], 747 | "source": [ 748 | "x['drive'].value_counts(normalize = True)" 749 | ] 750 | }, 751 | { 752 | "cell_type": "code", 753 | "execution_count": 41, 754 | "metadata": { 755 | "scrolled": false 756 | }, 757 | "outputs": [ 758 | { 759 | "data": { 760 | "text/plain": [ 761 | "Front-Wheel Drive 0.364865\n", 762 | "Rear-Wheel Drive 0.332432\n", 763 | "All-Wheel Drive 0.248649\n", 764 | "4-Wheel Drive 0.035135\n", 765 | "2-Wheel Drive 0.018919\n", 766 | "Name: drive, dtype: float64" 767 | ] 768 | }, 769 | "execution_count": 41, 770 | "metadata": {}, 771 | "output_type": "execute_result" 772 | } 773 | ], 774 | "source": [ 775 | "x_test['drive'].value_counts(normalize = True)" 776 | ] 777 | }, 778 | { 779 | "cell_type": "code", 780 | "execution_count": 43, 781 | "metadata": {}, 782 | "outputs": [], 783 | "source": [ 784 | "x_train, x_test, y_train, y_test = train_test_split(x, y, \n", 785 | " test_size = 0.01, \n", 786 | " random_state = 1234,\n", 787 | " stratify = x['drive'])" 788 | ] 789 | }, 790 | { 791 | "cell_type": "code", 792 | "execution_count": 44, 793 | "metadata": { 794 | "scrolled": true 795 | }, 796 | "outputs": [ 797 | { 798 | "data": { 799 | "text/plain": [ 800 | "Rear-Wheel Drive 0.356757\n", 801 | "Front-Wheel Drive 0.354054\n", 802 | "All-Wheel Drive 0.240541\n", 803 | "4-Wheel Drive 0.035135\n", 804 | "2-Wheel Drive 0.013514\n", 805 | "Name: drive, dtype: float64" 806 | ] 807 | }, 808 | "execution_count": 44, 809 | "metadata": {}, 810 | "output_type": "execute_result" 811 | } 812 | ], 813 | "source": [ 814 | "x_test['drive'].value_counts(normalize = True)" 815 | ] 816 | }, 817 | { 818 | "cell_type": "code", 819 | "execution_count": null, 820 | "metadata": {}, 821 | "outputs": [], 822 | "source": [] 823 | } 824 | ], 825 | "metadata": { 826 | "colab": { 827 | "collapsed_sections": [], 828 | "name": "3.3 - Pandas Data Selection.ipynb", 829 | "provenance": [], 830 | "toc_visible": true, 831 | "version": "0.3.2" 832 | }, 833 | "kernelspec": { 834 | "display_name": "Python 3 (ipykernel)", 835 | "language": "python", 836 | "name": "python3" 837 | }, 838 | "language_info": { 839 | "codemirror_mode": { 840 | "name": "ipython", 841 | "version": 3 842 | }, 843 | "file_extension": ".py", 844 | "mimetype": "text/x-python", 845 | "name": "python", 846 | "nbconvert_exporter": "python", 847 | "pygments_lexer": "ipython3", 848 | "version": "3.11.4" 849 | } 850 | }, 851 | "nbformat": 4, 852 | "nbformat_minor": 1 853 | } 854 | -------------------------------------------------------------------------------- /How to Summarize Data in Python/03_02b.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# How to Summarize Data in Python" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Learning Objectives\n", 15 | "When exploring data, one of the most important things we can do is summarize it so we can better understand it. A common way to summarize data is by computing aggregations such as mean, median, maximum and minimum. These aggregations or statistical measures (as they are commonly referred to) describe the general and specific characteristics of our data. This is why these types of aggregations are sometimes referred to as **descriptive statistics** or **summary statistics**. The pandas DataFrame provides several methods for computing descriptive statistics. By the end of this tutorial, you will have learned:\n", 16 | "\n", 17 | "+ how to describe a DataFrame\n", 18 | "+ how to get simple aggregations\n", 19 | "+ how to get group-level aggregations" 20 | ] 21 | }, 22 | { 23 | "cell_type": "markdown", 24 | "metadata": {}, 25 | "source": [ 26 | "## How to Describe a DataFrame" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": 5, 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "\n", 39 | "RangeIndex: 261 entries, 0 to 260\n", 40 | "Data columns (total 18 columns):\n", 41 | " # Column Non-Null Count Dtype \n", 42 | "--- ------ -------------- ----- \n", 43 | " 0 ID 261 non-null int64 \n", 44 | " 1 BrandName 261 non-null object \n", 45 | " 2 ModelNumber 261 non-null object \n", 46 | " 3 UPC 261 non-null object \n", 47 | " 4 Configuration 261 non-null object \n", 48 | " 5 Features 261 non-null object \n", 49 | " 6 Market 261 non-null object \n", 50 | " 7 Volume 261 non-null float64\n", 51 | " 8 IMEF 261 non-null float64\n", 52 | " 9 MinimumIMEF 261 non-null float64\n", 53 | " 10 EnergyUse 261 non-null int64 \n", 54 | " 11 IWF 261 non-null float64\n", 55 | " 12 MaximumIWF 261 non-null float64\n", 56 | " 13 WaterUse 261 non-null int64 \n", 57 | " 14 DateAvailable 261 non-null object \n", 58 | " 15 DateCertified 261 non-null object \n", 59 | " 16 Countries 261 non-null object \n", 60 | " 17 MostEfficient 261 non-null object \n", 61 | "dtypes: float64(5), int64(3), object(10)\n", 62 | "memory usage: 36.8+ KB\n" 63 | ] 64 | } 65 | ], 66 | "source": [ 67 | "import pandas as pd\n", 68 | "washers = pd.read_csv(\"washers.csv\")\n", 69 | "washers.info()" 70 | ] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": 2, 75 | "metadata": {}, 76 | "outputs": [ 77 | { 78 | "data": { 79 | "text/html": [ 80 | "
\n", 81 | "\n", 94 | "\n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | "
IDBrandNameModelNumberUPCConfigurationFeaturesMarketVolumeIMEFMinimumIMEFEnergyUseIWFMaximumIWFWaterUseDateAvailableDateCertifiedCountriesMostEfficient
02342279GEGTW845C*N***1Top LoadGentle Cycle,Delayed Start,Sanitize OptionResidential5.02.061.291924.38.463688/5/197/31/19United States, CanadaNo
12331684GEGUD27EE*N***84691844198Top LoadGentle CycleResidential3.92.061.291404.38.4494712/10/1811/30/18United StatesNo
22331685GEGUD27EE*N***7.57638E+11Top LoadGentle CycleResidential3.92.061.291404.38.4494712/10/1811/30/18CanadaNo
32331687GEGUD27GE*N***84691844181Top LoadGentle CycleResidential3.92.061.291404.38.4494712/10/1811/30/18United StatesNo
42331686GEGUD37EE*N***7.57638E+11Top LoadGentle CycleResidential3.92.061.291404.38.4494712/10/1811/30/18CanadaNo
\n", 226 | "
" 227 | ], 228 | "text/plain": [ 229 | " ID BrandName ModelNumber UPC Configuration \\\n", 230 | "0 2342279 GE GTW845C*N*** 1 Top Load \n", 231 | "1 2331684 GE GUD27EE*N*** 84691844198 Top Load \n", 232 | "2 2331685 GE GUD27EE*N*** 7.57638E+11 Top Load \n", 233 | "3 2331687 GE GUD27GE*N*** 84691844181 Top Load \n", 234 | "4 2331686 GE GUD37EE*N*** 7.57638E+11 Top Load \n", 235 | "\n", 236 | " Features Market Volume IMEF \\\n", 237 | "0 Gentle Cycle,Delayed Start,Sanitize Option Residential 5.0 2.06 \n", 238 | "1 Gentle Cycle Residential 3.9 2.06 \n", 239 | "2 Gentle Cycle Residential 3.9 2.06 \n", 240 | "3 Gentle Cycle Residential 3.9 2.06 \n", 241 | "4 Gentle Cycle Residential 3.9 2.06 \n", 242 | "\n", 243 | " MinimumIMEF EnergyUse IWF MaximumIWF WaterUse DateAvailable \\\n", 244 | "0 1.29 192 4.3 8.4 6368 8/5/19 \n", 245 | "1 1.29 140 4.3 8.4 4947 12/10/18 \n", 246 | "2 1.29 140 4.3 8.4 4947 12/10/18 \n", 247 | "3 1.29 140 4.3 8.4 4947 12/10/18 \n", 248 | "4 1.29 140 4.3 8.4 4947 12/10/18 \n", 249 | "\n", 250 | " DateCertified Countries MostEfficient \n", 251 | "0 7/31/19 United States, Canada No \n", 252 | "1 11/30/18 United States No \n", 253 | "2 11/30/18 Canada No \n", 254 | "3 11/30/18 United States No \n", 255 | "4 11/30/18 Canada No " 256 | ] 257 | }, 258 | "execution_count": 2, 259 | "metadata": {}, 260 | "output_type": "execute_result" 261 | } 262 | ], 263 | "source": [ 264 | "washers.head()" 265 | ] 266 | }, 267 | { 268 | "cell_type": "markdown", 269 | "metadata": {}, 270 | "source": [ 271 | "## How to get Simple Aggregations\n", 272 | "The `describe()` method returns a statistical summary for each of the columns in a DataFrame. It's important to note that the descriptive statistics returned by the `describe()` method depends on the data type of a column. For non-numeric columns, the descriptive statistics returned by the method are as follows:\n", 273 | "\n", 274 | "|Name | Description |\n", 275 | "|-----------------|---------------------|\n", 276 | "| `count` | Number of non-missing values |\n", 277 | "| `unique` | Number of unique non-missing values |\n", 278 | "| `top` | Most commonly occuring value |\n", 279 | "| `freq` | Frequency of the most commonly occuring value |\n" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": 6, 285 | "metadata": {}, 286 | "outputs": [ 287 | { 288 | "data": { 289 | "text/html": [ 290 | "
\n", 291 | "\n", 304 | "\n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | "
BrandName
count261
unique22
topLG
freq50
\n", 330 | "
" 331 | ], 332 | "text/plain": [ 333 | " BrandName\n", 334 | "count 261\n", 335 | "unique 22\n", 336 | "top LG\n", 337 | "freq 50" 338 | ] 339 | }, 340 | "execution_count": 6, 341 | "metadata": {}, 342 | "output_type": "execute_result" 343 | } 344 | ], 345 | "source": [ 346 | "washers[['BrandName']].describe()" 347 | ] 348 | }, 349 | { 350 | "cell_type": "markdown", 351 | "metadata": {}, 352 | "source": [ 353 | "For numeric columns, the `describe()` method returns the following descriptive statistics:\n", 354 | "\n", 355 | "|Name | Description |\n", 356 | "|-----------------|---------------------|\n", 357 | "| `count` | Number of non-missing values |\n", 358 | "| `mean` | Average of the non-missing values |\n", 359 | "| `std` | Standard deviation of the values |\n", 360 | "| `min` | Smallest value |\n", 361 | "| `25%` | 25th percentile |\n", 362 | "| `50%` | 50th percentile (same as the median) |\n", 363 | "| `75%` | 75th percentile |\n", 364 | "| `max` | Largest value |\n" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": 7, 370 | "metadata": {}, 371 | "outputs": [ 372 | { 373 | "data": { 374 | "text/html": [ 375 | "
\n", 376 | "\n", 389 | "\n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | "
Volume
count261.000000
mean4.374713
std0.965866
min1.900000
25%4.300000
50%4.500000
75%5.000000
max6.200000
\n", 431 | "
" 432 | ], 433 | "text/plain": [ 434 | " Volume\n", 435 | "count 261.000000\n", 436 | "mean 4.374713\n", 437 | "std 0.965866\n", 438 | "min 1.900000\n", 439 | "25% 4.300000\n", 440 | "50% 4.500000\n", 441 | "75% 5.000000\n", 442 | "max 6.200000" 443 | ] 444 | }, 445 | "execution_count": 7, 446 | "metadata": {}, 447 | "output_type": "execute_result" 448 | } 449 | ], 450 | "source": [ 451 | "washers[['Volume']].describe()" 452 | ] 453 | }, 454 | { 455 | "cell_type": "code", 456 | "execution_count": 8, 457 | "metadata": {}, 458 | "outputs": [ 459 | { 460 | "data": { 461 | "text/plain": [ 462 | "BrandName \n", 463 | "LG 50\n", 464 | "GE 49\n", 465 | "Samsung 47\n", 466 | "Kenmore 30\n", 467 | "Whirlpool 26\n", 468 | "Maytag 18\n", 469 | "Electrolux 7\n", 470 | "Bosch 4\n", 471 | "Miele 4\n", 472 | "Asko 4\n", 473 | "Beko 3\n", 474 | "Blomberg 3\n", 475 | "Crosley 3\n", 476 | "Midea 2\n", 477 | "Magic Chef 2\n", 478 | "Amana 2\n", 479 | "Fisher & Paykel 2\n", 480 | "Insignia 1\n", 481 | "Inglis 1\n", 482 | "Gaggenau 1\n", 483 | "GE Adora 1\n", 484 | "Haier 1\n", 485 | "dtype: int64" 486 | ] 487 | }, 488 | "execution_count": 8, 489 | "metadata": {}, 490 | "output_type": "execute_result" 491 | } 492 | ], 493 | "source": [ 494 | "washers[['BrandName']].value_counts()" 495 | ] 496 | }, 497 | { 498 | "cell_type": "code", 499 | "execution_count": 9, 500 | "metadata": { 501 | "colab": {}, 502 | "colab_type": "code", 503 | "id": "QOw8VY9dl_0e" 504 | }, 505 | "outputs": [ 506 | { 507 | "data": { 508 | "text/plain": [ 509 | "BrandName \n", 510 | "LG 0.191571\n", 511 | "GE 0.187739\n", 512 | "Samsung 0.180077\n", 513 | "Kenmore 0.114943\n", 514 | "Whirlpool 0.099617\n", 515 | "Maytag 0.068966\n", 516 | "Electrolux 0.026820\n", 517 | "Bosch 0.015326\n", 518 | "Miele 0.015326\n", 519 | "Asko 0.015326\n", 520 | "Beko 0.011494\n", 521 | "Blomberg 0.011494\n", 522 | "Crosley 0.011494\n", 523 | "Midea 0.007663\n", 524 | "Magic Chef 0.007663\n", 525 | "Amana 0.007663\n", 526 | "Fisher & Paykel 0.007663\n", 527 | "Insignia 0.003831\n", 528 | "Inglis 0.003831\n", 529 | "Gaggenau 0.003831\n", 530 | "GE Adora 0.003831\n", 531 | "Haier 0.003831\n", 532 | "dtype: float64" 533 | ] 534 | }, 535 | "execution_count": 9, 536 | "metadata": {}, 537 | "output_type": "execute_result" 538 | } 539 | ], 540 | "source": [ 541 | "washers[['BrandName']].value_counts(normalize = True)" 542 | ] 543 | }, 544 | { 545 | "cell_type": "code", 546 | "execution_count": 10, 547 | "metadata": {}, 548 | "outputs": [ 549 | { 550 | "data": { 551 | "text/plain": [ 552 | "Volume 4.374713\n", 553 | "dtype: float64" 554 | ] 555 | }, 556 | "execution_count": 10, 557 | "metadata": {}, 558 | "output_type": "execute_result" 559 | } 560 | ], 561 | "source": [ 562 | "washers[['Volume']].mean()" 563 | ] 564 | }, 565 | { 566 | "cell_type": "markdown", 567 | "metadata": {}, 568 | "source": [ 569 | "## How to get Group-level Aggregations" 570 | ] 571 | }, 572 | { 573 | "cell_type": "code", 574 | "execution_count": 12, 575 | "metadata": { 576 | "scrolled": false 577 | }, 578 | "outputs": [ 579 | { 580 | "data": { 581 | "text/html": [ 582 | "
\n", 583 | "\n", 596 | "\n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | " \n", 635 | " \n", 636 | " \n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | " \n", 666 | " \n", 667 | " \n", 668 | " \n", 669 | " \n", 670 | " \n", 671 | " \n", 672 | " \n", 673 | " \n", 674 | " \n", 675 | " \n", 676 | " \n", 677 | " \n", 678 | " \n", 679 | " \n", 680 | " \n", 681 | " \n", 682 | " \n", 683 | " \n", 684 | " \n", 685 | " \n", 686 | " \n", 687 | " \n", 688 | " \n", 689 | " \n", 690 | " \n", 691 | " \n", 692 | " \n", 693 | " \n", 694 | " \n", 695 | " \n", 696 | " \n", 697 | "
Volume
BrandName
Amana4.250000
Asko2.525000
Beko2.133333
Blomberg2.300000
Bosch2.200000
Crosley4.400000
Electrolux3.785714
Fisher & Paykel2.400000
GE4.328571
GE Adora4.200000
Gaggenau2.200000
Haier2.400000
Inglis4.300000
Insignia4.800000
Kenmore4.796667
LG4.596000
Magic Chef2.700000
Maytag4.988889
Midea5.200000
Miele2.300000
Samsung4.729787
Whirlpool4.453846
\n", 698 | "
" 699 | ], 700 | "text/plain": [ 701 | " Volume\n", 702 | "BrandName \n", 703 | "Amana 4.250000\n", 704 | "Asko 2.525000\n", 705 | "Beko 2.133333\n", 706 | "Blomberg 2.300000\n", 707 | "Bosch 2.200000\n", 708 | "Crosley 4.400000\n", 709 | "Electrolux 3.785714\n", 710 | "Fisher & Paykel 2.400000\n", 711 | "GE 4.328571\n", 712 | "GE Adora 4.200000\n", 713 | "Gaggenau 2.200000\n", 714 | "Haier 2.400000\n", 715 | "Inglis 4.300000\n", 716 | "Insignia 4.800000\n", 717 | "Kenmore 4.796667\n", 718 | "LG 4.596000\n", 719 | "Magic Chef 2.700000\n", 720 | "Maytag 4.988889\n", 721 | "Midea 5.200000\n", 722 | "Miele 2.300000\n", 723 | "Samsung 4.729787\n", 724 | "Whirlpool 4.453846" 725 | ] 726 | }, 727 | "execution_count": 12, 728 | "metadata": {}, 729 | "output_type": "execute_result" 730 | } 731 | ], 732 | "source": [ 733 | "washers.groupby('BrandName')[['Volume']].mean()" 734 | ] 735 | }, 736 | { 737 | "cell_type": "code", 738 | "execution_count": 14, 739 | "metadata": {}, 740 | "outputs": [ 741 | { 742 | "data": { 743 | "text/html": [ 744 | "
\n", 745 | "\n", 758 | "\n", 759 | " \n", 760 | " \n", 761 | " \n", 762 | " \n", 763 | " \n", 764 | " \n", 765 | " \n", 766 | " \n", 767 | " \n", 768 | " \n", 769 | " \n", 770 | " \n", 771 | " \n", 772 | " \n", 773 | " \n", 774 | " \n", 775 | " \n", 776 | " \n", 777 | " \n", 778 | " \n", 779 | " \n", 780 | " \n", 781 | " \n", 782 | " \n", 783 | " \n", 784 | " \n", 785 | " \n", 786 | " \n", 787 | " \n", 788 | " \n", 789 | " \n", 790 | " \n", 791 | " \n", 792 | " \n", 793 | " \n", 794 | " \n", 795 | " \n", 796 | " \n", 797 | " \n", 798 | " \n", 799 | " \n", 800 | " \n", 801 | " \n", 802 | " \n", 803 | " \n", 804 | " \n", 805 | " \n", 806 | " \n", 807 | " \n", 808 | " \n", 809 | " \n", 810 | " \n", 811 | " \n", 812 | " \n", 813 | " \n", 814 | " \n", 815 | " \n", 816 | " \n", 817 | " \n", 818 | " \n", 819 | " \n", 820 | " \n", 821 | " \n", 822 | " \n", 823 | " \n", 824 | " \n", 825 | " \n", 826 | " \n", 827 | " \n", 828 | " \n", 829 | " \n", 830 | " \n", 831 | " \n", 832 | " \n", 833 | " \n", 834 | " \n", 835 | " \n", 836 | " \n", 837 | " \n", 838 | " \n", 839 | " \n", 840 | " \n", 841 | " \n", 842 | " \n", 843 | " \n", 844 | " \n", 845 | " \n", 846 | " \n", 847 | " \n", 848 | " \n", 849 | " \n", 850 | " \n", 851 | " \n", 852 | " \n", 853 | " \n", 854 | " \n", 855 | " \n", 856 | " \n", 857 | " \n", 858 | " \n", 859 | "
Volume
BrandName
Beko2.133333
Gaggenau2.200000
Bosch2.200000
Miele2.300000
Blomberg2.300000
Fisher & Paykel2.400000
Haier2.400000
Asko2.525000
Magic Chef2.700000
Electrolux3.785714
GE Adora4.200000
Amana4.250000
Inglis4.300000
GE4.328571
Crosley4.400000
Whirlpool4.453846
LG4.596000
Samsung4.729787
Kenmore4.796667
Insignia4.800000
Maytag4.988889
Midea5.200000
\n", 860 | "
" 861 | ], 862 | "text/plain": [ 863 | " Volume\n", 864 | "BrandName \n", 865 | "Beko 2.133333\n", 866 | "Gaggenau 2.200000\n", 867 | "Bosch 2.200000\n", 868 | "Miele 2.300000\n", 869 | "Blomberg 2.300000\n", 870 | "Fisher & Paykel 2.400000\n", 871 | "Haier 2.400000\n", 872 | "Asko 2.525000\n", 873 | "Magic Chef 2.700000\n", 874 | "Electrolux 3.785714\n", 875 | "GE Adora 4.200000\n", 876 | "Amana 4.250000\n", 877 | "Inglis 4.300000\n", 878 | "GE 4.328571\n", 879 | "Crosley 4.400000\n", 880 | "Whirlpool 4.453846\n", 881 | "LG 4.596000\n", 882 | "Samsung 4.729787\n", 883 | "Kenmore 4.796667\n", 884 | "Insignia 4.800000\n", 885 | "Maytag 4.988889\n", 886 | "Midea 5.200000" 887 | ] 888 | }, 889 | "execution_count": 14, 890 | "metadata": {}, 891 | "output_type": "execute_result" 892 | } 893 | ], 894 | "source": [ 895 | "washers.groupby('BrandName')[['Volume']].mean().sort_values( by = 'Volume')" 896 | ] 897 | }, 898 | { 899 | "cell_type": "code", 900 | "execution_count": 15, 901 | "metadata": { 902 | "scrolled": false 903 | }, 904 | "outputs": [ 905 | { 906 | "data": { 907 | "text/html": [ 908 | "
\n", 909 | "\n", 926 | "\n", 927 | " \n", 928 | " \n", 929 | " \n", 930 | " \n", 931 | " \n", 932 | " \n", 933 | " \n", 934 | " \n", 935 | " \n", 936 | " \n", 937 | " \n", 938 | " \n", 939 | " \n", 940 | " \n", 941 | " \n", 942 | " \n", 943 | " \n", 944 | " \n", 945 | " \n", 946 | " \n", 947 | " \n", 948 | " \n", 949 | " \n", 950 | " \n", 951 | " \n", 952 | " \n", 953 | " \n", 954 | " \n", 955 | " \n", 956 | " \n", 957 | " \n", 958 | " \n", 959 | " \n", 960 | " \n", 961 | " \n", 962 | " \n", 963 | " \n", 964 | " \n", 965 | " \n", 966 | " \n", 967 | " \n", 968 | " \n", 969 | " \n", 970 | " \n", 971 | " \n", 972 | " \n", 973 | " \n", 974 | " \n", 975 | " \n", 976 | " \n", 977 | " \n", 978 | " \n", 979 | " \n", 980 | " \n", 981 | " \n", 982 | " \n", 983 | " \n", 984 | " \n", 985 | " \n", 986 | " \n", 987 | " \n", 988 | " \n", 989 | " \n", 990 | " \n", 991 | " \n", 992 | " \n", 993 | " \n", 994 | " \n", 995 | " \n", 996 | " \n", 997 | " \n", 998 | " \n", 999 | " \n", 1000 | " \n", 1001 | " \n", 1002 | " \n", 1003 | " \n", 1004 | " \n", 1005 | " \n", 1006 | " \n", 1007 | " \n", 1008 | " \n", 1009 | " \n", 1010 | " \n", 1011 | " \n", 1012 | " \n", 1013 | " \n", 1014 | " \n", 1015 | " \n", 1016 | " \n", 1017 | " \n", 1018 | " \n", 1019 | " \n", 1020 | " \n", 1021 | " \n", 1022 | " \n", 1023 | " \n", 1024 | " \n", 1025 | " \n", 1026 | " \n", 1027 | " \n", 1028 | " \n", 1029 | " \n", 1030 | " \n", 1031 | " \n", 1032 | " \n", 1033 | " \n", 1034 | " \n", 1035 | " \n", 1036 | " \n", 1037 | " \n", 1038 | " \n", 1039 | " \n", 1040 | " \n", 1041 | " \n", 1042 | " \n", 1043 | " \n", 1044 | " \n", 1045 | " \n", 1046 | " \n", 1047 | " \n", 1048 | " \n", 1049 | " \n", 1050 | " \n", 1051 | " \n", 1052 | " \n", 1053 | " \n", 1054 | " \n", 1055 | " \n", 1056 | " \n", 1057 | " \n", 1058 | " \n", 1059 | " \n", 1060 | " \n", 1061 | " \n", 1062 | " \n", 1063 | " \n", 1064 | " \n", 1065 | " \n", 1066 | " \n", 1067 | " \n", 1068 | " \n", 1069 | " \n", 1070 | " \n", 1071 | " \n", 1072 | " \n", 1073 | " \n", 1074 | " \n", 1075 | " \n", 1076 | " \n", 1077 | " \n", 1078 | " \n", 1079 | " \n", 1080 | " \n", 1081 | " \n", 1082 | " \n", 1083 | " \n", 1084 | " \n", 1085 | " \n", 1086 | " \n", 1087 | " \n", 1088 | " \n", 1089 | " \n", 1090 | " \n", 1091 | " \n", 1092 | " \n", 1093 | " \n", 1094 | " \n", 1095 | " \n", 1096 | " \n", 1097 | " \n", 1098 | " \n", 1099 | " \n", 1100 | " \n", 1101 | " \n", 1102 | " \n", 1103 | "
Volume
meanmedianminmax
BrandName
Amana4.2500004.254.24.3
Asko2.5250002.702.02.7
Beko2.1333332.001.92.5
Blomberg2.3000002.501.92.5
Bosch2.2000002.202.22.2
Crosley4.4000004.504.24.5
Electrolux3.7857144.302.44.4
Fisher & Paykel2.4000002.402.42.4
GE4.3285714.502.25.2
GE Adora4.2000004.204.24.2
Gaggenau2.2000002.202.22.2
Haier2.4000002.402.42.4
Inglis4.3000004.304.34.3
Insignia4.8000004.804.84.8
Kenmore4.7966674.802.46.2
LG4.5960004.502.35.8
Magic Chef2.7000002.702.72.7
Maytag4.9888894.904.46.2
Midea5.2000005.205.25.2
Miele2.3000002.302.32.3
Samsung4.7297874.802.25.6
Whirlpool4.4538464.502.05.3
\n", 1104 | "
" 1105 | ], 1106 | "text/plain": [ 1107 | " Volume \n", 1108 | " mean median min max\n", 1109 | "BrandName \n", 1110 | "Amana 4.250000 4.25 4.2 4.3\n", 1111 | "Asko 2.525000 2.70 2.0 2.7\n", 1112 | "Beko 2.133333 2.00 1.9 2.5\n", 1113 | "Blomberg 2.300000 2.50 1.9 2.5\n", 1114 | "Bosch 2.200000 2.20 2.2 2.2\n", 1115 | "Crosley 4.400000 4.50 4.2 4.5\n", 1116 | "Electrolux 3.785714 4.30 2.4 4.4\n", 1117 | "Fisher & Paykel 2.400000 2.40 2.4 2.4\n", 1118 | "GE 4.328571 4.50 2.2 5.2\n", 1119 | "GE Adora 4.200000 4.20 4.2 4.2\n", 1120 | "Gaggenau 2.200000 2.20 2.2 2.2\n", 1121 | "Haier 2.400000 2.40 2.4 2.4\n", 1122 | "Inglis 4.300000 4.30 4.3 4.3\n", 1123 | "Insignia 4.800000 4.80 4.8 4.8\n", 1124 | "Kenmore 4.796667 4.80 2.4 6.2\n", 1125 | "LG 4.596000 4.50 2.3 5.8\n", 1126 | "Magic Chef 2.700000 2.70 2.7 2.7\n", 1127 | "Maytag 4.988889 4.90 4.4 6.2\n", 1128 | "Midea 5.200000 5.20 5.2 5.2\n", 1129 | "Miele 2.300000 2.30 2.3 2.3\n", 1130 | "Samsung 4.729787 4.80 2.2 5.6\n", 1131 | "Whirlpool 4.453846 4.50 2.0 5.3" 1132 | ] 1133 | }, 1134 | "execution_count": 15, 1135 | "metadata": {}, 1136 | "output_type": "execute_result" 1137 | } 1138 | ], 1139 | "source": [ 1140 | "washers.groupby('BrandName')[['Volume']].agg(['mean','median','min','max'])" 1141 | ] 1142 | }, 1143 | { 1144 | "cell_type": "code", 1145 | "execution_count": null, 1146 | "metadata": {}, 1147 | "outputs": [], 1148 | "source": [] 1149 | } 1150 | ], 1151 | "metadata": { 1152 | "kernelspec": { 1153 | "display_name": "Python 3 (ipykernel)", 1154 | "language": "python", 1155 | "name": "python3" 1156 | }, 1157 | "language_info": { 1158 | "codemirror_mode": { 1159 | "name": "ipython", 1160 | "version": 3 1161 | }, 1162 | "file_extension": ".py", 1163 | "mimetype": "text/x-python", 1164 | "name": "python", 1165 | "nbconvert_exporter": "python", 1166 | "pygments_lexer": "ipython3", 1167 | "version": "3.11.4" 1168 | } 1169 | }, 1170 | "nbformat": 4, 1171 | "nbformat_minor": 4 1172 | } 1173 | -------------------------------------------------------------------------------- /How to Summarize Data in Python/washers.csv: -------------------------------------------------------------------------------- 1 | ID,BrandName,ModelNumber,UPC,Configuration,Features,Market,Volume,IMEF,MinimumIMEF,EnergyUse,IWF,MaximumIWF,WaterUse,DateAvailable,DateCertified,Countries,MostEfficient 2 | 2342279,GE,GTW845C*N***,1,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,5,2.06,1.29,192,4.3,8.4,6368,8/5/19,7/31/19,"United States, Canada",No 3 | 2331684,GE,GUD27EE*N***,84691844198,Top Load,Gentle Cycle,Residential,3.9,2.06,1.29,140,4.3,8.4,4947,12/10/18,11/30/18,United States,No 4 | 2331685,GE,GUD27EE*N***,7.57638E+11,Top Load,Gentle Cycle,Residential,3.9,2.06,1.29,140,4.3,8.4,4947,12/10/18,11/30/18,Canada,No 5 | 2331687,GE,GUD27GE*N***,84691844181,Top Load,Gentle Cycle,Residential,3.9,2.06,1.29,140,4.3,8.4,4947,12/10/18,11/30/18,United States,No 6 | 2331686,GE,GUD37EE*N***,7.57638E+11,Top Load,Gentle Cycle,Residential,3.9,2.06,1.29,140,4.3,8.4,4947,12/10/18,11/30/18,Canada,No 7 | 2310465,GE,WCVH4800****,84691191063,Front Load,Other,Residential,2.2,2.1,1.84,99,4.1,4.7,2685,4/1/15,3/5/15,"United States, Canada",No 8 | 2310522,GE,WCVH4800K***,84691191063,Front Load,"Gentle Cycle,Delayed Start,Hand Wash Cycle",Residential,2.2,2.1,1.84,99,4.1,4.7,2685,3/13/15,2/12/18,"United States, Canada",No 9 | 2344117,GE Adora,GTW495*****,7.57638E+11,Top Load,"Other,Gentle Cycle",Residential,4.2,2.15,1.29,160,4,8.4,4956,8/19/19,8/7/19,Canada,No 10 | 2340369,Haier,QFW150S*N***,84691841883,Front Load,"Steam Cycle,Delayed Start,Sanitize Option,Gentle Cycle",Residential,2.4,2.07,1.84,108,4.2,4.7,2974,7/8/19,6/26/19,"United States, Canada",No 11 | 2331774,Inglis,IFW5900H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option",Residential,4.3,2.76,1.84,123,3.2,4.7,4097,12/3/18,8/24/18,"United States, Canada",No 12 | 2305859,Insignia,NS-TWM48WH8B,6.00603E+11,Top Load,None,Residential,4.8,2.06,1.29,92,4.3,8.4,6025,10/12/17,10/12/17,Canada,No 13 | 2355252,Kenmore,2165*20*,8.8305E+11,Top Load,"Delayed Start,Other",Residential,5.2,2.06,1.29,260,4.3,8.4,6609,4/1/20,1/13/20,United States,No 14 | 2310410,Kenmore,2613*41*,8.83049E+11,Top Load,Other,Residential,4.8,2.06,1.29,169,4.3,8.4,6076,3/23/15,2/8/18,"United States, Canada",No 15 | 2310389,Kenmore,2713*41*,8.83049E+11,Top Load,Other,Residential,4.8,2.06,1.29,169,4.3,8.4,6076,3/23/15,2/8/18,"United States, Canada",No 16 | 2310394,Kenmore,2813*41*,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,195,4.3,8.4,6698,2/23/15,2/8/18,"United States, Canada",No 17 | 2310402,Kenmore,2913*41*,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,195,4.3,8.4,6698,2/23/15,2/8/18,"United States, Canada",No 18 | 2308536,Kenmore,3143#,1,Top Load,"Anti-Wrinkle,Steam Cycle,Delayed Start,Sanitize Option",Residential,5,2.38,1.29,150,3.7,8.4,5479,11/2/17,12/18/17,"United States, Canada",No 19 | 2352037,Kenmore,3145#,1,Top Load,None,Residential,4.5,2.06,1.29,220,4.3,8.4,5721,12/18/19,12/18/19,"United States, Canada",No 20 | 2310478,Kenmore,3155#,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.38,1.29,130,3.7,8.4,5643,6/24/16,2/8/18,"United States, Canada",No 21 | 2310411,Kenmore,3163*61*,8.83049E+11,Top Load,"Other,Delayed Start,Steam Cycle",Residential,6.2,2.06,1.29,271,4.3,8.4,7827,4/4/16,2/8/18,"United States, Canada",No 22 | 2355251,Kenmore,3165*20*,8.8305E+11,Top Load,"Delayed Start,Other",Residential,5.3,2.06,1.29,270,4.3,8.4,6736,4/1/20,1/13/20,United States,No 23 | 2351914,Kenmore,3171#,1,Top Load,None,Residential,5.5,2.76,1.29,130,3.2,8.4,5145,12/11/19,12/4/19,"United States, Canada",No 24 | 2351913,Kenmore,3177#,1,Top Load,None,Residential,5.5,2.76,1.29,150,3.2,8.4,5145,12/11/19,12/4/19,"United States, Canada",No 25 | 2347077,Kenmore,4107#,1,Front Load,None,Residential,5.2,2.92,1.84,120,3.2,4.7,4899,9/24/19,9/19/19,"United States, Canada",Yes 26 | 2310500,Kenmore,4126#,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4220,7/29/16,2/9/18,"United States, Canada",Yes 27 | 2310487,Kenmore,4130#,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,3.2,4.7,4239,7/22/16,2/8/18,"United States, Canada",No 28 | 2345935,Kenmore,4136#,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3833,9/4/18,9/3/19,"United States, Canada",Yes 29 | 2310483,Kenmore,4139#,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4239,7/28/16,2/8/18,"United States, Canada",No 30 | 2345994,Kenmore,4146#,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3833,9/5/19,9/5/19,"United States, Canada",Yes 31 | 2340664,Kenmore,4156#,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3850,6/28/19,6/28/19,"United States, Canada",Yes 32 | 2310489,Kenmore,4158#,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,3.2,4.7,4239,3/1/15,2/9/18,"United States, Canada",No 33 | 2310486,Kenmore,4168#,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,3.2,4.7,4239,7/22/16,2/8/18,"United States, Canada",No 34 | 2310167,Kenmore,417.4194*71*,12505387197,Front Load,None,Residential,2.4,2.13,1.84,90,3.8,4.7,2690,1/19/18,2/24/14,"United States, Canada",No 35 | 2306857,Kenmore,4178#,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.76,1.84,160,3.2,4.7,4201,12/21/17,11/27/17,"United States, Canada",No 36 | 2310506,Kenmore,4196#,1,Front Load,None,Residential,5.2,2.92,1.84,100,3.2,4.7,4880,6/4/16,2/9/18,"United States, Canada",No 37 | 2347078,Kenmore,4198#,1,Front Load,None,Residential,5.2,2.92,1.84,120,3.2,4.7,4899,9/24/19,9/19/19,"United States, Canada",Yes 38 | 2310466,Kenmore,592-2922*,8.87276E+11,Top Load,Other,Residential,4.3,2.09,1.29,132,4,8.4,5050,4/22/15,4/22/15,Canada,No 39 | 2310467,Kenmore,592-2933*,8.87277E+11,Top Load,Other,Residential,4.8,2.11,1.29,176,4.1,8.4,5757,4/22/15,4/22/15,Canada,No 40 | 2310468,Kenmore,592-4961*,8.87276E+11,Front Load,Other,Residential,4.2,2.8,1.84,85,3.2,4.7,3927,1/23/16,1/11/16,"United States, Canada",No 41 | 2310469,Kenmore,592-4968*,8.87276E+11,Front Load,Other,Residential,4.5,2.8,1.84,110,3,4.7,3956,1/23/16,1/11/16,"United States, Canada",No 42 | 2310470,Kenmore,592-4969*,8.87276E+11,Front Load,Other,Residential,5,2.92,1.84,105,2.9,4.7,4278,5/15/16,4/21/16,"United States, Canada",No 43 | 2311005,LG,WM1385H*,1,Front Load,None,Residential,2.3,2.07,1.84,120,4.2,4.7,2850,3/19/16,2/26/18,"United States, Canada",No 44 | 2310496,LG,WM1388H*,1,Front Load,None,Residential,2.3,2.07,1.84,120,4.2,4.7,2850,3/19/16,2/9/18,"United States, Canada",No 45 | 2321541,LG,WM1399H*A,1,Front Load,None,Residential,2.3,2.07,1.84,120,4.2,4.7,2850,6/22/18,6/22/18,"United States, Canada",No 46 | 2354285,LG,WM1455H*A,1,Front Load,None,Residential,2.4,2.07,1.84,120,4.2,4.7,2949,1/29/20,1/29/20,"United States, Canada",No 47 | 2308538,LG,WM3080C*,1,Front Load,Delayed Start,Residential,4.3,2.92,1.84,90,3.2,4.7,4050,12/1/17,12/18/17,"United States, Canada",No 48 | 2310480,LG,WM3085C*,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4220,12/11/16,2/8/18,"United States, Canada",No 49 | 2328318,LG,WM3090C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,10/31/18,10/23/18,"United States, Canada",No 50 | 2320406,LG,WM3095C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,5/18/18,5/16/18,"United States, Canada",No 51 | 2310476,LG,WM3180C*,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4220,4/17/17,2/8/18,"United States, Canada",No 52 | 2310498,LG,WM3270C*,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4220,7/29/16,2/9/18,"United States, Canada",Yes 53 | 2310499,LG,WM3275C*,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4220,7/29/16,2/9/18,"United States, Canada",No 54 | 2350799,LG,WM3400C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,12/4/19,12/3/19,"United States, Canada",Yes 55 | 2339489,LG,WM3460C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,6/6/19,6/6/19,"United States, Canada",Yes 56 | 2319458,LG,WM3500C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,5/9/18,5/4/18,"United States, Canada",Yes 57 | 2320405,LG,WM3505C*,1,Front Load,None,Residential,4.5,2.92,1.84,100,2.9,4.7,3841,5/18/18,5/16/18,"United States, Canada",No 58 | 2310484,LG,WM3575C*,1,Front Load,None,Residential,4.5,2.92,1.84,90,3.2,4.7,4239,7/28/16,2/8/18,"United States, Canada",No 59 | 2358067,LG,WM3600H*A,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3841,4/14/20,4/14/20,"United States, Canada",Yes 60 | 2310497,LG,WM3670H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,100,3.2,4.7,4220,9/1/16,2/9/18,"United States, Canada",No 61 | 2318268,LG,WM3700H*A,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3841,4/21/18,4/9/18,"United States, Canada",Yes 62 | 2310488,LG,WM3770H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,3.2,4.7,4239,7/22/16,2/8/18,"United States, Canada",No 63 | 2337192,LG,WM3800H*A,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3850,4/29/19,4/24/19,"United States, Canada",Yes 64 | 2337191,LG,WM3900H*A,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3850,4/29/19,4/24/19,"United States, Canada",Yes 65 | 2358068,LG,WM4000H*A,1,Front Load,None,Residential,4.5,2.92,1.84,105,2.9,4.7,3841,4/14/20,4/14/20,"United States, Canada",Yes 66 | 2310485,LG,WM4370H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,3.2,4.7,4239,7/22/16,2/8/18,"United States, Canada",No 67 | 2355243,LG,WM4500H*A,1,Front Load,None,Residential,5,3.1,1.84,105,2.9,4.7,4278,2/24/20,2/24/20,"United States, Canada",Yes 68 | 2310475,LG,WM5000H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,2.8,4.7,3676,5/24/17,2/8/18,"United States, Canada",No 69 | 2309302,Amana,NFW5800D**,8.83049E+11,Front Load,Other,Residential,4.2,2.76,1.84,109,3.2,4.7,3936,4/15/15,1/17/18,"United States, Canada",No 70 | 2331773,Amana,NFW5800H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option",Residential,4.3,2.76,1.84,123,3.2,4.7,4097,12/3/18,8/24/18,"United States, Canada",No 71 | 2309900,Asko,W2084.W.U,578206,Front Load,"Anti-Wrinkle,Gentle Cycle,Other,Delayed Start,Hand Wash Cycle",Residential,2,2.31,1.84,75,2.9,4.7,1728,1/1/18,2/2/18,"United States, Canada",No 72 | 2309902,Asko,W4114C.T.U,578207,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Hand Wash Cycle",Residential,2.7,2.41,1.84,75,3.1,4.7,2478,10/1/17,2/2/18,"United States, Canada",No 73 | 2309901,Asko,W4114C.W.U,578205,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Hand Wash Cycle",Residential,2.7,2.41,1.84,75,3.1,4.7,2478,10/1/17,2/2/18,"United States, Canada",No 74 | 2309903,Asko,W6124X.W.U,578203,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Hand Wash Cycle",Residential,2.7,2.41,1.84,75,3.1,4.7,2478,10/1/18,2/2/18,"United States, Canada",No 75 | 2332833,Beko,BWM7200X,8.69084E+12,Front Load,"Gentle Cycle,Other,Hand Wash Cycle",Residential,1.9,2.07,1.84,84,3.6,4.7,2060,2/1/19,1/31/19,United States,No 76 | 2318078,Beko,WMY 10148 C2,8.69084E+12,Front Load,None,Residential,2.5,2.29,1.84,82,3.6,4.7,2655,4/1/15,4/13/15,"United States, Canada",No 77 | 2318135,Beko,WTE 7604XLW0,8.69084E+12,Front Load,None,Residential,2,2.09,1.84,67,3.5,4.7,2013,4/1/15,4/10/15,"United States, Canada",No 78 | 2332834,Blomberg,WM72200W,8.69084E+12,Front Load,"Gentle Cycle,Other,Hand Wash Cycle",Residential,1.9,2.07,1.84,84,3.6,4.7,2060,2/1/19,1/31/19,United States,No 79 | 2318129,Blomberg,WM 98200 SX2,8.69084E+12,Front Load,None,Residential,2.5,2.29,1.84,82,3.6,4.7,2655,4/1/15,4/13/15,"United States, Canada",No 80 | 2318079,Blomberg,WM 98400 SX2,8.69084E+12,Front Load,None,Residential,2.5,2.29,1.84,82,3.6,4.7,2655,4/1/15,4/13/15,"United States, Canada",No 81 | 2311151,Bosch,WAT28400UC,8.25226E+11,Front Load,Delayed Start,Residential,2.2,2.22,1.84,84,3.6,4.7,2294,5/1/15,3/20/15,"United States, Canada",No 82 | 2311152,Bosch,WAT28401UC,8.25226E+11,Front Load,Delayed Start,Residential,2.2,2.22,1.84,84,3.6,4.7,2294,9/16/15,3/20/15,"United States, Canada",No 83 | 2311153,Bosch,WAT28402UC,8.25226E+11,Front Load,Delayed Start,Residential,2.2,2.22,1.84,84,3.6,4.7,2294,9/16/15,3/20/15,"United States, Canada",No 84 | 2310610,Bosch,WAW285H2UC,8.25226E+11,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.2,2.22,1.84,84,3.7,4.7,2358,9/1/17,5/1/17,"United States, Canada",No 85 | 2309934,Crosley,CFWH4084G**,8.83049E+11,Front Load,Other,Residential,4.2,2.92,1.84,85,3.2,4.7,3936,2/1/17,2/2/18,"United States, Canada",No 86 | 2325258,Crosley,YFW450S*M***,84691841524,Front Load,"Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,4.5,2.76,1.84,116,3.2,4.7,4220,9/3/18,8/22/18,United States,No 87 | 2350855,Crosley,YTW4514*N***,1,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.5,2.06,1.29,150,4.3,8.4,5683,12/4/19,12/2/19,United States,No 88 | 2310166,Electrolux,EFLS210****,12505387180,Front Load,None,Residential,2.4,2.13,1.84,90,3.8,4.7,2690,1/19/18,2/24/14,"United States, Canada",No 89 | 2309144,Electrolux,EFLS527****,12505387265,Front Load,None,Residential,4.3,2.92,1.84,75,3.2,4.7,4059,1/19/18,1/2/18,"United States, Canada",Yes 90 | 2310162,Electrolux,EFLS627****,12505387289,Front Load,None,Residential,4.4,2.92,1.84,85,3.2,4.7,4154,1/19/18,2/8/16,"United States, Canada",Yes 91 | 2358142,Electrolux,EFLS628****,12505387654,Front Load,Sanitize Option,Residential,4.4,2.92,1.84,85,3.2,4.7,4154,5/1/20,4/10/20,United States,Yes 92 | 2310004,Electrolux,EFLW317****,12505386947,Front Load,None,Residential,4.3,2.76,1.84,60,3.2,4.7,4059,1/29/18,1/26/18,"United States, Canada",No 93 | 2310163,Electrolux,EFLW427****,12505387258,Front Load,None,Residential,4.3,2.92,1.84,60,3.2,4.7,4059,1/19/18,3/1/16,"United States, Canada",Yes 94 | 2358143,Electrolux,ELFW4222***,12505387623,Front Load,Sanitize Option,Residential,2.4,2.13,1.84,90,3.8,4.7,2690,5/1/20,4/10/20,"United States, Canada",No 95 | 2300873,Fisher & Paykel,WH2424F1,8.22844E+11,Front Load,Steam Cycle,Residential,2.4,2.09,1.84,80,2.8,4.7,1982,7/30/17,7/4/17,"United States, Canada",No 96 | 2300874,Fisher & Paykel,WH2424P1,8.22844E+11,Front Load,Hand Wash Cycle,Residential,2.4,2.09,1.84,80,2.8,4.7,1982,7/30/17,7/4/17,"United States, Canada",No 97 | 2310611,Gaggenau,WM262700,8.25226E+11,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.2,2.22,1.84,84,3.7,4.7,2358,6/1/18,5/1/17,"United States, Canada",No 98 | 2310521,GE,GFW148S*L***,84691824183,Front Load,"Gentle Cycle,Steam Cycle,Delayed Start,Sanitize Option",Residential,2.4,2.07,1.84,80,4.2,4.7,2912,2/9/17,2/12/18,United States,No 99 | 2324849,GE,GFW148S*M***,84691826651,Front Load,"Gentle Cycle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.4,2.07,1.84,97,4.2,4.7,2961,8/27/18,8/27/18,"United States, Canada",No 100 | 2306811,GE,GFW400S*M***,84691826552,Front Load,"Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,4.1,2.76,1.84,113,3.2,4.7,3852,12/4/17,11/27/17,"United States, Canada",No 101 | 2310043,GE,GFW430S*M***,84691826569,Front Load,"Gentle Cycle,Other,Delayed Start,Hand Wash Cycle",Residential,4.5,2.76,1.84,123,3.2,4.7,4220,1/8/18,2/6/18,"United States, Canada",No 102 | 2306813,GE,GFW450S*M***,84691826576,Front Load,"Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,4.5,2.76,1.84,116,3.2,4.7,4220,12/4/17,11/27/17,"United States, Canada",No 103 | 2310529,GE,GFW480S*K***,84691820222,Front Load,"Gentle Cycle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,4.9,2.76,1.84,153,2.8,4.7,4047,10/3/16,2/12/18,United States,No 104 | 2310530,GE,GFW490R*K***,84691820253,Front Load,"Gentle Cycle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,4.9,2.76,1.84,153,2.8,4.7,4047,10/3/16,2/12/18,United States,No 105 | 2351443,GE,GFW510S*N***,84691849377,Front Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.5,2.76,1.84,150,3,4.7,3983,1/13/20,12/18/19,"United States, Canada",No 106 | 2350140,GE,GFW550S*N***,1,Front Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.8,2.76,1.84,158,3,4.7,4239,11/25/19,11/21/19,"United States, Canada",No 107 | 2346259,GE,GFW650S*N***,84691849315,Front Load,"Steam Cycle,Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.8,2.76,1.84,158,3,4.7,4239,9/16/19,9/12/19,"United States, Canada",No 108 | 2346625,GE,GFW850S*N***,84691849292,Front Load,"Steam Cycle,Delayed Start,Sanitize Option,Gentle Cycle",Residential,5,2.76,1.84,158,3,4.7,4460,9/19/19,9/17/19,"United States, Canada",No 109 | 2306360,GE,GTW470BMM***,7.57639E+11,Top Load,"Gentle Cycle,Other",Residential,4.2,2.15,1.29,160,4,8.4,4956,1/15/18,11/13/17,Canada,No 110 | 2310717,GE,GTW485ASJ2WS,84691815235,Top Load,Gentle Cycle,Residential,4.2,2.06,1.29,152,4.3,8.4,5340,7/11/16,2/12/18,United States,No 111 | 2310718,GE,GTW485ASJ3WS,84691815235,Top Load,Gentle Cycle,Residential,4.2,2.06,1.29,152,4.3,8.4,5340,12/12/16,2/12/18,United States,No 112 | 2300602,GE,GTW485ASJ4WS,84691815235,Top Load,Gentle Cycle,Residential,4.2,2.06,1.29,152,4.3,8.4,5328,8/10/17,7/17/17,United States,No 113 | 2319465,GE,GTW485ASJ5WS,84691815235,Top Load,Gentle Cycle,Residential,4.2,2.06,1.29,152,4.3,8.4,5340,5/15/18,5/7/18,United States,No 114 | 2306361,GE,GTW485BMM***,7.57639E+11,Top Load,"Gentle Cycle,Other",Residential,4.2,2.15,1.29,160,4,8.4,4956,1/15/18,11/13/17,Canada,No 115 | 2310625,GE,GTW490ACJ2WS,84691815884,Top Load,Gentle Cycle,Residential,4.4,2.07,1.29,133,4.1,8.4,5273,7/11/16,2/12/18,United States,No 116 | 2310626,GE,GTW490ACJ3WS,84691815884,Top Load,Gentle Cycle,Residential,4.4,2.07,1.29,133,4.1,8.4,5273,12/12/16,2/12/18,United States,No 117 | 2300603,GE,GTW490ACJ4WS,84691815884,Top Load,Gentle Cycle,Residential,4.4,2.07,1.29,133,4.1,8.4,5322,8/10/17,7/17/17,United States,No 118 | 2319462,GE,GTW490ACJ5WS,84691815884,Top Load,Gentle Cycle,Residential,4.4,2.07,1.29,133,4.1,8.4,5273,5/15/18,5/7/18,United States,No 119 | 2319463,GE,GTW490ACJ5WW,84691812012,Top Load,Gentle Cycle,Residential,4.4,2.07,1.29,133,4.1,8.4,5273,5/15/18,5/7/18,United States,No 120 | 2331678,GE,GTW500A*N***,84691845638,Top Load,"Gentle Cycle,Delayed Start",Residential,4.6,2.06,1.29,175,4.3,8.4,5860,12/17/18,12/5/18,"United States, Canada",No 121 | 2333287,GE,GTW560BM***,7.57638E+11,Top Load,Other,Residential,4.3,2.2,1.29,137,3.7,8.4,4726,1/2/19,2/11/19,Canada,No 122 | 2333288,GE,GTW575BM***,7.57638E+11,Top Load,Other,Residential,4.3,2.2,1.29,137,3.7,8.4,4726,1/2/19,2/11/19,Canada,No 123 | 2306362,GE,GTW680BMM**,7.57639E+11,Top Load,"Gentle Cycle,Other",Residential,4.6,2.16,1.29,165,3.4,8.4,4624,1/15/18,11/13/17,Canada,No 124 | 2306363,GE,GTW680BMM**,7.57639E+11,Top Load,"Gentle Cycle,Other",Residential,4.6,2.16,1.29,165,3.4,8.4,4624,1/15/18,11/13/17,Canada,No 125 | 2300604,GE,GTW680BPL0DG,84691825722,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,6/19/17,7/26/17,United States,No 126 | 2319459,GE,GTW680BPL1DG,84691825722,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,5/15/18,5/7/18,United States,No 127 | 2341016,GE,GTW680BPL2DG,84691825722,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,7/15/19,7/10/19,United States,No 128 | 2310662,GE,GTW680BSJ3WS,84691810780,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,7/11/16,2/12/18,United States,No 129 | 2310660,GE,GTW680BSJ4WS,84691810780,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,12/12/16,2/12/18,United States,No 130 | 2310661,GE,GTW680BSJ5WS,84691810780,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,5/1/17,2/12/18,United States,No 131 | 2319460,GE,GTW680BSJ6WS,84691810780,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,5/15/18,5/7/18,United States,No 132 | 2341017,GE,GTW680BSJ7WS,84691810780,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.08,1.29,143,3.6,8.4,4906,7/15/19,7/10/19,United States,No 133 | 2310720,GE,GTW685B*L***,84691825609,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,4.5,2.06,1.29,150,4.3,8.4,5683,5/3/17,2/12/18,United States,No 134 | 2340782,GE,GTW720B*N***,"084691842910, 084691842965",Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.8,2.06,1.29,165,4.3,8.4,6076,7/8/19,7/3/19,"United States, Canada",No 135 | 2340281,GE,GTW725B*N***,84691842958,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,4.6,2.06,1.29,158,4.3,8.4,5886,7/8/19,6/25/19,"United States, Canada",No 136 | 2310722,GE,GTW750C*L***,84691825623,Top Load,"Gentle Cycle,Delayed Start,Sanitize Option",Residential,5,2.06,1.29,176,4.3,8.4,6381,5/30/17,2/12/18,"United States, Canada",No 137 | 2316641,GE,GTW755C*M***,84691832263,Top Load,"Gentle Cycle,Other,Delayed Start",Residential,4.9,2.06,1.29,181,4.3,8.4,6203,4/9/18,3/30/18,"United States, Canada",No 138 | 2316642,GE,GTW755C*M***,84691832256,Top Load,"Gentle Cycle,Other,Delayed Start",Residential,4.9,2.06,1.29,181,4.3,8.4,6203,4/9/18,3/30/18,"United States, Canada",No 139 | 2341109,GE,GTW840C*N***,84691842934,Top Load,"Delayed Start,Sanitize Option,Gentle Cycle",Residential,5.2,2.06,1.29,175,4.3,8.4,6558,7/22/19,7/12/19,"United States, Canada",No 140 | 2341069,Samsung,WF50R85**A*,8.87276E+11,Front Load,"Gentle Cycle,Other",Residential,5,2.92,1.84,100,2.9,4.7,4235,8/16/19,7/4/19,"United States, Canada",Yes 141 | 2356083,Samsung,WF50T85**A*,8.87276E+11,Front Load,Steam Cycle,Residential,5,2.92,1.84,110,2.9,4.7,4235,3/20/20,3/6/20,"United States, Canada",Yes 142 | 2310447,Samsung,WF56H91**A*,8.87277E+11,Front Load,Other,Residential,5.6,3.1,1.84,135,2.7,4.7,4429,4/1/15,2/16/15,"United States, Canada",Yes 143 | 2310439,Samsung,WF56H91**C*,8.87276E+11,Front Load,Other,Residential,5.6,2.8,1.84,130,2.8,4.7,4593,10/15/14,9/25/14,"United States, Canada",No 144 | 2300867,Samsung,WV55M96**A***,8.87276E+11,Front Load,"Anti-Wrinkle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle,Supplementary Wash System",Residential,4.5,2.92,1.84,105,2.9,4.7,3850,1/23/17,5/26/17,"United States, Canada",Yes 145 | 2300868,Samsung,WV60M99**A***,8.87276E+11,Front Load,"Anti-Wrinkle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle,Supplementary Wash System",Residential,5,2.92,1.84,105,2.9,4.7,4278,1/23/17,5/26/17,"United States, Canada",Yes 146 | 2310452,Samsung,WW22K680*A*,8.87276E+11,Front Load,Other,Residential,2.2,2.25,1.84,90,4,4.7,2596,12/20/15,11/30/15,"United States, Canada",No 147 | 2309556,Samsung,WW22N685*Q*,8.87276E+11,Front Load,Steam Cycle,Residential,2.2,2.25,1.84,85,3.7,4.7,2401,3/5/18,1/23/18,"United States, Canada",Yes 148 | 2310204,Whirlpool,WFW3090G**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,2,2.38,1.84,115,3.7,4.7,2150,7/18/16,2/5/18,"United States, Canada",No 149 | 2332088,Whirlpool,WFW3090J**,8.8305E+11,Front Load,Delayed Start,Residential,2,2.07,1.84,118,4.2,4.7,2441,1/21/19,12/23/18,"United States, Canada",No 150 | 2332089,Whirlpool,WFW5090J**,8.8305E+11,Front Load,"Delayed Start,Hand Wash Cycle",Residential,2.3,2.07,1.84,128,4.2,4.7,2899,1/21/19,12/23/18,"United States, Canada",No 151 | 2331764,Whirlpool,WFW560CH**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option",Residential,4.3,2.76,1.84,123,3.2,4.7,4097,12/3/18,8/24/18,"United States, Canada",No 152 | 2331766,Whirlpool,WFW5620H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option",Residential,4.5,2.76,1.84,139,3.2,4.7,4267,12/3/18,8/24/18,"United States, Canada",No 153 | 2331767,Whirlpool,WFW6620H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option",Residential,4.5,2.76,1.84,139,3.2,4.7,4267,12/3/18,8/24/18,"United States, Canada",No 154 | 2310326,Whirlpool,WFW7540F**,8.83049E+11,Front Load,Delayed Start,Residential,4.5,2.92,1.84,88,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 155 | 2310328,Whirlpool,WFW7590F**,8.83049E+11,Front Load,Delayed Start,Residential,4.2,2.92,1.84,87,3.2,4.7,3936,6/1/16,2/5/18,"United States, Canada",No 156 | 2310418,Whirlpool,WFW75HEF**,8.83049E+11,Front Load,Delayed Start,Residential,4.5,2.92,1.84,88,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 157 | 2310208,Whirlpool,WFW8540F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,87,3.2,4.7,4210,7/11/16,2/5/18,"United States, Canada",No 158 | 2310207,Whirlpool,WFW85HEF**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,87,3.2,4.7,4210,7/11/16,2/5/18,"United States, Canada",No 159 | 2310296,Whirlpool,WFW90HEF**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,89,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 160 | 2310405,Whirlpool,WFW9290F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.2,2.92,1.84,89,3.2,4.7,3936,6/1/16,2/5/18,"United States, Canada",No 161 | 2310327,Whirlpool,WFW92HEF**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,89,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 162 | 2310416,Whirlpool,WFW92HEF**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,89,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 163 | 2310408,Whirlpool,WTW7000D**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,4.8,2.06,1.29,169,4.3,8.4,6076,6/1/16,2/5/18,"United States, Canada",No 164 | 2310395,Whirlpool,WTW7040D**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,4.8,2.06,1.29,169,4.3,8.4,6076,6/1/16,2/5/18,"United States, Canada",No 165 | 2346209,Whirlpool,WTW7120H**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,263,4.3,8.4,6761,1/1/20,9/11/19,"United States, Canada",No 166 | 2310407,Whirlpool,WTW7300D**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,4.8,2.06,1.29,169,4.3,8.4,6076,6/1/16,2/5/18,"United States, Canada",No 167 | 2309992,Whirlpool,WTW7500G**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,4.8,2.06,1.29,212,4.3,8.4,6076,9/1/17,2/5/18,"United States, Canada",No 168 | 2310404,Whirlpool,WTW8000D**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,196,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 169 | 2310393,Whirlpool,WTW8000D*+,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,196,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 170 | 2310396,Whirlpool,WTW8040D**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,196,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 171 | 2346210,Whirlpool,WTW8120H**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,260,4.3,8.4,6761,1/1/20,9/11/19,"United States, Canada",No 172 | 2310391,Whirlpool,WTW8510F**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,5.3,2.06,1.29,194,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 173 | 2307388,Whirlpool,WTW8700E**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,251,4.3,8.4,6698,6/1/16,12/5/17,"United States, Canada",No 174 | 2310474,LG,WM5005H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,4.5,2.92,1.84,105,2.8,4.7,3676,5/24/17,2/8/18,"United States, Canada",No 175 | 2310481,LG,WM8100H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.92,1.84,120,3.2,4.7,4880,5/2/16,2/8/18,"United States, Canada",Yes 176 | 2310504,LG,WM9000H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.92,1.84,120,3.2,4.7,4880,6/29/15,2/9/18,"United States, Canada",Yes 177 | 2310479,LG,WM9500H*A,1,Front Load,"Steam Cycle,Sanitize Option",Residential,5.8,3.1,1.84,120,2.7,4.7,4588,6/26/16,2/8/18,"United States, Canada",Yes 178 | 2310494,LG,WT1150C*,1,Top Load,None,Residential,4.5,2.38,1.29,140,3.7,8.4,4901,9/30/16,2/9/18,"United States, Canada",No 179 | 2310503,LG,WT1501C*,1,Top Load,None,Residential,4.5,2.38,1.29,140,3.7,8.4,4901,6/29/15,2/9/18,"United States, Canada",No 180 | 2310493,LG,WT1901C*,1,Top Load,None,Residential,5,2.38,1.29,130,3.7,8.4,5479,12/22/16,2/9/18,"United States, Canada",No 181 | 2310495,LG,WT5275C*,1,Top Load,None,Residential,4.5,2.38,1.29,140,3.7,8.4,4901,6/30/16,2/9/18,"United States, Canada",No 182 | 2310501,LG,WT5680H*A,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5,2.38,1.29,135,3.7,8.4,5479,2/15/15,2/9/18,"United States, Canada",No 183 | 2310477,LG,WT7050C*,1,Top Load,None,Residential,4.5,2.06,1.29,180,4.3,8.4,5696,4/16/17,2/8/18,"United States, Canada",No 184 | 2341401,LG,WT7060C*,1,Top Load,None,Residential,4.5,2.06,1.29,220,4.3,8.4,5721,7/22/19,7/18/19,"United States, Canada",No 185 | 2308537,LG,WT7100C*,1,Top Load,Delayed Start,Residential,4.5,2.06,1.29,220,4.3,8.4,5721,11/30/17,12/18/17,"United States, Canada",No 186 | 2359624,LG,WT7150C*,1,Top Load,None,Residential,5,2.06,1.29,200,4.3,8.4,6292,5/13/20,5/8/20,"United States, Canada",No 187 | 2310492,LG,WT7200C*,1,Top Load,None,Residential,5,2.38,1.29,130,3.7,8.4,5479,12/5/16,2/9/18,"United States, Canada",No 188 | 2320407,LG,WT7250C*,1,Top Load,None,Residential,5,2.76,1.29,110,3.2,8.4,4720,5/18/18,5/16/18,"United States, Canada",No 189 | 2320408,LG,WT7300C*,1,Top Load,None,Residential,5,2.76,1.29,110,3.2,8.4,4720,5/18/18,5/16/18,"United States, Canada",No 190 | 2310491,LG,WT7500C*,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.38,1.29,130,3.7,8.4,5621,2/15/16,2/9/18,"United States, Canada",No 191 | 2310490,LG,WT7600H*A,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.38,1.29,130,3.7,8.4,5643,2/15/16,2/9/18,"United States, Canada",No 192 | 2310502,LG,WT7700H*A,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5.7,2.76,1.29,150,3.2,8.4,5381,4/21/15,2/9/18,"United States, Canada",No 193 | 2335213,LG,WT7710H*A,1,Top Load,"Steam Cycle,Sanitize Option",Residential,5.7,2.76,1.29,150,3.2,8.4,5381,3/26/19,3/26/19,"United States, Canada",No 194 | 2334257,LG,WT7800C*,1,Top Load,None,Residential,5.5,2.76,1.29,130,3.2,8.4,5145,3/6/19,3/6/19,"United States, Canada",No 195 | 2344732,LG,WT7850H*A,1,Top Load,None,Residential,5.2,2.38,1.29,130,3.7,8.4,5665,8/14/19,8/14/19,"United States, Canada",No 196 | 2354284,LG,WT7880H*A,1,Top Load,None,Residential,5.5,2.76,1.29,150,3.2,8.4,5145,1/29/20,1/29/20,"United States, Canada",No 197 | 2321577,LG,WT7900H*A,1,Top Load,None,Residential,5.5,2.76,1.29,150,3.2,8.4,5145,7/3/18,6/25/18,"United States, Canada",No 198 | 2335028,Magic Chef,MCSFLW27S,6.65679E+11,Front Load,Delayed Start,Residential,2.7,2.76,1.84,75,3.2,4.7,2549,1/11/19,3/13/19,United States,No 199 | 2335029,Magic Chef,MCSFLW27W,6.65679E+11,Front Load,Delayed Start,Residential,2.7,2.76,1.84,75,3.2,4.7,2549,1/11/19,3/13/19,United States,No 200 | 2310325,Maytag,MHW3500F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,87,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 201 | 2310417,Maytag,MHW3500F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,87,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 202 | 2310294,Maytag,MHW3505F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.4,2.92,1.84,88,3.2,4.7,4116,6/1/16,2/5/18,"United States, Canada",No 203 | 2310290,Maytag,MHW5500F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,89,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 204 | 2331769,Maytag,MHW5630H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Delayed Start",Residential,4.5,2.76,1.84,128,3.2,4.7,4267,12/3/18,8/24/18,"United States, Canada",No 205 | 2331771,Maytag,MHW6630H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option,Delayed Start",Residential,4.8,2.76,1.84,143,3.2,4.7,4541,12/3/18,8/24/18,"United States, Canada",No 206 | 2310392,Maytag,MHW8150E**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.76,1.84,79,3.2,4.7,4239,6/1/16,2/5/18,"United States, Canada",No 207 | 2310293,Maytag,MHW8200F**,8.83049E+11,Front Load,"Other,Delayed Start",Residential,4.5,2.92,1.84,89,3.2,4.7,4210,6/1/16,2/5/18,"United States, Canada",No 208 | 2331772,Maytag,MHW8630H**,8.83049E+11,Front Load,"Anti-Wrinkle,Other,Sanitize Option,Delayed Start,Steam Cycle",Residential,5,2.76,1.84,159,3.2,4.7,4720,12/3/18,8/24/18,"United States, Canada",No 209 | 2345404,Maytag,MVW7230H**,8.83049E+11,Top Load,Other,Residential,5.2,2.06,1.29,260,4.3,8.4,6622,1/1/20,8/23/19,"United States, Canada",No 210 | 2345405,Maytag,MVW7232H**,8.8305E+11,Top Load,Other,Residential,5.3,2.06,1.29,270,4.3,8.4,6736,1/1/20,8/23/19,"United States, Canada",No 211 | 2345398,Maytag,MVW8230H**,8.83049E+11,Top Load,Other,Residential,5.2,2.06,1.29,260,4.3,8.4,6622,1/1/20,8/23/19,"United States, Canada",No 212 | 2310390,Maytag,MVWB755D**,8.83049E+11,Top Load,Other,Residential,4.8,2.06,1.29,160,4.3,8.4,6076,6/1/16,2/5/18,"United States, Canada",No 213 | 2310403,Maytag,MVWB835D**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,187,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 214 | 2310409,Maytag,MVWB855D**,8.83049E+11,Top Load,Other,Residential,5.3,2.06,1.29,187,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 215 | 2310412,Maytag,MVWB865F**,8.83049E+11,Top Load,"Other,Delayed Start",Residential,5.3,2.06,1.29,198,4.3,8.4,6698,6/1/16,2/5/18,"United States, Canada",No 216 | 2310288,Maytag,MVWB955F**,8.83049E+11,Top Load,"Other,Steam Cycle",Residential,6.2,2.38,1.29,197,3.7,8.4,6735,6/1/16,2/5/18,"United States, Canada",No 217 | 2309397,Maytag,MVWB965H**,8.83049E+11,Top Load,"Steam Cycle,Sanitize Option",Residential,6,2.06,1.29,311,4.3,8.4,7636,4/1/18,12/18/17,"United States, Canada",No 218 | 2341456,Midea,MLH52S7AGS,8.10005E+11,Front Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.92,1.84,110,3.2,4.7,4909,8/30/19,7/22/19,"United States, Canada",No 219 | 2341457,Midea,MLH52S7AWW,8.10005E+11,Front Load,"Steam Cycle,Sanitize Option",Residential,5.2,2.92,1.84,110,3.2,4.7,4909,8/30/19,7/22/19,"United States, Canada",No 220 | 2330886,Miele,WWB020,4.00252E+12,Front Load,"Anti-Wrinkle,Gentle Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.3,2.24,1.84,116,3.7,4.7,2467,1/1/19,12/6/18,"United States, Canada",No 221 | 2309345,Miele,WWF060,4.00252E+12,Front Load,"Anti-Wrinkle,Gentle Cycle,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.3,2.13,1.84,116,3.7,4.7,2467,1/1/18,11/25/17,"United States, Canada",No 222 | 2309344,Miele,WWH660,4.00252E+12,Front Load,"Anti-Wrinkle,Gentle Cycle,Other,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.3,2.13,1.84,116,3.7,4.7,2467,1/1/18,11/25/17,"United States, Canada",No 223 | 2309343,Miele,WWH860,4.00252E+12,Front Load,"Anti-Wrinkle,Gentle Cycle,Other,Steam Cycle,Delayed Start,Sanitize Option,Hand Wash Cycle",Residential,2.3,2.13,1.84,116,3.7,4.7,2467,1/1/18,11/25/17,"United States, Canada",No 224 | 2310449,Samsung,WA45H70**A*,8.87277E+11,Top Load,Other,Residential,4.5,2.06,1.29,131,3.8,8.4,5011,4/15/15,3/3/15,"United States, Canada",No 225 | 2310450,Samsung,WA45H72**A*,87276857954,Top Load,Other,Residential,4.3,2.06,1.29,131,4,8.4,5050,4/22/15,4/22/15,Canada,No 226 | 2310454,Samsung,WA45K71**A*,8.87276E+11,Top Load,Other,Residential,4.5,2.06,1.29,125,4.3,8.4,5708,1/23/16,1/8/16,"United States, Canada",No 227 | 2310453,Samsung,WA45K76**A*,8.87276E+11,Top Load,Other,Residential,4.5,2.06,1.29,125,4.3,8.4,5708,1/23/16,1/8/16,"United States, Canada",No 228 | 2310458,Samsung,WA45M70**A*,8.87276E+12,Top Load,Other,Residential,4.5,2.06,1.29,125,4.3,8.4,5708,1/1/17,11/23/16,"United States, Canada",No 229 | 2320117,Samsung,WA45N71**A*,8.87276E+11,Top Load,Other,Residential,4.5,2.06,1.29,125,4.3,8.4,5708,6/11/18,4/25/18,"United States, Canada",No 230 | 2310438,Samsung,WA48H74**A*,8.87276E+11,Top Load,Other,Residential,4.8,2.21,1.29,145,3.9,8.4,5476,9/15/14,8/1/14,"United States, Canada",No 231 | 2310442,Samsung,WA48J770*A*,8.87276E+11,Top Load,Other,Residential,4.8,2.29,1.29,129,3.9,8.4,5476,3/15/15,2/11/15,United States,No 232 | 2310443,Samsung,WA48J777*A*,8.87276E+11,Top Load,Other,Residential,4.8,2.29,1.29,129,3.9,8.4,5476,3/15/15,2/11/15,United States,No 233 | 2310451,Samsung,WA50K86**A*,8.87276E+11,Top Load,Other,Residential,5,2.38,1.29,120,3.7,8.4,5458,12/20/15,11/30/15,"United States, Canada",No 234 | 2310461,Samsung,WA50M74**A*,8.87276E+11,Top Load,Other,Residential,5,2.06,1.29,125,4.3,8.4,6343,2/12/17,12/27/16,"United States, Canada",No 235 | 2320118,Samsung,WA50N73**A*,8.87276E+11,Top Load,Other,Residential,5,2.06,1.29,125,4.3,8.4,6343,5/28/18,4/25/18,"United States, Canada",No 236 | 2333512,Samsung,WA50R52**A*,8.87276E+11,Top Load,Other,Residential,5,2.06,1.29,120,4.3,8.4,6292,2/1/19,1/16/19,"United States, Canada",No 237 | 2333511,Samsung,WA50R54**A*,8.87276E+11,Top Load,Other,Residential,5,2.06,1.29,120,4.3,8.4,6292,2/1/19,1/16/19,"United States, Canada",No 238 | 2352575,Samsung,WA50T53**A*,8.87276E+11,Top Load,"Steam Cycle,Other",Residential,5,2.06,1.29,120,4.3,8.4,6292,1/17/20,12/19/19,"United States, Canada",No 239 | 2350126,Samsung,WA50T74**A*,8.87276E+11,Top Load,Other,Residential,5,2.06,1.29,125,4.3,8.4,6292,1/3/20,11/14/19,"United States, Canada",No 240 | 2310440,Samsung,WA52J806*A*,8.87276E+11,Top Load,Other,Residential,5.2,2.38,1.29,110,3.7,8.4,5632,2/15/15,1/7/15,United States,No 241 | 2310441,Samsung,WA52J870*A*,8.87276E+11,Top Load,Other,Residential,5.2,2.28,1.29,165,3.8,8.4,5784,3/30/15,2/3/15,"United States, Canada",No 242 | 2310462,Samsung,WA52M77**A*,8.87276E+11,Top Load,Other,Residential,5.2,2.06,1.29,165,4.3,8.4,6596,2/1/17,1/13/17,"United States, Canada",No 243 | 2310463,Samsung,WA52M86**A*,8.87276E+11,Top Load,Other,Residential,5.2,2.06,1.29,125,4.3,8.4,6596,2/1/17,1/13/17,"United States, Canada",No 244 | 2350127,Samsung,WA52T76**A*,8.87276E+11,Top Load,Other,Residential,5.2,2.06,1.29,165,4.3,8.4,6545,1/3/20,11/14/19,"United States, Canada",No 245 | 2310464,Samsung,WA54M87**A*,8.87276E+11,Top Load,Other,Residential,5.4,2.06,1.29,165,4.3,8.4,6850,2/1/17,1/13/17,"United States, Canada",No 246 | 2339823,Samsung,WA54R72**A*,8.87276E+11,Top Load,Other,Residential,5.4,2.06,1.29,120,4.3,8.4,6799,7/1/19,6/10/19,"United States, Canada",No 247 | 2339822,Samsung,WA54R76**A*,8.87276E+11,Top Load,Other,Residential,5.4,2.06,1.29,165,4.3,8.4,6799,7/1/19,6/10/19,"United States, Canada",No 248 | 2310448,Samsung,WA56H90**A*,8.87277E+11,Top Load,Other,Residential,5.6,2.3,1.29,194,4.2,8.4,6889,4/15/15,3/3/15,"United States, Canada",No 249 | 2310444,Samsung,WF42H50**A*,8.87277E+11,Front Load,Other,Residential,4.2,2.8,1.84,85,3.2,4.7,3927,4/1/15,2/16/15,"United States, Canada",No 250 | 2310445,Samsung,WF45H61**A*,8.87277E+11,Front Load,None,Residential,4.5,2.76,1.84,118,3.2,4.7,4220,4/1/15,2/16/15,"United States, Canada",No 251 | 2310446,Samsung,WF45H63**A*,8.87277E+11,Front Load,Other,Residential,4.5,2.8,1.84,110,3,4.7,3956,4/1/15,2/16/15,"United States, Canada",No 252 | 2310455,Samsung,WF45K62**A*,8.87276E+11,Front Load,Other,Residential,4.5,2.92,1.84,75,2.9,4.7,3850,2/7/16,1/13/16,"United States, Canada",Yes 253 | 2310456,Samsung,WF45K65**A*,8.87276E+11,Front Load,Other,Residential,4.5,2.8,1.84,100,3,4.7,3983,2/7/16,1/13/16,"United States, Canada",No 254 | 2310459,Samsung,WF45M51**A*,8.87276E+11,Front Load,Other,Residential,4.5,3,1.84,80,2.9,4.7,3850,1/1/17,11/23/16,"United States, Canada",Yes 255 | 2310460,Samsung,WF45M55**A*,8.87276E+11,Front Load,Other,Residential,4.5,2.92,1.84,105,2.9,4.7,3850,1/1/17,11/23/16,"United States, Canada",Yes 256 | 2306851,Samsung,WF45N53**A*,8.87276E+11,Front Load,None,Residential,4.5,3,1.84,80,2.9,4.7,3850,3/1/18,11/16/17,"United States, Canada",Yes 257 | 2308752,Samsung,WF45N63**A*,8.87276E+11,Front Load,Steam Cycle,Residential,4.5,2.92,1.84,100,3,4.7,3983,2/1/18,12/22/17,"United States, Canada",Yes 258 | 2333514,Samsung,WF45R61**A*,8.87276E+11,Front Load,"Steam Cycle,Other",Residential,4.5,2.92,1.84,95,2.9,4.7,3807,2/1/19,1/15/19,"United States, Canada",Yes 259 | 2333513,Samsung,WF45R63**A*,8.87276E+11,Front Load,"Other,Steam Cycle",Residential,4.5,2.92,1.84,95,2.9,4.7,3807,2/1/19,1/15/19,"United States, Canada",Yes 260 | 2354715,Samsung,WF45T60**A*,8.87276E+11,Front Load,"Steam Cycle,Other",Residential,4.5,2.95,1.84,90,2.9,4.7,3807,2/20/20,2/5/20,"United States, Canada",Yes 261 | 2352574,Samsung,WF45T62**A*,8.87276E+11,Front Load,"Steam Cycle,Other",Residential,4.5,2.92,1.84,95,2.9,4.7,3807,2/24/20,12/4/19,"United States, Canada",Yes 262 | 2310457,Samsung,WF50K75**A*,8.87276E+11,Front Load,Other,Residential,5,2.92,1.84,105,2.9,4.7,4278,2/14/16,1/25/16,"United States, Canada",Yes -------------------------------------------------------------------------------- /NestedLoops.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "aba82639-5eb8-4ac4-82e5-0bdd946d3c2d", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "1 2 3 4 5 \n", 14 | "1 2 3 4 5 \n", 15 | "1 2 3 4 5 \n", 16 | "1 2 3 4 5 \n", 17 | "1 2 3 4 5 \n" 18 | ] 19 | } 20 | ], 21 | "source": [ 22 | "for i in range(5):\n", 23 | " for j in range(1, 6):\n", 24 | " print(j, end=\" \")\n", 25 | " print()\n" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 2, 31 | "id": "274a2a5c-3133-48d0-9135-ed6caf61cc38", 32 | "metadata": {}, 33 | "outputs": [ 34 | { 35 | "name": "stdout", 36 | "output_type": "stream", 37 | "text": [ 38 | "1 2 3 4 5 \n", 39 | "2 4 6 8 10 \n", 40 | "3 6 9 12 15 \n", 41 | "4 8 12 16 20 \n", 42 | "5 10 15 20 25 \n" 43 | ] 44 | } 45 | ], 46 | "source": [ 47 | "for i in range(1, 6):\n", 48 | " for j in range(1, 6):\n", 49 | " print(i * j, end=\" \")\n", 50 | " print()\n" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 3, 56 | "id": "d773cc6c-990f-4269-aa09-e451e0e6d4d9", 57 | "metadata": {}, 58 | "outputs": [ 59 | { 60 | "name": "stdout", 61 | "output_type": "stream", 62 | "text": [ 63 | "1 \n", 64 | "1 2 \n", 65 | "1 2 3 \n", 66 | "1 2 3 4 \n", 67 | "1 2 3 4 5 \n" 68 | ] 69 | } 70 | ], 71 | "source": [ 72 | "for i in range(1, 6):\n", 73 | " for j in range(1, i + 1):\n", 74 | " print(j, end=\" \")\n", 75 | " print()\n" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": 4, 81 | "id": "2e345d3b-593b-4de8-b2f4-dd25b02ef4b8", 82 | "metadata": {}, 83 | "outputs": [ 84 | { 85 | "name": "stdout", 86 | "output_type": "stream", 87 | "text": [ 88 | "* \n", 89 | "* * \n", 90 | "* * * \n", 91 | "* * * * \n", 92 | "* * * * * \n" 93 | ] 94 | } 95 | ], 96 | "source": [ 97 | "for i in range(1, 6):\n", 98 | " for j in range(i):\n", 99 | " print(\"*\", end=\" \")\n", 100 | " print()\n" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 5, 106 | "id": "c0c3548a-ce75-4131-b3e5-6c7e6608743b", 107 | "metadata": {}, 108 | "outputs": [ 109 | { 110 | "name": "stdout", 111 | "output_type": "stream", 112 | "text": [ 113 | "1 2 3 4 5 \n", 114 | "2 3 4 5 \n", 115 | "3 4 5 \n", 116 | "4 5 \n", 117 | "5 \n" 118 | ] 119 | } 120 | ], 121 | "source": [ 122 | "for i in range(1, 6):\n", 123 | " for j in range(i, 6):\n", 124 | " print(j, end=\" \")\n", 125 | " print()\n" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "execution_count": 6, 131 | "id": "f668d12a-e4c8-49b6-8447-b38e32522541", 132 | "metadata": {}, 133 | "outputs": [ 134 | { 135 | "name": "stdout", 136 | "output_type": "stream", 137 | "text": [ 138 | "* * * * * \n", 139 | "* * * * \n", 140 | "* * * \n", 141 | "* * \n", 142 | "* \n" 143 | ] 144 | } 145 | ], 146 | "source": [ 147 | "for i in range(5, 0, -1):\n", 148 | " for j in range(i):\n", 149 | " print(\"*\", end=\" \")\n", 150 | " print()\n" 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": 9, 156 | "id": "87bbf4c5-7e60-4520-9438-9d6468b56c2f", 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "name": "stdin", 161 | "output_type": "stream", 162 | "text": [ 163 | "Enter the total number of students: 2\n", 164 | "Enter the number of test scores per student: 5\n" 165 | ] 166 | }, 167 | { 168 | "name": "stdout", 169 | "output_type": "stream", 170 | "text": [ 171 | "\n", 172 | "Enter test scores for student 1:\n" 173 | ] 174 | }, 175 | { 176 | "name": "stdin", 177 | "output_type": "stream", 178 | "text": [ 179 | "Enter test score 1: 13\n", 180 | "Enter test score 2: 34\n", 181 | "Enter test score 3: 23\n", 182 | "Enter test score 4: 23\n", 183 | "Enter test score 5: 43\n" 184 | ] 185 | }, 186 | { 187 | "name": "stdout", 188 | "output_type": "stream", 189 | "text": [ 190 | "Average test score for student 1: 27.20\n", 191 | "\n", 192 | "Enter test scores for student 2:\n" 193 | ] 194 | }, 195 | { 196 | "name": "stdin", 197 | "output_type": "stream", 198 | "text": [ 199 | "Enter test score 1: 32\n", 200 | "Enter test score 2: 32\n", 201 | "Enter test score 3: 43\n", 202 | "Enter test score 4: 23\n", 203 | "Enter test score 5: 23\n" 204 | ] 205 | }, 206 | { 207 | "name": "stdout", 208 | "output_type": "stream", 209 | "text": [ 210 | "Average test score for student 2: 30.60\n", 211 | "\n", 212 | "Overall average test score: 28.90\n" 213 | ] 214 | } 215 | ], 216 | "source": [ 217 | "# Ask the user for the total number of students\n", 218 | "num_students = int(input(\"Enter the total number of students: \"))\n", 219 | "\n", 220 | "# Ask the user for the number of test scores per student\n", 221 | "num_scores = int(input(\"Enter the number of test scores per student: \"))\n", 222 | "\n", 223 | "# Initialize a variable to store the total sum of test scores\n", 224 | "total_sum = 0\n", 225 | "\n", 226 | "# Iterate over each student\n", 227 | "for i in range(1, num_students + 1):\n", 228 | " print(f\"\\nEnter test scores for student {i}:\")\n", 229 | " student_sum = 0 # Initialize sum of scores for each student\n", 230 | " # Iterate over each test score for the current student\n", 231 | " for j in range(1, num_scores + 1):\n", 232 | " score = float(input(f\"Enter test score {j}: \"))\n", 233 | " student_sum += score # Add score to student's sum\n", 234 | " # Calculate and display the average test score for the current student\n", 235 | " average_score = student_sum / num_scores\n", 236 | " print(f\"Average test score for student {i}: {average_score:.2f}\")\n", 237 | " total_sum += student_sum # Add student's sum to total sum\n", 238 | "\n", 239 | "# Calculate and display the overall average test score\n", 240 | "overall_average = total_sum / (num_students * num_scores)\n", 241 | "print(f\"\\nOverall average test score: {overall_average:.2f}\")\n" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": 10, 247 | "id": "6e9514cf-fea5-40fa-bf81-31084515f217", 248 | "metadata": {}, 249 | "outputs": [ 250 | { 251 | "name": "stdout", 252 | "output_type": "stream", 253 | "text": [ 254 | "Testing functions from a. and b.\n", 255 | "Subtraction: 5\n", 256 | "Multiplication: 50\n", 257 | "Division: 2.0\n", 258 | "Modulus: 0\n", 259 | "\n", 260 | "Testing Square function:\n", 261 | "Square of 5: 25\n", 262 | "\n", 263 | "Testing greater_value function:\n", 264 | "Greater value between 10 and 15: 15\n", 265 | "\n", 266 | "Testing calculate_percentage function:\n", 267 | "Percentage: 85.0\n", 268 | "\n", 269 | "Testing sum_positive_integers function:\n" 270 | ] 271 | }, 272 | { 273 | "name": "stdin", 274 | "output_type": "stream", 275 | "text": [ 276 | "Enter the range up to which you want to find the sum: 2\n" 277 | ] 278 | }, 279 | { 280 | "name": "stdout", 281 | "output_type": "stream", 282 | "text": [ 283 | "The sum of all positive integers is 3\n" 284 | ] 285 | } 286 | ], 287 | "source": [ 288 | "# a.\n", 289 | "def subtract(x, y):\n", 290 | " return x - y\n", 291 | "\n", 292 | "def multiply(x, y):\n", 293 | " return x * y\n", 294 | "\n", 295 | "def divide(x, y):\n", 296 | " if y == 0:\n", 297 | " return \"Error! Division by zero.\"\n", 298 | " else:\n", 299 | " return x / y\n", 300 | "\n", 301 | "def modulus(x, y):\n", 302 | " return x % y\n", 303 | "\n", 304 | "# b.\n", 305 | "def test_functions():\n", 306 | " a = 10\n", 307 | " b = 5\n", 308 | " print(\"Subtraction:\", subtract(a, b))\n", 309 | " print(\"Multiplication:\", multiply(a, b))\n", 310 | " print(\"Division:\", divide(a, b))\n", 311 | " print(\"Modulus:\", modulus(a, b))\n", 312 | "\n", 313 | "# c.\n", 314 | "def square(x):\n", 315 | " return x ** 2\n", 316 | "\n", 317 | "def greater_value(x, y):\n", 318 | " return max(x, y)\n", 319 | "\n", 320 | "# d.\n", 321 | "def calculate_percentage(obtained_marks, total_marks):\n", 322 | " return (obtained_marks / total_marks) * 100\n", 323 | "\n", 324 | "# e.\n", 325 | "def sum_positive_integers(max_num):\n", 326 | " return sum(range(1, max_num + 1))\n", 327 | "\n", 328 | "# Testing the functions\n", 329 | "print(\"Testing functions from a. and b.\")\n", 330 | "test_functions()\n", 331 | "\n", 332 | "print(\"\\nTesting Square function:\")\n", 333 | "print(\"Square of 5:\", square(5))\n", 334 | "\n", 335 | "print(\"\\nTesting greater_value function:\")\n", 336 | "print(\"Greater value between 10 and 15:\", greater_value(10, 15))\n", 337 | "\n", 338 | "print(\"\\nTesting calculate_percentage function:\")\n", 339 | "obtained_marks = 85\n", 340 | "total_marks = 100\n", 341 | "print(\"Percentage:\", calculate_percentage(obtained_marks, total_marks))\n", 342 | "\n", 343 | "print(\"\\nTesting sum_positive_integers function:\")\n", 344 | "max_num = int(input(\"Enter the range up to which you want to find the sum: \"))\n", 345 | "print(\"The sum of all positive integers is\", sum_positive_integers(max_num))\n" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": 11, 351 | "id": "af273307-a458-4984-9c24-34c2ef98eda5", 352 | "metadata": {}, 353 | "outputs": [ 354 | { 355 | "name": "stdout", 356 | "output_type": "stream", 357 | "text": [ 358 | "Total number of even values: 4\n", 359 | "Total number of even values: 4\n", 360 | "Total number of odd values: 5\n", 361 | "Sum of all elements of the given 2D list: 45\n", 362 | "Sum of Diagonal elements of the given 2D list: 15\n" 363 | ] 364 | } 365 | ], 366 | "source": [ 367 | "# a.\n", 368 | "def count_even_values(lst):\n", 369 | " count = 0\n", 370 | " for num in lst:\n", 371 | " if num % 2 == 0:\n", 372 | " count += 1\n", 373 | " return count\n", 374 | "\n", 375 | "# b.\n", 376 | "def count_even_odd_values(lst):\n", 377 | " even_count = 0\n", 378 | " odd_count = 0\n", 379 | " for num in lst:\n", 380 | " if num % 2 == 0:\n", 381 | " even_count += 1\n", 382 | " else:\n", 383 | " odd_count += 1\n", 384 | " return even_count, odd_count\n", 385 | "\n", 386 | "# c.\n", 387 | "def sum_of_matrix_elements(matrix):\n", 388 | " total_sum = 0\n", 389 | " for row in matrix:\n", 390 | " total_sum += sum(row)\n", 391 | " return total_sum\n", 392 | "\n", 393 | "# d.\n", 394 | "def sum_of_matrix_diagonal_elements(matrix):\n", 395 | " n = len(matrix)\n", 396 | " diagonal_sum = 0\n", 397 | " for i in range(n):\n", 398 | " diagonal_sum += matrix[i][i]\n", 399 | " return diagonal_sum\n", 400 | "\n", 401 | "# Test data for c. and d.\n", 402 | "matrix = [\n", 403 | " [1, 2, 3],\n", 404 | " [4, 5, 6],\n", 405 | " [7, 8, 9]\n", 406 | "]\n", 407 | "\n", 408 | "# Test the functions\n", 409 | "print(\"Total number of even values:\", count_even_values([1, 2, 3, 4, 5, 6, 7, 8, 9]))\n", 410 | "even_count, odd_count = count_even_odd_values([1, 2, 3, 4, 5, 6, 7, 8, 9])\n", 411 | "print(\"Total number of even values:\", even_count)\n", 412 | "print(\"Total number of odd values:\", odd_count)\n", 413 | "\n", 414 | "print(\"Sum of all elements of the given 2D list:\", sum_of_matrix_elements(matrix))\n", 415 | "\n", 416 | "print(\"Sum of Diagonal elements of the given 2D list:\", sum_of_matrix_diagonal_elements(matrix))\n" 417 | ] 418 | }, 419 | { 420 | "cell_type": "code", 421 | "execution_count": null, 422 | "id": "ffddfa54-9d70-4277-8b71-ea23b3ee0a68", 423 | "metadata": {}, 424 | "outputs": [], 425 | "source": [] 426 | } 427 | ], 428 | "metadata": { 429 | "kernelspec": { 430 | "display_name": "Python 3 (ipykernel)", 431 | "language": "python", 432 | "name": "python3" 433 | }, 434 | "language_info": { 435 | "codemirror_mode": { 436 | "name": "ipython", 437 | "version": 3 438 | }, 439 | "file_extension": ".py", 440 | "mimetype": "text/x-python", 441 | "name": "python", 442 | "nbconvert_exporter": "python", 443 | "pygments_lexer": "ipython3", 444 | "version": "3.11.7" 445 | } 446 | }, 447 | "nbformat": 4, 448 | "nbformat_minor": 5 449 | } 450 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python-Hello-World 2 | Curated collection of Python tasks for hands-on practice. Ideal for beginners and intermediates. Learn through practical examples with clear explanations. Contribute and enhance your Python skills. 3 | -------------------------------------------------------------------------------- /covid_data_explorer/README.md: -------------------------------------------------------------------------------- 1 | # COVID-19 Data Explorer 🌍📊 2 | 3 | Welcome to the **COVID-19 Data Explorer** – an interactive and professional tool to analyze global COVID-19 trends, visualize key metrics, and gain valuable insights from the pandemic data. 4 | 5 | --- 6 | 7 | ## 🚀 Features 8 | 9 | - **Upload CSV**: Upload your own COVID-19 dataset in `.csv` format to analyze custom data. 10 | - **Country Selector**: Choose from a dropdown list of countries to view specific statistics and trends. 11 | - **Metric Selector**: Select metrics like `total_cases`, `total_deaths`, or `vaccinations` for dynamic data exploration. 12 | - **Summary Statistics**: View key metrics like total cases, total deaths, and vaccination rates with visual icons. 13 | - **Interactive Visualizations**: Dynamic and responsive graphs powered by Plotly for smooth exploration of data trends. 14 | - **Professional Design**: Modern, colorful UI with intuitive navigation, perfect for professionals and researchers. 15 | 16 | --- 17 | 18 | ## 🛠️ Tech Stack 19 | 20 | - **Streamlit**: For building the interactive web app. 21 | - **Plotly**: For creating visually appealing and interactive visualizations. 22 | - **Pandas**: For data manipulation and analysis. 23 | - **Python**: The programming language used for backend logic and data processing. 24 | 25 | --- 26 | 27 | ## 📂 File Structure 28 | 29 | ```plaintext 30 | 📁 covid_data_explorer 31 | ├── 📂 data 32 | │ └── covid-data.csv # Sample COVID-19 dataset 33 | ├── 📜 app.py # Main application script 34 | ├── 📜 requirements.txt # Python dependencies 35 | ├── 📜 README.md # Project documentation 36 | 37 | --- 38 | ## 🔧 Setup and Installation 39 | 40 | Follow these steps to set up the COVID-19 Data Explorer on your local machine: 41 | 42 | 1. **Clone the Repository and Install Dependencies** 43 | Clone the repository to your local system, navigate to the project folder, and install the required dependencies: 44 | ```bash 45 | git clone https://github.com/your-username/covid-data-explorer.git 46 | cd covid_data_explorer 47 | pip install -r requirements.txt 48 | 49 | -------------------------------------------------------------------------------- /covid_data_explorer/covid_explorer.py: -------------------------------------------------------------------------------- 1 | # Import libraries 2 | import pandas as pd 3 | import numpy as np 4 | import plotly.express as px 5 | import streamlit as st 6 | import os 7 | 8 | # Ensure necessary directories exist 9 | base_dir = "D:/covid_data_explorer" 10 | data_dir = os.path.join(base_dir, "data") 11 | saved_reports_dir = os.path.join(base_dir, "saved_reports") 12 | 13 | os.makedirs(data_dir, exist_ok=True) 14 | os.makedirs(saved_reports_dir, exist_ok=True) 15 | 16 | # Default file path for the dataset 17 | default_file_path = os.path.join(data_dir, "covid-data.csv") 18 | 19 | # Function to load and preprocess data 20 | def load_data(filepath): 21 | data = pd.read_csv(filepath, parse_dates=['date']) 22 | 23 | # Selecting relevant columns 24 | columns_to_keep = [ 25 | "iso_code", "continent", "location", "date", "total_cases", "new_cases", 26 | "total_deaths", "new_deaths", "total_vaccinations", "population", 27 | "median_age", "population_density", "hospital_beds_per_thousand" 28 | ] 29 | data = data[columns_to_keep] 30 | 31 | # Handling missing values 32 | data.fillna(0, inplace=True) 33 | return data 34 | 35 | # Function to calculate summary statistics 36 | def get_summary_statistics(data): 37 | stats = { 38 | "Total Cases": int(data['total_cases'].sum()), 39 | "Total Deaths": int(data['total_deaths'].sum()), 40 | "Global Average New Cases": round(np.mean(data['new_cases']), 2), 41 | "Global Average New Deaths": round(np.mean(data['new_deaths']), 2), 42 | "Total Vaccinations": int(data['total_vaccinations'].sum()), 43 | } 44 | return stats 45 | 46 | # Function to plot data using Plotly 47 | def plot_data(data, country='World', metric='total_cases'): 48 | country_data = data[data['location'] == country] 49 | fig = px.line( 50 | country_data, 51 | x='date', 52 | y=metric, 53 | title=f'{metric.replace("_", " ").title()} in {country}', 54 | labels={'date': 'Date', metric: metric.replace("_", " ").title()} 55 | ) 56 | return fig 57 | 58 | # Streamlit App 59 | st.title("COVID-19 Data Explorer") 60 | st.sidebar.title("Options") 61 | 62 | # File uploader for custom dataset 63 | filepath = st.sidebar.file_uploader("Upload CSV", type=["csv"]) 64 | 65 | # Load default or uploaded dataset 66 | if filepath: 67 | data = load_data(filepath) 68 | else: 69 | if not os.path.exists(default_file_path): 70 | st.error(f"Default dataset not found at '{default_file_path}'. Please upload a CSV.") 71 | else: 72 | data = load_data(default_file_path) 73 | 74 | # Sidebar options 75 | if 'location' in data.columns: 76 | country = st.sidebar.selectbox("Select Country", data['location'].unique()) 77 | else: 78 | st.error("The dataset does not have a 'location' column. Please upload a valid CSV.") 79 | country = "World" 80 | 81 | metric = st.sidebar.selectbox("Select Metric", ['total_cases', 'new_cases', 'total_deaths', 'new_deaths', 'total_vaccinations']) 82 | 83 | # Display Summary Statistics 84 | st.header("Summary Statistics") 85 | stats = get_summary_statistics(data) 86 | st.write(stats) 87 | 88 | # Data Visualization 89 | st.header("Data Visualization") 90 | fig = plot_data(data, country, metric) 91 | st.plotly_chart(fig) 92 | 93 | # Save Graph 94 | if st.button("Save Graph"): 95 | save_path = os.path.join(saved_reports_dir, f"{country}_{metric}_trend.png") 96 | fig.write_image(save_path) 97 | st.success(f"Graph saved as {save_path}") 98 | 99 | # Save Statistics 100 | if st.button("Save Statistics"): 101 | stats_path = os.path.join(saved_reports_dir, f"{country}_statistics.txt") 102 | with open(stats_path, "w") as f: 103 | for key, value in stats.items(): 104 | f.write(f"{key}: {value}\n") 105 | st.success(f"Statistics saved as {stats_path}") 106 | -------------------------------------------------------------------------------- /covid_data_explorer/covid_explorer_ui.py: -------------------------------------------------------------------------------- 1 | # Import libraries 2 | import pandas as pd 3 | import numpy as np 4 | import plotly.express as px 5 | import streamlit as st 6 | import os 7 | 8 | # Ensure necessary directories exist 9 | base_dir = "D:/covid_data_explorer" 10 | data_dir = os.path.join(base_dir, "data") 11 | saved_reports_dir = os.path.join(base_dir, "saved_reports") 12 | 13 | os.makedirs(data_dir, exist_ok=True) 14 | os.makedirs(saved_reports_dir, exist_ok=True) 15 | 16 | # Default file path for the dataset 17 | default_file_path = os.path.join(data_dir, "covid-data.csv") 18 | 19 | # Function to load and preprocess data 20 | def load_data(filepath): 21 | data = pd.read_csv(filepath, parse_dates=['date']) 22 | # Selecting relevant columns 23 | columns_to_keep = [ 24 | "iso_code", "continent", "location", "date", "total_cases", "new_cases", 25 | "total_deaths", "new_deaths", "total_vaccinations", "population", 26 | "median_age", "population_density", "hospital_beds_per_thousand" 27 | ] 28 | data = data[columns_to_keep] 29 | data.fillna(0, inplace=True) # Handling missing values 30 | return data 31 | 32 | # Function to calculate summary statistics 33 | def get_summary_statistics(data): 34 | stats = { 35 | "🌎 Total Cases": int(data['total_cases'].sum()), 36 | "⚰️ Total Deaths": int(data['total_deaths'].sum()), 37 | "📈 Avg. New Cases": round(np.mean(data['new_cases']), 2), 38 | "💉 Total Vaccinations": int(data['total_vaccinations'].sum()), 39 | } 40 | return stats 41 | 42 | # Function to plot data using Plotly 43 | def plot_data(data, country='World', metric='total_cases'): 44 | country_data = data[data['location'] == country] 45 | fig = px.line( 46 | country_data, 47 | x='date', 48 | y=metric, 49 | title=f'{metric.replace("_", " ").title()} in {country}', 50 | labels={'date': 'Date', metric: metric.replace("_", " ").title()}, 51 | color_discrete_sequence=px.colors.sequential.Viridis 52 | ) 53 | fig.update_layout( 54 | title=dict(font=dict(size=24), x=0.5), 55 | xaxis=dict(title="Date", titlefont=dict(size=20), tickfont=dict(size=16)), 56 | yaxis=dict(title=metric.replace("_", " ").title(), titlefont=dict(size=20), tickfont=dict(size=16)), 57 | plot_bgcolor='rgba(0,0,0,0)', paper_bgcolor='rgba(0,0,0,0)', 58 | font=dict(color='white') 59 | ) 60 | fig.update_traces(line=dict(color='white', width=2)) 61 | return fig 62 | 63 | # Streamlit App 64 | st.set_page_config(page_title="COVID-19 Data Explorer", page_icon="🦠", layout="wide") 65 | st.markdown( 66 | """ 67 | 82 | """, 83 | unsafe_allow_html=True 84 | ) 85 | 86 | st.title("🦠 COVID-19 Data Explorer") 87 | st.markdown( 88 | """ 89 |
90 |

Welcome to the COVID-19 Data Explorer!

91 |

Analyze global trends, upload your own data, and visualize key insights.

92 |
93 | """, unsafe_allow_html=True 94 | ) 95 | st.sidebar.title("⚙️ Options") 96 | 97 | # File uploader for custom dataset 98 | filepath = st.sidebar.file_uploader("📂 Upload CSV", type=["csv"]) 99 | 100 | # Load default or uploaded dataset 101 | if filepath: 102 | data = load_data(filepath) 103 | else: 104 | if not os.path.exists(default_file_path): 105 | st.error(f"❌ Default dataset not found at '{default_file_path}'. Please upload a CSV.") 106 | else: 107 | data = load_data(default_file_path) 108 | 109 | # Sidebar options 110 | if 'location' in data.columns: 111 | country = st.sidebar.selectbox("🌍 Select Country", data['location'].unique()) 112 | else: 113 | st.error("❌ The dataset does not have a 'location' column. Please upload a valid CSV.") 114 | country = "World" 115 | 116 | metric = st.sidebar.selectbox("📊 Select Metric", ['total_cases', 'new_cases', 'total_deaths', 'new_deaths', 'total_vaccinations']) 117 | 118 | # Display Summary Statistics 119 | st.header("📋 Summary Statistics") 120 | stats = get_summary_statistics(data) 121 | for key, value in stats.items(): 122 | st.markdown(f"
{key}: {value:,}
", unsafe_allow_html=True) 123 | 124 | # Data Visualization 125 | st.header("📈 Data Visualization") 126 | fig = plot_data(data, country, metric) 127 | st.plotly_chart(fig) 128 | 129 | # Save Graph 130 | if st.button("💾 Save Graph"): 131 | save_path = os.path.join(saved_reports_dir, f"{country}_{metric}_trend.png") 132 | fig.write_image(save_path) 133 | st.success(f"✅ Graph saved at {save_path}") 134 | 135 | # Save Statistics 136 | if st.button("📝 Save Statistics"): 137 | stats_path = os.path.join(saved_reports_dir, f"{country}_statistics.txt") 138 | with open(stats_path, "w") as f: 139 | for key, value in stats.items(): 140 | f.write(f"{key}: {value}\n") 141 | st.success(f"✅ Statistics saved at {stats_path}") 142 | -------------------------------------------------------------------------------- /covid_data_explorer/requirements.txt: -------------------------------------------------------------------------------- 1 | streamlit==1.25.0 # For building the web app 2 | pandas==2.1.1 # For data processing 3 | numpy==1.26.0 # For numerical computations 4 | plotly==5.15.0 # For interactive data visualizations 5 | matplotlib==3.8.0 # For static plots (if needed) 6 | scipy==1.11.3 # For advanced statistical analysis 7 | seaborn==0.13.0 # For additional visualizations 8 | openpyxl==3.1.2 # If Excel files need to be supported 9 | altair==5.0.0 # For interactive charts (optional) 10 | python-decouple==3.8 # To manage environment variables (if needed) 11 | watchdog==3.0.0 # Streamlit file watcher dependency 12 | -------------------------------------------------------------------------------- /covid_data_explorer/saved_reports/Afghanistan_statistics.txt: -------------------------------------------------------------------------------- 1 | Total Cases: 2085794642450 2 | Total Deaths: 24989420187 3 | Global Average New Cases: 9336.96 4 | Global Average New Deaths: 83.17 5 | Total Vaccinations: 35412072372399 6 | -------------------------------------------------------------------------------- /covid_data_explorer/saved_reports/Afghanistan_total_cases_trend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shaikh-Yaqoob/Python-Hello-World/e4bb413c5e69e98701bc8597f9224b465509dc89/covid_data_explorer/saved_reports/Afghanistan_total_cases_trend.png -------------------------------------------------------------------------------- /model-check.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "41df258d-f9f6-4d71-8164-b024230cd1ec", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "torch is installed.\n", 14 | "torchvision is installed.\n", 15 | "torchaudio is installed.\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "import importlib.util\n", 21 | "\n", 22 | "def check_module(module_name):\n", 23 | " spec = importlib.util.find_spec(module_name)\n", 24 | " if spec is None:\n", 25 | " print(f\"{module_name} is not installed.\")\n", 26 | " else:\n", 27 | " print(f\"{module_name} is installed.\")\n", 28 | "\n", 29 | "# Usage example:\n", 30 | "check_module(\"torch\")\n", 31 | "check_module(\"torchvision\")\n", 32 | "check_module(\"torchaudio\")\n" 33 | ] 34 | } 35 | ], 36 | "metadata": { 37 | "kernelspec": { 38 | "display_name": "Python 3 (ipykernel)", 39 | "language": "python", 40 | "name": "python3" 41 | }, 42 | "language_info": { 43 | "codemirror_mode": { 44 | "name": "ipython", 45 | "version": 3 46 | }, 47 | "file_extension": ".py", 48 | "mimetype": "text/x-python", 49 | "name": "python", 50 | "nbconvert_exporter": "python", 51 | "pygments_lexer": "ipython3", 52 | "version": "3.11.7" 53 | } 54 | }, 55 | "nbformat": 4, 56 | "nbformat_minor": 5 57 | } 58 | --------------------------------------------------------------------------------