├── Conditional Statements ├── 2. Conditional Statements.ipynb ├── 3. Functions,Loops.ipynb └── data ├── Data Visualization.ipynb ├── Data Visualization ├── Boxplot.ipynb ├── Matplotlib.ipynb ├── Scatter plot.ipynb └── Subplots.ipynb ├── EDA-1 └── EDA- 1.ipynb ├── Employees.xlsx ├── Numpy └── Numpy.ipynb ├── Pandas.ipynb ├── Pandas ├── 4.Pandas.ipynb ├── Filtering.ipynb └── Pandas.ipynb ├── Python_Basics └── PythonBasics.ipynb ├── Statistics ├── ANOVA and Chi2.ipynb ├── CDF.ipynb ├── Confidence Interval Code.ipynb ├── Hypothesis Test.ipynb ├── Implementation ND.ipynb └── chi2.csv ├── bookstore_sales.csv ├── fitness.csv └── retail_sales.csv /Conditional Statements/2. Conditional Statements.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "c73b4c39", 6 | "metadata": {}, 7 | "source": [ 8 | "# User Input" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "1875c3f9", 15 | "metadata": { 16 | "ExecuteTime": { 17 | "end_time": "2023-03-09T07:36:54.870610Z", 18 | "start_time": "2023-03-09T07:36:41.420196Z" 19 | } 20 | }, 21 | "outputs": [ 22 | { 23 | "name": "stdout", 24 | "output_type": "stream", 25 | "text": [ 26 | "50\n" 27 | ] 28 | }, 29 | { 30 | "data": { 31 | "text/plain": [ 32 | "'50'" 33 | ] 34 | }, 35 | "execution_count": 1, 36 | "metadata": {}, 37 | "output_type": "execute_result" 38 | } 39 | ], 40 | "source": [ 41 | "input()" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 2, 47 | "id": "12472a13", 48 | "metadata": { 49 | "ExecuteTime": { 50 | "end_time": "2023-03-09T07:37:54.246628Z", 51 | "start_time": "2023-03-09T07:37:47.358538Z" 52 | } 53 | }, 54 | "outputs": [ 55 | { 56 | "name": "stdout", 57 | "output_type": "stream", 58 | "text": [ 59 | "Enter your age: 18\n" 60 | ] 61 | } 62 | ], 63 | "source": [ 64 | "age = input('Enter your age: ')" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": 3, 70 | "id": "9eea4525", 71 | "metadata": { 72 | "ExecuteTime": { 73 | "end_time": "2023-03-09T07:38:00.489999Z", 74 | "start_time": "2023-03-09T07:38:00.474114Z" 75 | } 76 | }, 77 | "outputs": [ 78 | { 79 | "data": { 80 | "text/plain": [ 81 | "'18'" 82 | ] 83 | }, 84 | "execution_count": 3, 85 | "metadata": {}, 86 | "output_type": "execute_result" 87 | } 88 | ], 89 | "source": [ 90 | "age" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": 4, 96 | "id": "c5bef25f", 97 | "metadata": { 98 | "ExecuteTime": { 99 | "end_time": "2023-03-09T07:38:10.344758Z", 100 | "start_time": "2023-03-09T07:38:10.329756Z" 101 | } 102 | }, 103 | "outputs": [ 104 | { 105 | "data": { 106 | "text/plain": [ 107 | "str" 108 | ] 109 | }, 110 | "execution_count": 4, 111 | "metadata": {}, 112 | "output_type": "execute_result" 113 | } 114 | ], 115 | "source": [ 116 | "type(age)" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 5, 122 | "id": "7d128238", 123 | "metadata": { 124 | "ExecuteTime": { 125 | "end_time": "2023-03-09T07:39:24.169630Z", 126 | "start_time": "2023-03-09T07:39:21.371737Z" 127 | } 128 | }, 129 | "outputs": [ 130 | { 131 | "name": "stdout", 132 | "output_type": "stream", 133 | "text": [ 134 | "Enter your age: 18\n" 135 | ] 136 | } 137 | ], 138 | "source": [ 139 | "age = int(input('Enter your age: '))" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": 6, 145 | "id": "ffb85285", 146 | "metadata": { 147 | "ExecuteTime": { 148 | "end_time": "2023-03-09T07:39:26.479073Z", 149 | "start_time": "2023-03-09T07:39:26.469543Z" 150 | } 151 | }, 152 | "outputs": [ 153 | { 154 | "data": { 155 | "text/plain": [ 156 | "18" 157 | ] 158 | }, 159 | "execution_count": 6, 160 | "metadata": {}, 161 | "output_type": "execute_result" 162 | } 163 | ], 164 | "source": [ 165 | "age" 166 | ] 167 | }, 168 | { 169 | "cell_type": "code", 170 | "execution_count": 7, 171 | "id": "d1dfc76d", 172 | "metadata": { 173 | "ExecuteTime": { 174 | "end_time": "2023-03-09T07:39:32.844270Z", 175 | "start_time": "2023-03-09T07:39:32.830596Z" 176 | } 177 | }, 178 | "outputs": [ 179 | { 180 | "data": { 181 | "text/plain": [ 182 | "int" 183 | ] 184 | }, 185 | "execution_count": 7, 186 | "metadata": {}, 187 | "output_type": "execute_result" 188 | } 189 | ], 190 | "source": [ 191 | "type(age)" 192 | ] 193 | }, 194 | { 195 | "cell_type": "markdown", 196 | "id": "c5ad61e8", 197 | "metadata": {}, 198 | "source": [ 199 | "# Conditional Statements\n", 200 | "- if\n", 201 | "- else\n", 202 | "- elif" 203 | ] 204 | }, 205 | { 206 | "cell_type": "markdown", 207 | "id": "d773bccd", 208 | "metadata": {}, 209 | "source": [ 210 | "- if" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 9, 216 | "id": "2319fa88", 217 | "metadata": { 218 | "ExecuteTime": { 219 | "end_time": "2023-03-09T07:45:36.521073Z", 220 | "start_time": "2023-03-09T07:45:36.505389Z" 221 | } 222 | }, 223 | "outputs": [], 224 | "source": [ 225 | "userid = 'aish'\n", 226 | "\n", 227 | "if userid == 'aishm':\n", 228 | " print('Grant access')" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 13, 234 | "id": "b0139f6b", 235 | "metadata": { 236 | "ExecuteTime": { 237 | "end_time": "2023-03-09T07:48:10.594608Z", 238 | "start_time": "2023-03-09T07:48:08.128307Z" 239 | } 240 | }, 241 | "outputs": [ 242 | { 243 | "name": "stdout", 244 | "output_type": "stream", 245 | "text": [ 246 | "Enter the name: Virat\n", 247 | "Success\n" 248 | ] 249 | } 250 | ], 251 | "source": [ 252 | "#Check whether the player is Virat kolhi\n", 253 | "player = input('Enter the name: ')\n", 254 | "\n", 255 | "if player == 'Virat':\n", 256 | " print('Success')" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": 16, 262 | "id": "d81665dc", 263 | "metadata": { 264 | "ExecuteTime": { 265 | "end_time": "2023-03-09T07:50:08.283768Z", 266 | "start_time": "2023-03-09T07:50:06.614513Z" 267 | } 268 | }, 269 | "outputs": [ 270 | { 271 | "name": "stdout", 272 | "output_type": "stream", 273 | "text": [ 274 | "Enter the name: jo\n", 275 | "player is not virat\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "#Check whether the player is Virat kolhi\n", 281 | "player = input('Enter the name: ')\n", 282 | "\n", 283 | "if player == 'Virat':\n", 284 | " print('Success')\n", 285 | "else:\n", 286 | " print('player is not virat')" 287 | ] 288 | }, 289 | { 290 | "cell_type": "code", 291 | "execution_count": 18, 292 | "id": "64a8930d", 293 | "metadata": { 294 | "ExecuteTime": { 295 | "end_time": "2023-03-09T07:52:46.037810Z", 296 | "start_time": "2023-03-09T07:52:43.874056Z" 297 | } 298 | }, 299 | "outputs": [ 300 | { 301 | "name": "stdout", 302 | "output_type": "stream", 303 | "text": [ 304 | "Enter any number-5\n", 305 | "Negative\n" 306 | ] 307 | } 308 | ], 309 | "source": [ 310 | "#Check whether the number is positive/negative\n", 311 | "number = int(input('Enter any number'))\n", 312 | "\n", 313 | "if number > 0:\n", 314 | " print('Positive')\n", 315 | "else:\n", 316 | " print('Negative')" 317 | ] 318 | }, 319 | { 320 | "cell_type": "code", 321 | "execution_count": 21, 322 | "id": "02ab90d3", 323 | "metadata": { 324 | "ExecuteTime": { 325 | "end_time": "2023-03-09T07:54:20.609457Z", 326 | "start_time": "2023-03-09T07:54:18.732342Z" 327 | } 328 | }, 329 | "outputs": [ 330 | { 331 | "name": "stdout", 332 | "output_type": "stream", 333 | "text": [ 334 | "Number: 9\n", 335 | "Odd number\n" 336 | ] 337 | } 338 | ], 339 | "source": [ 340 | "#Check whether the number is odd or even\n", 341 | "\n", 342 | "num = int(input('Number: '))\n", 343 | "\n", 344 | "if num%2==0:\n", 345 | " print('Number is Even')\n", 346 | "else:\n", 347 | " print('Odd number')" 348 | ] 349 | }, 350 | { 351 | "cell_type": "code", 352 | "execution_count": 24, 353 | "id": "f7b02a40", 354 | "metadata": { 355 | "ExecuteTime": { 356 | "end_time": "2023-03-09T07:58:30.024465Z", 357 | "start_time": "2023-03-09T07:58:28.326166Z" 358 | } 359 | }, 360 | "outputs": [ 361 | { 362 | "name": "stdout", 363 | "output_type": "stream", 364 | "text": [ 365 | "Enter age: 18\n", 366 | "You are eligible\n" 367 | ] 368 | } 369 | ], 370 | "source": [ 371 | "#Write python program which tell whether the person is eligible to do vote.\n", 372 | "\n", 373 | "age = int(input('Enter age: '))\n", 374 | "\n", 375 | "if age >= 18:\n", 376 | " print('You are eligible')\n", 377 | "else:\n", 378 | " print('You need to wait for more', 18-age,' years')" 379 | ] 380 | }, 381 | { 382 | "cell_type": "markdown", 383 | "id": "7a3b62aa", 384 | "metadata": { 385 | "ExecuteTime": { 386 | "end_time": "2023-03-04T05:09:22.046040Z", 387 | "start_time": "2023-03-04T05:09:22.032172Z" 388 | } 389 | }, 390 | "source": [ 391 | "- elif" 392 | ] 393 | }, 394 | { 395 | "cell_type": "code", 396 | "execution_count": 31, 397 | "id": "8563d6ed", 398 | "metadata": { 399 | "ExecuteTime": { 400 | "end_time": "2023-03-09T08:02:32.328192Z", 401 | "start_time": "2023-03-09T08:02:31.341700Z" 402 | } 403 | }, 404 | "outputs": [ 405 | { 406 | "name": "stdout", 407 | "output_type": "stream", 408 | "text": [ 409 | "Enter any number: 5\n", 410 | "Number is positive\n" 411 | ] 412 | } 413 | ], 414 | "source": [ 415 | "#Check whether the number is positive/negative/zero\n", 416 | "\n", 417 | "number = int(input('Enter any number: '))\n", 418 | "\n", 419 | "if number > 0:\n", 420 | " print('Number is positive')\n", 421 | "elif number == 0:\n", 422 | " print('Zero')\n", 423 | "else:\n", 424 | " print('Negative')" 425 | ] 426 | }, 427 | { 428 | "cell_type": "code", 429 | "execution_count": 34, 430 | "id": "f21c4a2f", 431 | "metadata": { 432 | "ExecuteTime": { 433 | "end_time": "2023-03-09T08:06:26.311299Z", 434 | "start_time": "2023-03-09T08:06:14.378112Z" 435 | } 436 | }, 437 | "outputs": [ 438 | { 439 | "name": "stdout", 440 | "output_type": "stream", 441 | "text": [ 442 | "Enter marks: 55\n", 443 | "D\n" 444 | ] 445 | } 446 | ], 447 | "source": [ 448 | "# Give grades based on percentages\n", 449 | "#A : marks >85\n", 450 | "#B : marks < 85 and >70\n", 451 | "#C : makrs <70 and > 60\n", 452 | "#D \n", 453 | "\n", 454 | "marks = int(input('Enter marks: '))\n", 455 | "\n", 456 | "if marks > 85:\n", 457 | " print('A')\n", 458 | "elif (marks < 85) and (marks >70):\n", 459 | " print('B')\n", 460 | "elif (marks <70) and (marks >60):\n", 461 | " print('C')\n", 462 | "else:\n", 463 | " print('D')" 464 | ] 465 | }, 466 | { 467 | "cell_type": "markdown", 468 | "id": "72b1ca58", 469 | "metadata": {}, 470 | "source": [ 471 | "# In-Class Exercise:\n", 472 | "\n", 473 | "1. Write a program which will print Century if the player has made more than 100 runs else it should write how many more runs he needs to have to complete the century.\n", 474 | "2. Write a program to check the number is one digited, two digited and three digited.\n", 475 | "3. Write a program to check whether the user has entered number 99 or not." 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": null, 481 | "id": "79bb1428", 482 | "metadata": {}, 483 | "outputs": [], 484 | "source": [] 485 | }, 486 | { 487 | "cell_type": "code", 488 | "execution_count": null, 489 | "id": "2a821e61", 490 | "metadata": {}, 491 | "outputs": [], 492 | "source": [] 493 | } 494 | ], 495 | "metadata": { 496 | "kernelspec": { 497 | "display_name": "Python 3 (ipykernel)", 498 | "language": "python", 499 | "name": "python3" 500 | }, 501 | "language_info": { 502 | "codemirror_mode": { 503 | "name": "ipython", 504 | "version": 3 505 | }, 506 | "file_extension": ".py", 507 | "mimetype": "text/x-python", 508 | "name": "python", 509 | "nbconvert_exporter": "python", 510 | "pygments_lexer": "ipython3", 511 | "version": "3.9.13" 512 | } 513 | }, 514 | "nbformat": 4, 515 | "nbformat_minor": 5 516 | } 517 | -------------------------------------------------------------------------------- /Conditional Statements/3. Functions,Loops.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "e4b949d4", 6 | "metadata": {}, 7 | "source": [ 8 | "# Functions\n", 9 | "- In python, there are two types of function.\n", 10 | " - Built-in funtions\n", 11 | " - User defined function\n", 12 | "- We can create our own customized functions in python for code reusability." 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 1, 18 | "id": "c03cfde8", 19 | "metadata": { 20 | "ExecuteTime": { 21 | "end_time": "2023-03-09T08:37:53.648308Z", 22 | "start_time": "2023-03-09T08:37:53.624690Z" 23 | } 24 | }, 25 | "outputs": [], 26 | "source": [ 27 | "#Basic Function" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 2, 33 | "id": "44fe4a3f", 34 | "metadata": { 35 | "ExecuteTime": { 36 | "end_time": "2023-03-09T08:37:53.663896Z", 37 | "start_time": "2023-03-09T08:37:53.650815Z" 38 | } 39 | }, 40 | "outputs": [], 41 | "source": [ 42 | "def simple_function():\n", 43 | " print('This is my first function')" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": 3, 49 | "id": "77be4f62", 50 | "metadata": { 51 | "ExecuteTime": { 52 | "end_time": "2023-03-09T08:37:53.679818Z", 53 | "start_time": "2023-03-09T08:37:53.666976Z" 54 | } 55 | }, 56 | "outputs": [ 57 | { 58 | "name": "stdout", 59 | "output_type": "stream", 60 | "text": [ 61 | "This is my first function\n" 62 | ] 63 | } 64 | ], 65 | "source": [ 66 | "simple_function()" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 4, 72 | "id": "b442d6bc", 73 | "metadata": { 74 | "ExecuteTime": { 75 | "end_time": "2023-03-09T08:37:53.695398Z", 76 | "start_time": "2023-03-09T08:37:53.687391Z" 77 | } 78 | }, 79 | "outputs": [], 80 | "source": [ 81 | "def func():\n", 82 | " print('First')\n", 83 | " print('Second')" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 5, 89 | "id": "ce3201c6", 90 | "metadata": { 91 | "ExecuteTime": { 92 | "end_time": "2023-03-09T08:37:53.711178Z", 93 | "start_time": "2023-03-09T08:37:53.699028Z" 94 | } 95 | }, 96 | "outputs": [ 97 | { 98 | "name": "stdout", 99 | "output_type": "stream", 100 | "text": [ 101 | "First\n", 102 | "Second\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "func()" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": 6, 113 | "id": "e2770230", 114 | "metadata": { 115 | "ExecuteTime": { 116 | "end_time": "2023-03-09T08:37:53.726360Z", 117 | "start_time": "2023-03-09T08:37:53.714176Z" 118 | } 119 | }, 120 | "outputs": [ 121 | { 122 | "name": "stdout", 123 | "output_type": "stream", 124 | "text": [ 125 | "\n" 126 | ] 127 | } 128 | ], 129 | "source": [ 130 | "print()" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": 7, 136 | "id": "c96b8c93", 137 | "metadata": { 138 | "ExecuteTime": { 139 | "end_time": "2023-03-09T08:37:53.757445Z", 140 | "start_time": "2023-03-09T08:37:53.729071Z" 141 | } 142 | }, 143 | "outputs": [], 144 | "source": [ 145 | "#Docstring" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": 8, 151 | "id": "a50ef5a0", 152 | "metadata": { 153 | "ExecuteTime": { 154 | "end_time": "2023-03-09T08:37:53.773372Z", 155 | "start_time": "2023-03-09T08:37:53.761564Z" 156 | } 157 | }, 158 | "outputs": [], 159 | "source": [ 160 | "def function():\n", 161 | " '''This function will print number 18'''\n", 162 | " print(18)" 163 | ] 164 | }, 165 | { 166 | "cell_type": "code", 167 | "execution_count": 9, 168 | "id": "1b90c78c", 169 | "metadata": { 170 | "ExecuteTime": { 171 | "end_time": "2023-03-09T08:37:53.789058Z", 172 | "start_time": "2023-03-09T08:37:53.777021Z" 173 | } 174 | }, 175 | "outputs": [ 176 | { 177 | "name": "stdout", 178 | "output_type": "stream", 179 | "text": [ 180 | "18\n" 181 | ] 182 | } 183 | ], 184 | "source": [ 185 | "function()" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 10, 191 | "id": "fc10f05f", 192 | "metadata": { 193 | "ExecuteTime": { 194 | "end_time": "2023-03-09T08:37:53.804404Z", 195 | "start_time": "2023-03-09T08:37:53.794628Z" 196 | } 197 | }, 198 | "outputs": [], 199 | "source": [ 200 | "#Write a python function which will return me the maximum number\n", 201 | "def max_number(x,y):\n", 202 | " if x >y:\n", 203 | " print(x)" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": 11, 209 | "id": "8a269a9a", 210 | "metadata": { 211 | "ExecuteTime": { 212 | "end_time": "2023-03-09T08:37:53.820326Z", 213 | "start_time": "2023-03-09T08:37:53.807137Z" 214 | } 215 | }, 216 | "outputs": [ 217 | { 218 | "name": "stdout", 219 | "output_type": "stream", 220 | "text": [ 221 | "10\n" 222 | ] 223 | } 224 | ], 225 | "source": [ 226 | "max_number(10,5)" 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "execution_count": 12, 232 | "id": "003384b1", 233 | "metadata": { 234 | "ExecuteTime": { 235 | "end_time": "2023-03-09T08:37:53.836380Z", 236 | "start_time": "2023-03-09T08:37:53.824654Z" 237 | } 238 | }, 239 | "outputs": [], 240 | "source": [ 241 | "#*args" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": 13, 247 | "id": "5fbfe8d0", 248 | "metadata": { 249 | "ExecuteTime": { 250 | "end_time": "2023-03-09T08:37:53.851764Z", 251 | "start_time": "2023-03-09T08:37:53.838539Z" 252 | } 253 | }, 254 | "outputs": [], 255 | "source": [ 256 | "def max_number(*args):\n", 257 | " print(max(args))" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 14, 263 | "id": "bad7bd8b", 264 | "metadata": { 265 | "ExecuteTime": { 266 | "end_time": "2023-03-09T08:37:53.867079Z", 267 | "start_time": "2023-03-09T08:37:53.854763Z" 268 | } 269 | }, 270 | "outputs": [ 271 | { 272 | "name": "stdout", 273 | "output_type": "stream", 274 | "text": [ 275 | "200\n" 276 | ] 277 | } 278 | ], 279 | "source": [ 280 | "max_number(10,50,32,56,52,200)" 281 | ] 282 | }, 283 | { 284 | "cell_type": "markdown", 285 | "id": "603cc120", 286 | "metadata": {}, 287 | "source": [ 288 | "# Loops\n", 289 | "1. While loop\n", 290 | "2. For loop" 291 | ] 292 | }, 293 | { 294 | "cell_type": "code", 295 | "execution_count": 19, 296 | "id": "9fcf2c15", 297 | "metadata": { 298 | "ExecuteTime": { 299 | "end_time": "2023-03-09T08:38:53.692011Z", 300 | "start_time": "2023-03-09T08:38:53.679406Z" 301 | }, 302 | "scrolled": false 303 | }, 304 | "outputs": [ 305 | { 306 | "name": "stdout", 307 | "output_type": "stream", 308 | "text": [ 309 | "1\n", 310 | "2\n", 311 | "3\n", 312 | "4\n", 313 | "5\n", 314 | "6\n", 315 | "7\n", 316 | "8\n", 317 | "9\n" 318 | ] 319 | } 320 | ], 321 | "source": [ 322 | "#While Loop\n", 323 | "i = 1\n", 324 | "\n", 325 | "while i < 10:\n", 326 | " print(i)\n", 327 | " i = i+1" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": 23, 333 | "id": "ec0d9c0d", 334 | "metadata": { 335 | "ExecuteTime": { 336 | "end_time": "2023-03-09T08:41:10.059983Z", 337 | "start_time": "2023-03-09T08:41:10.046394Z" 338 | } 339 | }, 340 | "outputs": [ 341 | { 342 | "data": { 343 | "text/plain": [ 344 | "range(0, 31, 2)" 345 | ] 346 | }, 347 | "execution_count": 23, 348 | "metadata": {}, 349 | "output_type": "execute_result" 350 | } 351 | ], 352 | "source": [ 353 | "#range function\n", 354 | "r = range(0,31,2)\n", 355 | "r" 356 | ] 357 | }, 358 | { 359 | "cell_type": "code", 360 | "execution_count": 24, 361 | "id": "bb2ae0b3", 362 | "metadata": { 363 | "ExecuteTime": { 364 | "end_time": "2023-03-09T08:41:10.638443Z", 365 | "start_time": "2023-03-09T08:41:10.620706Z" 366 | } 367 | }, 368 | "outputs": [ 369 | { 370 | "data": { 371 | "text/plain": [ 372 | "[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]" 373 | ] 374 | }, 375 | "execution_count": 24, 376 | "metadata": {}, 377 | "output_type": "execute_result" 378 | } 379 | ], 380 | "source": [ 381 | "list(r)" 382 | ] 383 | }, 384 | { 385 | "cell_type": "code", 386 | "execution_count": null, 387 | "id": "d4d45a83", 388 | "metadata": { 389 | "ExecuteTime": { 390 | "end_time": "2023-03-09T08:37:53.903542Z", 391 | "start_time": "2023-03-09T08:37:53.903542Z" 392 | } 393 | }, 394 | "outputs": [], 395 | "source": [ 396 | "#For loop" 397 | ] 398 | }, 399 | { 400 | "cell_type": "code", 401 | "execution_count": 25, 402 | "id": "ac96a16e", 403 | "metadata": { 404 | "ExecuteTime": { 405 | "end_time": "2023-03-09T08:44:06.083018Z", 406 | "start_time": "2023-03-09T08:44:06.065840Z" 407 | } 408 | }, 409 | "outputs": [ 410 | { 411 | "name": "stdout", 412 | "output_type": "stream", 413 | "text": [ 414 | "1\n", 415 | "2\n", 416 | "3\n", 417 | "4\n", 418 | "5\n", 419 | "6\n", 420 | "7\n", 421 | "8\n", 422 | "9\n", 423 | "10\n" 424 | ] 425 | } 426 | ], 427 | "source": [ 428 | "for i in range(1,11):\n", 429 | " print(i)" 430 | ] 431 | }, 432 | { 433 | "cell_type": "code", 434 | "execution_count": 27, 435 | "id": "a983629c", 436 | "metadata": { 437 | "ExecuteTime": { 438 | "end_time": "2023-03-09T08:45:43.329098Z", 439 | "start_time": "2023-03-09T08:45:43.318730Z" 440 | } 441 | }, 442 | "outputs": [ 443 | { 444 | "name": "stdout", 445 | "output_type": "stream", 446 | "text": [ 447 | "Number was even\n", 448 | "1\n", 449 | "Number was even\n", 450 | "3\n", 451 | "Number was even\n", 452 | "5\n", 453 | "Number was even\n", 454 | "7\n", 455 | "Number was even\n", 456 | "9\n", 457 | "Number was even\n", 458 | "11\n", 459 | "Number was even\n", 460 | "13\n", 461 | "Number was even\n", 462 | "15\n", 463 | "Number was even\n", 464 | "17\n", 465 | "Number was even\n", 466 | "19\n", 467 | "Number was even\n", 468 | "21\n", 469 | "Number was even\n", 470 | "23\n", 471 | "Number was even\n", 472 | "25\n", 473 | "Number was even\n", 474 | "27\n", 475 | "Number was even\n", 476 | "29\n", 477 | "Number was even\n", 478 | "31\n", 479 | "Number was even\n", 480 | "33\n", 481 | "Number was even\n", 482 | "35\n", 483 | "Number was even\n", 484 | "37\n", 485 | "Number was even\n", 486 | "39\n", 487 | "Number was even\n", 488 | "41\n", 489 | "Number was even\n", 490 | "43\n", 491 | "Number was even\n", 492 | "45\n", 493 | "Number was even\n", 494 | "47\n", 495 | "Number was even\n", 496 | "49\n" 497 | ] 498 | } 499 | ], 500 | "source": [ 501 | "for i in range(0,50):\n", 502 | " if i%2==1:\n", 503 | " print(i)\n", 504 | " else:\n", 505 | " print('Number was even')" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "execution_count": 28, 511 | "id": "e55b50f3", 512 | "metadata": { 513 | "ExecuteTime": { 514 | "end_time": "2023-03-09T08:46:23.871967Z", 515 | "start_time": "2023-03-09T08:46:23.865657Z" 516 | } 517 | }, 518 | "outputs": [], 519 | "source": [ 520 | "#Company list\n", 521 | "company = ['amazon','flipkart','excelr']" 522 | ] 523 | }, 524 | { 525 | "cell_type": "code", 526 | "execution_count": 29, 527 | "id": "77bd1973", 528 | "metadata": { 529 | "ExecuteTime": { 530 | "end_time": "2023-03-09T08:46:56.955218Z", 531 | "start_time": "2023-03-09T08:46:56.948655Z" 532 | } 533 | }, 534 | "outputs": [ 535 | { 536 | "name": "stdout", 537 | "output_type": "stream", 538 | "text": [ 539 | "amazon\n", 540 | "flipkart\n", 541 | "excelr\n" 542 | ] 543 | } 544 | ], 545 | "source": [ 546 | "for i in company:\n", 547 | " print(i)" 548 | ] 549 | }, 550 | { 551 | "cell_type": "code", 552 | "execution_count": 30, 553 | "id": "b3893ac1", 554 | "metadata": { 555 | "ExecuteTime": { 556 | "end_time": "2023-03-09T08:48:31.205934Z", 557 | "start_time": "2023-03-09T08:48:31.185773Z" 558 | } 559 | }, 560 | "outputs": [ 561 | { 562 | "name": "stdout", 563 | "output_type": "stream", 564 | "text": [ 565 | "www.amazon.com\n", 566 | "www.flipkart.com\n", 567 | "www.excelr.com\n" 568 | ] 569 | } 570 | ], 571 | "source": [ 572 | "for i in company:\n", 573 | " print('www.'+i+'.com')" 574 | ] 575 | }, 576 | { 577 | "cell_type": "code", 578 | "execution_count": 32, 579 | "id": "88d750ca", 580 | "metadata": { 581 | "ExecuteTime": { 582 | "end_time": "2023-03-09T08:51:26.158024Z", 583 | "start_time": "2023-03-09T08:51:26.148206Z" 584 | } 585 | }, 586 | "outputs": [ 587 | { 588 | "name": "stdout", 589 | "output_type": "stream", 590 | "text": [ 591 | "1\n", 592 | "4\n", 593 | "9\n", 594 | "16\n", 595 | "25\n", 596 | "36\n", 597 | "49\n", 598 | "64\n", 599 | "81\n", 600 | "100\n" 601 | ] 602 | } 603 | ], 604 | "source": [ 605 | "#Print square of all the number in the range of 1,10\n", 606 | "\n", 607 | "for i in range(1,11):\n", 608 | " print(i**2)" 609 | ] 610 | }, 611 | { 612 | "cell_type": "code", 613 | "execution_count": 33, 614 | "id": "7c1519aa", 615 | "metadata": { 616 | "ExecuteTime": { 617 | "end_time": "2023-03-09T08:52:50.733139Z", 618 | "start_time": "2023-03-09T08:52:50.718782Z" 619 | } 620 | }, 621 | "outputs": [], 622 | "source": [ 623 | "#Store all the even numbers and odd number is separate lists\n", 624 | "even = []\n", 625 | "odd = []\n", 626 | "\n", 627 | "for i in range(1,20):\n", 628 | " if i%2==0:\n", 629 | " even.append(i)\n", 630 | " else:\n", 631 | " odd.append(i)" 632 | ] 633 | }, 634 | { 635 | "cell_type": "code", 636 | "execution_count": 34, 637 | "id": "889d770f", 638 | "metadata": { 639 | "ExecuteTime": { 640 | "end_time": "2023-03-09T08:52:53.993301Z", 641 | "start_time": "2023-03-09T08:52:53.971989Z" 642 | } 643 | }, 644 | "outputs": [ 645 | { 646 | "data": { 647 | "text/plain": [ 648 | "[2, 4, 6, 8, 10, 12, 14, 16, 18]" 649 | ] 650 | }, 651 | "execution_count": 34, 652 | "metadata": {}, 653 | "output_type": "execute_result" 654 | } 655 | ], 656 | "source": [ 657 | "even" 658 | ] 659 | }, 660 | { 661 | "cell_type": "code", 662 | "execution_count": 35, 663 | "id": "7522a3fc", 664 | "metadata": { 665 | "ExecuteTime": { 666 | "end_time": "2023-03-09T08:52:58.616106Z", 667 | "start_time": "2023-03-09T08:52:58.596371Z" 668 | } 669 | }, 670 | "outputs": [ 671 | { 672 | "data": { 673 | "text/plain": [ 674 | "[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]" 675 | ] 676 | }, 677 | "execution_count": 35, 678 | "metadata": {}, 679 | "output_type": "execute_result" 680 | } 681 | ], 682 | "source": [ 683 | "odd" 684 | ] 685 | }, 686 | { 687 | "cell_type": "markdown", 688 | "id": "4f712923", 689 | "metadata": {}, 690 | "source": [ 691 | "# In-Class Activity:\n", 692 | "\n", 693 | "1. Write a program to store all names which starts with 'A' in a list.\n", 694 | "2. Take a list of numbers and add 5 to each number.\n", 695 | "3. Create a list of marks and print only marks > 75." 696 | ] 697 | }, 698 | { 699 | "cell_type": "code", 700 | "execution_count": null, 701 | "id": "25a64994", 702 | "metadata": { 703 | "ExecuteTime": { 704 | "end_time": "2023-03-04T05:41:19.978724Z", 705 | "start_time": "2023-03-04T05:41:19.958113Z" 706 | } 707 | }, 708 | "outputs": [], 709 | "source": [] 710 | }, 711 | { 712 | "cell_type": "code", 713 | "execution_count": null, 714 | "id": "f1878f58", 715 | "metadata": { 716 | "ExecuteTime": { 717 | "end_time": "2023-03-04T05:41:33.394340Z", 718 | "start_time": "2023-03-04T05:41:33.383341Z" 719 | } 720 | }, 721 | "outputs": [], 722 | "source": [] 723 | }, 724 | { 725 | "cell_type": "code", 726 | "execution_count": null, 727 | "id": "be4d5f20", 728 | "metadata": { 729 | "ExecuteTime": { 730 | "end_time": "2023-03-04T05:42:35.920414Z", 731 | "start_time": "2023-03-04T05:42:35.906374Z" 732 | } 733 | }, 734 | "outputs": [], 735 | "source": [] 736 | }, 737 | { 738 | "cell_type": "code", 739 | "execution_count": null, 740 | "id": "77f3a4b0", 741 | "metadata": { 742 | "ExecuteTime": { 743 | "end_time": "2023-03-04T05:42:49.033068Z", 744 | "start_time": "2023-03-04T05:42:49.010728Z" 745 | } 746 | }, 747 | "outputs": [], 748 | "source": [] 749 | }, 750 | { 751 | "cell_type": "code", 752 | "execution_count": null, 753 | "id": "e56a57cb", 754 | "metadata": { 755 | "ExecuteTime": { 756 | "end_time": "2023-03-04T05:45:14.668385Z", 757 | "start_time": "2023-03-04T05:45:14.659746Z" 758 | } 759 | }, 760 | "outputs": [], 761 | "source": [] 762 | }, 763 | { 764 | "cell_type": "code", 765 | "execution_count": null, 766 | "id": "1d2b8abf", 767 | "metadata": { 768 | "ExecuteTime": { 769 | "end_time": "2023-03-04T05:45:46.727167Z", 770 | "start_time": "2023-03-04T05:45:46.716223Z" 771 | } 772 | }, 773 | "outputs": [], 774 | "source": [] 775 | }, 776 | { 777 | "cell_type": "code", 778 | "execution_count": null, 779 | "id": "8bffc7eb", 780 | "metadata": {}, 781 | "outputs": [], 782 | "source": [] 783 | } 784 | ], 785 | "metadata": { 786 | "kernelspec": { 787 | "display_name": "Python 3 (ipykernel)", 788 | "language": "python", 789 | "name": "python3" 790 | }, 791 | "language_info": { 792 | "codemirror_mode": { 793 | "name": "ipython", 794 | "version": 3 795 | }, 796 | "file_extension": ".py", 797 | "mimetype": "text/x-python", 798 | "name": "python", 799 | "nbconvert_exporter": "python", 800 | "pygments_lexer": "ipython3", 801 | "version": "3.9.13" 802 | } 803 | }, 804 | "nbformat": 4, 805 | "nbformat_minor": 5 806 | } 807 | -------------------------------------------------------------------------------- /Conditional Statements/data: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Data Visualization.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "id": "9dc7dd63-3563-4466-9824-d539f0b317c4", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import pandas as pd\n", 11 | "import matplotlib.pyplot as plt\n", 12 | "import seaborn as sns" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "id": "60cc6af4-ca47-45af-be5c-dfc0685cec6d", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "df = pd.read_excel('Employees.xlsx')\n", 23 | "df.head()" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": null, 29 | "id": "a6f7ddb0-3af7-4897-96a8-c84feb9d2ccf", 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "df.isna().sum()" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "id": "bc2f385e-ef5f-4265-91b8-222b87438b44", 39 | "metadata": {}, 40 | "source": [ 41 | "# Data Visualization\n", 42 | "1. Barplot\n", 43 | "2. Histogram\n", 44 | "3. Scatterplot\n", 45 | "4. Piechart" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "id": "673ad062-d104-4b52-ab37-c2efce24ccc2", 51 | "metadata": {}, 52 | "source": [ 53 | "# 1. Barplot" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "id": "b3124365-328b-476e-9a7c-d1702e6decd2", 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [ 63 | "df.head()" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": null, 69 | "id": "83c0a089-cc64-4d7e-abef-d546369b4d5d", 70 | "metadata": {}, 71 | "outputs": [], 72 | "source": [ 73 | "sns.countplot(df['Center'])" 74 | ] 75 | }, 76 | { 77 | "cell_type": "markdown", 78 | "id": "50211c19-c350-4070-8343-2553ceedb92a", 79 | "metadata": {}, 80 | "source": [ 81 | "# Set graph parameters" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": null, 87 | "id": "2d40cfe9-9e44-453e-904d-d3c0230a6dc2", 88 | "metadata": {}, 89 | "outputs": [], 90 | "source": [ 91 | "plt.rcParams['figure.figsize'] = (10,5)\n", 92 | "plt.rcParams['figure.dpi'] = 120\n", 93 | "sns.set_theme(style='darkgrid', palette='viridis')" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "id": "868c3d2c-cff1-4aaa-8a4b-0734140c2b9f", 100 | "metadata": {}, 101 | "outputs": [], 102 | "source": [ 103 | "sns.countplot(df['Center'])" 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": null, 109 | "id": "687e8d0a-e86d-47db-b5f7-fbcb40f66e4e", 110 | "metadata": {}, 111 | "outputs": [], 112 | "source": [ 113 | "sns.countplot(df['Country'], palette='rainbow')" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "id": "11862758-36b0-4ba8-9801-6d1295b07a8b", 120 | "metadata": {}, 121 | "outputs": [], 122 | "source": [ 123 | "sns.countplot(x = df['Years'])" 124 | ] 125 | }, 126 | { 127 | "cell_type": "markdown", 128 | "id": "22be858b-5acd-46ba-8e66-aad8ef8f2919", 129 | "metadata": {}, 130 | "source": [ 131 | "# 2. Histogram" 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": null, 137 | "id": "967d4150-342d-4fa4-8733-e1142b1f6db3", 138 | "metadata": {}, 139 | "outputs": [], 140 | "source": [ 141 | "df.head()" 142 | ] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": null, 147 | "id": "598d1f86-386a-4075-af13-b03e9cc0ef06", 148 | "metadata": {}, 149 | "outputs": [], 150 | "source": [ 151 | "sns.histplot(df['Monthly Salary'])" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": null, 157 | "id": "6028a7b3-4058-4578-b9e7-ad337bff1c0e", 158 | "metadata": {}, 159 | "outputs": [], 160 | "source": [ 161 | "sns.histplot(df['Annual Salary'])" 162 | ] 163 | }, 164 | { 165 | "cell_type": "markdown", 166 | "id": "3632f19f-0374-4016-9609-d3ae32411a9a", 167 | "metadata": {}, 168 | "source": [ 169 | "# Scatterplot" 170 | ] 171 | }, 172 | { 173 | "cell_type": "code", 174 | "execution_count": null, 175 | "id": "3807b7ae-c1b9-4b12-8513-1d92c598d42b", 176 | "metadata": {}, 177 | "outputs": [], 178 | "source": [ 179 | "sns.scatterplot(x = df['Annual Salary'], y = df['Monthly Salary'])" 180 | ] 181 | }, 182 | { 183 | "cell_type": "code", 184 | "execution_count": null, 185 | "id": "0378614d-a473-442e-b4fd-be5f4a61cabb", 186 | "metadata": {}, 187 | "outputs": [], 188 | "source": [ 189 | "sns.scatterplot(x = df['Annual Salary'], y = df['Overtime Hours'])" 190 | ] 191 | }, 192 | { 193 | "cell_type": "markdown", 194 | "id": "b7c7cde9-b76e-49ca-8299-0472a63adfef", 195 | "metadata": {}, 196 | "source": [ 197 | "# PieChart" 198 | ] 199 | }, 200 | { 201 | "cell_type": "code", 202 | "execution_count": null, 203 | "id": "c0b20be6-9296-47b0-b58e-4c2b2a9d9f72", 204 | "metadata": {}, 205 | "outputs": [], 206 | "source": [ 207 | "df.head()" 208 | ] 209 | }, 210 | { 211 | "cell_type": "code", 212 | "execution_count": null, 213 | "id": "93033a71-f1bd-4a9c-95f4-48a09206ada4", 214 | "metadata": {}, 215 | "outputs": [], 216 | "source": [ 217 | "gender_values = df['Gender'].value_counts()\n", 218 | "gender_values" 219 | ] 220 | }, 221 | { 222 | "cell_type": "code", 223 | "execution_count": null, 224 | "id": "1242506f-485e-47e9-bd8c-1c00625cf3e3", 225 | "metadata": {}, 226 | "outputs": [], 227 | "source": [ 228 | "plt.pie(gender_values, autopct='%0.2f%%', pctdistance=1.2)" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": null, 234 | "id": "3010189a-e02c-48fa-89fc-0dd8b3f72c05", 235 | "metadata": {}, 236 | "outputs": [], 237 | "source": [ 238 | "gender_label = ['Male','Female']\n", 239 | "\n", 240 | "plt.pie(gender_values, autopct='%0.2f%%', pctdistance=1.2)\n", 241 | "plt.legend(gender_label, loc = 'upper right')" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": null, 247 | "id": "e33bad0e-e642-4e81-bdff-39390c6175ee", 248 | "metadata": {}, 249 | "outputs": [], 250 | "source": [ 251 | "country = df['Country'].value_counts()\n", 252 | "country_labels = df['Country'].unique()\n", 253 | "\n", 254 | "plt.figure(figsize=(15,10))\n", 255 | "plt.pie(dept, autopct='%0.2f%%')\n", 256 | "plt.legend(country_labels, loc = 'upper right')\n" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": null, 262 | "id": "a431d074-c475-4624-8b47-cc0ed4a6284c", 263 | "metadata": {}, 264 | "outputs": [], 265 | "source": [] 266 | } 267 | ], 268 | "metadata": { 269 | "kernelspec": { 270 | "display_name": "Python 3 (ipykernel)", 271 | "language": "python", 272 | "name": "python3" 273 | }, 274 | "language_info": { 275 | "codemirror_mode": { 276 | "name": "ipython", 277 | "version": 3 278 | }, 279 | "file_extension": ".py", 280 | "mimetype": "text/x-python", 281 | "name": "python", 282 | "nbconvert_exporter": "python", 283 | "pygments_lexer": "ipython3", 284 | "version": "3.12.4" 285 | } 286 | }, 287 | "nbformat": 4, 288 | "nbformat_minor": 5 289 | } 290 | -------------------------------------------------------------------------------- /Employees.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aishwaryamate/Python/fa96f2c99f65f213f580f17e31ce784a285c2693/Employees.xlsx -------------------------------------------------------------------------------- /Numpy/Numpy.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "b6c55a1c", 6 | "metadata": {}, 7 | "source": [ 8 | "# Numpy\n", 9 | "\n", 10 | "- NumPy is a general-purpose array-processing package.\n", 11 | "- Numpy was created to work with multidmensional arrays.\n", 12 | "- It is the fundamental package for scientific computing with Python.\n", 13 | "- It is open-source library." 14 | ] 15 | }, 16 | { 17 | "cell_type": "markdown", 18 | "id": "aa77efd3", 19 | "metadata": {}, 20 | "source": [ 21 | "# Why Use NumPy?\n", 22 | "- In Python we have lists that serve the purpose of arrays, but they are slow to process.\n", 23 | "\n", 24 | "- NumPy aims to provide an array object that is up to 50x faster than traditional Python lists.\n", 25 | "\n", 26 | "- The array object in NumPy is called ndarray, it provides a lot of supporting functions that make working with ndarray very easy.\n", 27 | "\n", 28 | "- Arrays are very frequently used in data science, where speed and resources are very important." 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": 2, 34 | "id": "d1adccfe", 35 | "metadata": { 36 | "ExecuteTime": { 37 | "end_time": "2022-11-29T04:50:05.591487Z", 38 | "start_time": "2022-11-29T04:50:01.611124Z" 39 | } 40 | }, 41 | "outputs": [ 42 | { 43 | "name": "stdout", 44 | "output_type": "stream", 45 | "text": [ 46 | "Requirement already satisfied: numpy in c:\\users\\aishwarya\\anaconda3\\lib\\site-packages (1.21.5)\n" 47 | ] 48 | } 49 | ], 50 | "source": [ 51 | "#Importing necessary library\n", 52 | "!pip install numpy\n", 53 | "\n", 54 | "import numpy as np " 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": 5, 60 | "id": "171b2621", 61 | "metadata": { 62 | "ExecuteTime": { 63 | "end_time": "2022-11-29T04:52:33.779595Z", 64 | "start_time": "2022-11-29T04:52:33.759003Z" 65 | } 66 | }, 67 | "outputs": [ 68 | { 69 | "data": { 70 | "text/plain": [ 71 | "numpy.ndarray" 72 | ] 73 | }, 74 | "execution_count": 5, 75 | "metadata": {}, 76 | "output_type": "execute_result" 77 | } 78 | ], 79 | "source": [ 80 | "#Array Creation\n", 81 | "\n", 82 | "a = np.array(10)\n", 83 | "type(a)" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": null, 89 | "id": "ed58490f", 90 | "metadata": {}, 91 | "outputs": [], 92 | "source": [ 93 | "#Zero dimensional array" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": 7, 99 | "id": "f6b5d851", 100 | "metadata": { 101 | "ExecuteTime": { 102 | "end_time": "2022-11-29T04:53:27.634551Z", 103 | "start_time": "2022-11-29T04:53:27.612955Z" 104 | } 105 | }, 106 | "outputs": [ 107 | { 108 | "data": { 109 | "text/plain": [ 110 | "0" 111 | ] 112 | }, 113 | "execution_count": 7, 114 | "metadata": {}, 115 | "output_type": "execute_result" 116 | } 117 | ], 118 | "source": [ 119 | "z = np.array(10)\n", 120 | "\n", 121 | "z.ndim" 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "id": "33d89455", 128 | "metadata": {}, 129 | "outputs": [], 130 | "source": [ 131 | "#One dimensional array" 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": 9, 137 | "id": "cd6a7ec5", 138 | "metadata": { 139 | "ExecuteTime": { 140 | "end_time": "2022-11-29T04:53:57.966774Z", 141 | "start_time": "2022-11-29T04:53:57.949113Z" 142 | } 143 | }, 144 | "outputs": [ 145 | { 146 | "data": { 147 | "text/plain": [ 148 | "1" 149 | ] 150 | }, 151 | "execution_count": 9, 152 | "metadata": {}, 153 | "output_type": "execute_result" 154 | } 155 | ], 156 | "source": [ 157 | "o = np.array([10,12,12,15])\n", 158 | "o.ndim" 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "execution_count": null, 164 | "id": "63162fb5", 165 | "metadata": {}, 166 | "outputs": [], 167 | "source": [ 168 | "#Two dimensional array" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "execution_count": 10, 174 | "id": "f3bf75e0", 175 | "metadata": { 176 | "ExecuteTime": { 177 | "end_time": "2022-11-29T04:54:29.555570Z", 178 | "start_time": "2022-11-29T04:54:29.544825Z" 179 | } 180 | }, 181 | "outputs": [ 182 | { 183 | "data": { 184 | "text/plain": [ 185 | "2" 186 | ] 187 | }, 188 | "execution_count": 10, 189 | "metadata": {}, 190 | "output_type": "execute_result" 191 | } 192 | ], 193 | "source": [ 194 | "t = np.array([[10,10,12,14,15]])\n", 195 | "t.ndim" 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "execution_count": null, 201 | "id": "0905f753", 202 | "metadata": {}, 203 | "outputs": [], 204 | "source": [ 205 | "#Three dimensional array" 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": 11, 211 | "id": "8fc45c90", 212 | "metadata": { 213 | "ExecuteTime": { 214 | "end_time": "2022-11-29T04:55:54.666049Z", 215 | "start_time": "2022-11-29T04:55:54.650752Z" 216 | } 217 | }, 218 | "outputs": [], 219 | "source": [ 220 | "th = np.array([[[10,12,14,15,16]]])" 221 | ] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": 12, 226 | "id": "6aace275", 227 | "metadata": { 228 | "ExecuteTime": { 229 | "end_time": "2022-11-29T04:56:01.203185Z", 230 | "start_time": "2022-11-29T04:56:01.188913Z" 231 | } 232 | }, 233 | "outputs": [ 234 | { 235 | "data": { 236 | "text/plain": [ 237 | "3" 238 | ] 239 | }, 240 | "execution_count": 12, 241 | "metadata": {}, 242 | "output_type": "execute_result" 243 | } 244 | ], 245 | "source": [ 246 | "th.ndim" 247 | ] 248 | }, 249 | { 250 | "cell_type": "code", 251 | "execution_count": null, 252 | "id": "b14366dc", 253 | "metadata": {}, 254 | "outputs": [], 255 | "source": [ 256 | "#Change the data type of the array elements." 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": 15, 262 | "id": "85149403", 263 | "metadata": { 264 | "ExecuteTime": { 265 | "end_time": "2022-11-29T04:57:52.859705Z", 266 | "start_time": "2022-11-29T04:57:52.847167Z" 267 | } 268 | }, 269 | "outputs": [], 270 | "source": [ 271 | "a = np.array([10,15,52,54])" 272 | ] 273 | }, 274 | { 275 | "cell_type": "code", 276 | "execution_count": 16, 277 | "id": "7fb16796", 278 | "metadata": { 279 | "ExecuteTime": { 280 | "end_time": "2022-11-29T04:57:56.114886Z", 281 | "start_time": "2022-11-29T04:57:56.108622Z" 282 | } 283 | }, 284 | "outputs": [ 285 | { 286 | "data": { 287 | "text/plain": [ 288 | "dtype('int32')" 289 | ] 290 | }, 291 | "execution_count": 16, 292 | "metadata": {}, 293 | "output_type": "execute_result" 294 | } 295 | ], 296 | "source": [ 297 | "a.dtype" 298 | ] 299 | }, 300 | { 301 | "cell_type": "code", 302 | "execution_count": 21, 303 | "id": "afbbe1ba", 304 | "metadata": { 305 | "ExecuteTime": { 306 | "end_time": "2022-11-29T04:59:54.170835Z", 307 | "start_time": "2022-11-29T04:59:54.151760Z" 308 | } 309 | }, 310 | "outputs": [ 311 | { 312 | "name": "stdout", 313 | "output_type": "stream", 314 | "text": [ 315 | "float64\n", 316 | "hello\n" 317 | ] 318 | }, 319 | { 320 | "data": { 321 | "text/plain": [ 322 | "array([10., 15., 52., 54.])" 323 | ] 324 | }, 325 | "execution_count": 21, 326 | "metadata": {}, 327 | "output_type": "execute_result" 328 | } 329 | ], 330 | "source": [ 331 | "a = np.array([10,15,52,54], dtype = 'float')\n", 332 | "print(a.dtype)\n", 333 | "print('hello')\n", 334 | "a" 335 | ] 336 | }, 337 | { 338 | "cell_type": "markdown", 339 | "id": "2ff2c8a5", 340 | "metadata": {}, 341 | "source": [ 342 | "# Other ways of creating an array\n", 343 | "1. arange\n", 344 | "2. linspace\n", 345 | "3. zeros\n", 346 | "4. ones\n", 347 | "5. random" 348 | ] 349 | }, 350 | { 351 | "cell_type": "code", 352 | "execution_count": 25, 353 | "id": "5e2d8474", 354 | "metadata": { 355 | "ExecuteTime": { 356 | "end_time": "2022-11-29T05:03:42.370860Z", 357 | "start_time": "2022-11-29T05:03:42.352955Z" 358 | } 359 | }, 360 | "outputs": [ 361 | { 362 | "data": { 363 | "text/plain": [ 364 | "array([ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19])" 365 | ] 366 | }, 367 | "execution_count": 25, 368 | "metadata": {}, 369 | "output_type": "execute_result" 370 | } 371 | ], 372 | "source": [ 373 | "a = np.arange(1, 21, 2)\n", 374 | "a" 375 | ] 376 | }, 377 | { 378 | "cell_type": "code", 379 | "execution_count": 27, 380 | "id": "f7e04ba3", 381 | "metadata": { 382 | "ExecuteTime": { 383 | "end_time": "2022-11-29T05:06:52.583134Z", 384 | "start_time": "2022-11-29T05:06:52.562861Z" 385 | }, 386 | "scrolled": true 387 | }, 388 | "outputs": [ 389 | { 390 | "data": { 391 | "text/plain": [ 392 | "(array([1. , 1.28571429, 1.57142857, 1.85714286, 2.14285714,\n", 393 | " 2.42857143, 2.71428571, 3. , 3.28571429, 3.57142857,\n", 394 | " 3.85714286, 4.14285714, 4.42857143, 4.71428571, 5. ]),\n", 395 | " 0.2857142857142857)" 396 | ] 397 | }, 398 | "execution_count": 27, 399 | "metadata": {}, 400 | "output_type": "execute_result" 401 | } 402 | ], 403 | "source": [ 404 | "b = np.linspace(1,5,15, retstep=True)\n", 405 | "b" 406 | ] 407 | }, 408 | { 409 | "cell_type": "code", 410 | "execution_count": 29, 411 | "id": "12271dea", 412 | "metadata": { 413 | "ExecuteTime": { 414 | "end_time": "2022-11-29T05:08:21.116502Z", 415 | "start_time": "2022-11-29T05:08:21.095583Z" 416 | } 417 | }, 418 | "outputs": [ 419 | { 420 | "data": { 421 | "text/plain": [ 422 | "array([[0., 0.],\n", 423 | " [0., 0.]])" 424 | ] 425 | }, 426 | "execution_count": 29, 427 | "metadata": {}, 428 | "output_type": "execute_result" 429 | } 430 | ], 431 | "source": [ 432 | "z = np.zeros([2,2])\n", 433 | "z" 434 | ] 435 | }, 436 | { 437 | "cell_type": "code", 438 | "execution_count": 30, 439 | "id": "a805f60a", 440 | "metadata": { 441 | "ExecuteTime": { 442 | "end_time": "2022-11-29T05:08:37.156165Z", 443 | "start_time": "2022-11-29T05:08:37.141418Z" 444 | } 445 | }, 446 | "outputs": [], 447 | "source": [ 448 | "o = np.ones([5,5])" 449 | ] 450 | }, 451 | { 452 | "cell_type": "code", 453 | "execution_count": 31, 454 | "id": "f2879158", 455 | "metadata": { 456 | "ExecuteTime": { 457 | "end_time": "2022-11-29T05:08:39.897810Z", 458 | "start_time": "2022-11-29T05:08:39.880258Z" 459 | } 460 | }, 461 | "outputs": [ 462 | { 463 | "data": { 464 | "text/plain": [ 465 | "array([[1., 1., 1., 1., 1.],\n", 466 | " [1., 1., 1., 1., 1.],\n", 467 | " [1., 1., 1., 1., 1.],\n", 468 | " [1., 1., 1., 1., 1.],\n", 469 | " [1., 1., 1., 1., 1.]])" 470 | ] 471 | }, 472 | "execution_count": 31, 473 | "metadata": {}, 474 | "output_type": "execute_result" 475 | } 476 | ], 477 | "source": [ 478 | "o" 479 | ] 480 | }, 481 | { 482 | "cell_type": "code", 483 | "execution_count": 35, 484 | "id": "cc30dca0", 485 | "metadata": { 486 | "ExecuteTime": { 487 | "end_time": "2022-11-29T05:10:04.847142Z", 488 | "start_time": "2022-11-29T05:10:04.837605Z" 489 | } 490 | }, 491 | "outputs": [ 492 | { 493 | "data": { 494 | "text/plain": [ 495 | "array([[0.6057294 , 0.8043542 , 0.37853978, 0.27433185, 0.6850481 ],\n", 496 | " [0.33581904, 0.03779656, 0.54643696, 0.91952847, 0.12853788],\n", 497 | " [0.24706396, 0.59101776, 0.11368983, 0.25893676, 0.92311465],\n", 498 | " [0.76307906, 0.27715711, 0.41845894, 0.81172607, 0.41473397],\n", 499 | " [0.86638174, 0.69622015, 0.92798996, 0.34124088, 0.28769809]])" 500 | ] 501 | }, 502 | "execution_count": 35, 503 | "metadata": {}, 504 | "output_type": "execute_result" 505 | } 506 | ], 507 | "source": [ 508 | "r = np.random.rand(5,5)\n", 509 | "r" 510 | ] 511 | }, 512 | { 513 | "cell_type": "code", 514 | "execution_count": 37, 515 | "id": "9618e374", 516 | "metadata": { 517 | "ExecuteTime": { 518 | "end_time": "2022-11-29T05:12:22.867598Z", 519 | "start_time": "2022-11-29T05:12:22.859082Z" 520 | } 521 | }, 522 | "outputs": [ 523 | { 524 | "data": { 525 | "text/plain": [ 526 | "array([0, 0, 1, 2, 2, 3, 1, 0, 2, 1])" 527 | ] 528 | }, 529 | "execution_count": 37, 530 | "metadata": {}, 531 | "output_type": "execute_result" 532 | } 533 | ], 534 | "source": [ 535 | "r = np.random.randint(5, size = 10)\n", 536 | "r" 537 | ] 538 | }, 539 | { 540 | "cell_type": "markdown", 541 | "id": "fb232506", 542 | "metadata": {}, 543 | "source": [ 544 | "# Slicing and Indexing of arrays" 545 | ] 546 | }, 547 | { 548 | "cell_type": "code", 549 | "execution_count": 38, 550 | "id": "31ec533c", 551 | "metadata": { 552 | "ExecuteTime": { 553 | "end_time": "2022-11-29T05:13:19.095911Z", 554 | "start_time": "2022-11-29T05:13:19.086237Z" 555 | } 556 | }, 557 | "outputs": [], 558 | "source": [ 559 | "a = np.array([[1,2,3],[4,5,6]])" 560 | ] 561 | }, 562 | { 563 | "cell_type": "code", 564 | "execution_count": 39, 565 | "id": "47fe8a48", 566 | "metadata": { 567 | "ExecuteTime": { 568 | "end_time": "2022-11-29T05:13:28.787604Z", 569 | "start_time": "2022-11-29T05:13:28.780591Z" 570 | } 571 | }, 572 | "outputs": [ 573 | { 574 | "data": { 575 | "text/plain": [ 576 | "array([[1, 2, 3],\n", 577 | " [4, 5, 6]])" 578 | ] 579 | }, 580 | "execution_count": 39, 581 | "metadata": {}, 582 | "output_type": "execute_result" 583 | } 584 | ], 585 | "source": [ 586 | "a" 587 | ] 588 | }, 589 | { 590 | "cell_type": "code", 591 | "execution_count": 40, 592 | "id": "4fa2ded3", 593 | "metadata": { 594 | "ExecuteTime": { 595 | "end_time": "2022-11-29T05:16:45.616483Z", 596 | "start_time": "2022-11-29T05:16:45.602524Z" 597 | } 598 | }, 599 | "outputs": [ 600 | { 601 | "data": { 602 | "text/plain": [ 603 | "1" 604 | ] 605 | }, 606 | "execution_count": 40, 607 | "metadata": {}, 608 | "output_type": "execute_result" 609 | } 610 | ], 611 | "source": [ 612 | "a[0,0]" 613 | ] 614 | }, 615 | { 616 | "cell_type": "code", 617 | "execution_count": 41, 618 | "id": "12788d97", 619 | "metadata": { 620 | "ExecuteTime": { 621 | "end_time": "2022-11-29T05:17:03.422151Z", 622 | "start_time": "2022-11-29T05:17:03.409141Z" 623 | } 624 | }, 625 | "outputs": [ 626 | { 627 | "data": { 628 | "text/plain": [ 629 | "6" 630 | ] 631 | }, 632 | "execution_count": 41, 633 | "metadata": {}, 634 | "output_type": "execute_result" 635 | } 636 | ], 637 | "source": [ 638 | "a[1,2]" 639 | ] 640 | }, 641 | { 642 | "cell_type": "code", 643 | "execution_count": 48, 644 | "id": "32842007", 645 | "metadata": { 646 | "ExecuteTime": { 647 | "end_time": "2022-11-29T05:26:16.854287Z", 648 | "start_time": "2022-11-29T05:26:16.843129Z" 649 | } 650 | }, 651 | "outputs": [ 652 | { 653 | "data": { 654 | "text/plain": [ 655 | "array([[1, 2, 3],\n", 656 | " [4, 5, 6]])" 657 | ] 658 | }, 659 | "execution_count": 48, 660 | "metadata": {}, 661 | "output_type": "execute_result" 662 | } 663 | ], 664 | "source": [ 665 | "a" 666 | ] 667 | }, 668 | { 669 | "cell_type": "code", 670 | "execution_count": 42, 671 | "id": "a9e56f2a", 672 | "metadata": { 673 | "ExecuteTime": { 674 | "end_time": "2022-11-29T05:17:37.376830Z", 675 | "start_time": "2022-11-29T05:17:37.368827Z" 676 | } 677 | }, 678 | "outputs": [ 679 | { 680 | "data": { 681 | "text/plain": [ 682 | "array([2, 3])" 683 | ] 684 | }, 685 | "execution_count": 42, 686 | "metadata": {}, 687 | "output_type": "execute_result" 688 | } 689 | ], 690 | "source": [ 691 | "a[0,1:]" 692 | ] 693 | }, 694 | { 695 | "cell_type": "code", 696 | "execution_count": 43, 697 | "id": "89729aad", 698 | "metadata": { 699 | "ExecuteTime": { 700 | "end_time": "2022-11-29T05:18:26.512850Z", 701 | "start_time": "2022-11-29T05:18:26.504182Z" 702 | } 703 | }, 704 | "outputs": [ 705 | { 706 | "data": { 707 | "text/plain": [ 708 | "array([[2, 3],\n", 709 | " [5, 6]])" 710 | ] 711 | }, 712 | "execution_count": 43, 713 | "metadata": {}, 714 | "output_type": "execute_result" 715 | } 716 | ], 717 | "source": [ 718 | "a[0:,1:]" 719 | ] 720 | }, 721 | { 722 | "cell_type": "code", 723 | "execution_count": 44, 724 | "id": "f4332808", 725 | "metadata": { 726 | "ExecuteTime": { 727 | "end_time": "2022-11-29T05:18:43.292979Z", 728 | "start_time": "2022-11-29T05:18:43.272876Z" 729 | } 730 | }, 731 | "outputs": [ 732 | { 733 | "data": { 734 | "text/plain": [ 735 | "array([[1, 2, 3],\n", 736 | " [4, 5, 6]])" 737 | ] 738 | }, 739 | "execution_count": 44, 740 | "metadata": {}, 741 | "output_type": "execute_result" 742 | } 743 | ], 744 | "source": [ 745 | "a" 746 | ] 747 | }, 748 | { 749 | "cell_type": "code", 750 | "execution_count": 45, 751 | "id": "d3cd476b", 752 | "metadata": { 753 | "ExecuteTime": { 754 | "end_time": "2022-11-29T05:20:02.672925Z", 755 | "start_time": "2022-11-29T05:20:02.659318Z" 756 | } 757 | }, 758 | "outputs": [ 759 | { 760 | "data": { 761 | "text/plain": [ 762 | "array([1, 6])" 763 | ] 764 | }, 765 | "execution_count": 45, 766 | "metadata": {}, 767 | "output_type": "execute_result" 768 | } 769 | ], 770 | "source": [ 771 | "#1 and 6\n", 772 | "a[[0,1],[0,2]]" 773 | ] 774 | }, 775 | { 776 | "cell_type": "code", 777 | "execution_count": 47, 778 | "id": "eb57de31", 779 | "metadata": { 780 | "ExecuteTime": { 781 | "end_time": "2022-11-29T05:20:55.128045Z", 782 | "start_time": "2022-11-29T05:20:55.121528Z" 783 | } 784 | }, 785 | "outputs": [ 786 | { 787 | "data": { 788 | "text/plain": [ 789 | "array([3, 4])" 790 | ] 791 | }, 792 | "execution_count": 47, 793 | "metadata": {}, 794 | "output_type": "execute_result" 795 | } 796 | ], 797 | "source": [ 798 | "#3 and 4\n", 799 | "\n", 800 | "a[[0,1],[2,0]]" 801 | ] 802 | }, 803 | { 804 | "cell_type": "markdown", 805 | "id": "57bb1165", 806 | "metadata": {}, 807 | "source": [ 808 | "# Reshaping the arrays " 809 | ] 810 | }, 811 | { 812 | "cell_type": "code", 813 | "execution_count": 49, 814 | "id": "2834e07a", 815 | "metadata": { 816 | "ExecuteTime": { 817 | "end_time": "2022-11-29T05:30:31.046694Z", 818 | "start_time": "2022-11-29T05:30:31.034598Z" 819 | } 820 | }, 821 | "outputs": [], 822 | "source": [ 823 | "a = np.random.rand(5,2)" 824 | ] 825 | }, 826 | { 827 | "cell_type": "code", 828 | "execution_count": 50, 829 | "id": "9e1b54f2", 830 | "metadata": { 831 | "ExecuteTime": { 832 | "end_time": "2022-11-29T05:30:33.475772Z", 833 | "start_time": "2022-11-29T05:30:33.456623Z" 834 | } 835 | }, 836 | "outputs": [ 837 | { 838 | "data": { 839 | "text/plain": [ 840 | "array([[0.57491324, 0.67660342],\n", 841 | " [0.19094759, 0.90785905],\n", 842 | " [0.57091154, 0.27179587],\n", 843 | " [0.58828599, 0.44915594],\n", 844 | " [0.20740153, 0.12124909]])" 845 | ] 846 | }, 847 | "execution_count": 50, 848 | "metadata": {}, 849 | "output_type": "execute_result" 850 | } 851 | ], 852 | "source": [ 853 | "a" 854 | ] 855 | }, 856 | { 857 | "cell_type": "code", 858 | "execution_count": 53, 859 | "id": "7d69fcc6", 860 | "metadata": { 861 | "ExecuteTime": { 862 | "end_time": "2022-11-29T05:31:52.889824Z", 863 | "start_time": "2022-11-29T05:31:52.870007Z" 864 | } 865 | }, 866 | "outputs": [ 867 | { 868 | "data": { 869 | "text/plain": [ 870 | "array([[0.57491324, 0.67660342, 0.19094759, 0.90785905, 0.57091154],\n", 871 | " [0.27179587, 0.58828599, 0.44915594, 0.20740153, 0.12124909]])" 872 | ] 873 | }, 874 | "execution_count": 53, 875 | "metadata": {}, 876 | "output_type": "execute_result" 877 | } 878 | ], 879 | "source": [ 880 | "a.reshape(2,5)" 881 | ] 882 | }, 883 | { 884 | "cell_type": "code", 885 | "execution_count": 54, 886 | "id": "8234d794", 887 | "metadata": { 888 | "ExecuteTime": { 889 | "end_time": "2022-11-29T05:31:59.138023Z", 890 | "start_time": "2022-11-29T05:31:59.127494Z" 891 | } 892 | }, 893 | "outputs": [ 894 | { 895 | "data": { 896 | "text/plain": [ 897 | "array([[0.57491324],\n", 898 | " [0.67660342],\n", 899 | " [0.19094759],\n", 900 | " [0.90785905],\n", 901 | " [0.57091154],\n", 902 | " [0.27179587],\n", 903 | " [0.58828599],\n", 904 | " [0.44915594],\n", 905 | " [0.20740153],\n", 906 | " [0.12124909]])" 907 | ] 908 | }, 909 | "execution_count": 54, 910 | "metadata": {}, 911 | "output_type": "execute_result" 912 | } 913 | ], 914 | "source": [ 915 | "a.reshape(10,1)" 916 | ] 917 | }, 918 | { 919 | "cell_type": "code", 920 | "execution_count": 56, 921 | "id": "e1cc7e02", 922 | "metadata": { 923 | "ExecuteTime": { 924 | "end_time": "2022-11-29T05:32:20.778678Z", 925 | "start_time": "2022-11-29T05:32:20.764234Z" 926 | } 927 | }, 928 | "outputs": [ 929 | { 930 | "data": { 931 | "text/plain": [ 932 | "array([[0.57491324, 0.67660342, 0.19094759, 0.90785905, 0.57091154,\n", 933 | " 0.27179587, 0.58828599, 0.44915594, 0.20740153, 0.12124909]])" 934 | ] 935 | }, 936 | "execution_count": 56, 937 | "metadata": {}, 938 | "output_type": "execute_result" 939 | } 940 | ], 941 | "source": [ 942 | "a.reshape(1,10)" 943 | ] 944 | }, 945 | { 946 | "cell_type": "code", 947 | "execution_count": 57, 948 | "id": "5a89a577", 949 | "metadata": { 950 | "ExecuteTime": { 951 | "end_time": "2022-11-29T05:34:04.703740Z", 952 | "start_time": "2022-11-29T05:34:04.689128Z" 953 | } 954 | }, 955 | "outputs": [ 956 | { 957 | "data": { 958 | "text/plain": [ 959 | "array([[0.57491324, 0.67660342],\n", 960 | " [0.19094759, 0.90785905],\n", 961 | " [0.57091154, 0.27179587],\n", 962 | " [0.58828599, 0.44915594],\n", 963 | " [0.20740153, 0.12124909]])" 964 | ] 965 | }, 966 | "execution_count": 57, 967 | "metadata": {}, 968 | "output_type": "execute_result" 969 | } 970 | ], 971 | "source": [ 972 | "a.reshape(5,-1)" 973 | ] 974 | }, 975 | { 976 | "cell_type": "markdown", 977 | "id": "3bdf9c2b", 978 | "metadata": {}, 979 | "source": [ 980 | "# Aggregate Functions\n", 981 | "\n", 982 | "- The Python numpy aggregate functions are sum, min, max, mean, average, product, median, standard deviation, variance, percentile, and corrcoef." 983 | ] 984 | }, 985 | { 986 | "cell_type": "code", 987 | "execution_count": 60, 988 | "id": "bbff223c", 989 | "metadata": { 990 | "ExecuteTime": { 991 | "end_time": "2022-11-29T05:36:29.698664Z", 992 | "start_time": "2022-11-29T05:36:29.684740Z" 993 | } 994 | }, 995 | "outputs": [ 996 | { 997 | "data": { 998 | "text/plain": [ 999 | "0.12124909445357712" 1000 | ] 1001 | }, 1002 | "execution_count": 60, 1003 | "metadata": {}, 1004 | "output_type": "execute_result" 1005 | } 1006 | ], 1007 | "source": [ 1008 | "a.min()" 1009 | ] 1010 | }, 1011 | { 1012 | "cell_type": "code", 1013 | "execution_count": 61, 1014 | "id": "901a98ac", 1015 | "metadata": { 1016 | "ExecuteTime": { 1017 | "end_time": "2022-11-29T05:36:40.350951Z", 1018 | "start_time": "2022-11-29T05:36:40.339356Z" 1019 | } 1020 | }, 1021 | "outputs": [ 1022 | { 1023 | "data": { 1024 | "text/plain": [ 1025 | "0.23995356743233057" 1026 | ] 1027 | }, 1028 | "execution_count": 61, 1029 | "metadata": {}, 1030 | "output_type": "execute_result" 1031 | } 1032 | ], 1033 | "source": [ 1034 | "a.std()" 1035 | ] 1036 | }, 1037 | { 1038 | "cell_type": "code", 1039 | "execution_count": 62, 1040 | "id": "1a74f686", 1041 | "metadata": { 1042 | "ExecuteTime": { 1043 | "end_time": "2022-11-29T05:36:45.475682Z", 1044 | "start_time": "2022-11-29T05:36:45.467156Z" 1045 | } 1046 | }, 1047 | "outputs": [ 1048 | { 1049 | "data": { 1050 | "text/plain": [ 1051 | "0.05757771452350201" 1052 | ] 1053 | }, 1054 | "execution_count": 62, 1055 | "metadata": {}, 1056 | "output_type": "execute_result" 1057 | } 1058 | ], 1059 | "source": [ 1060 | "a.var()" 1061 | ] 1062 | }, 1063 | { 1064 | "cell_type": "code", 1065 | "execution_count": 63, 1066 | "id": "d2a2c5d9", 1067 | "metadata": { 1068 | "ExecuteTime": { 1069 | "end_time": "2022-11-29T05:36:54.323191Z", 1070 | "start_time": "2022-11-29T05:36:54.304872Z" 1071 | } 1072 | }, 1073 | "outputs": [ 1074 | { 1075 | "data": { 1076 | "text/plain": [ 1077 | "0.45591232696002243" 1078 | ] 1079 | }, 1080 | "execution_count": 63, 1081 | "metadata": {}, 1082 | "output_type": "execute_result" 1083 | } 1084 | ], 1085 | "source": [ 1086 | "a.mean()" 1087 | ] 1088 | }, 1089 | { 1090 | "cell_type": "markdown", 1091 | "id": "f5a64e45", 1092 | "metadata": {}, 1093 | "source": [ 1094 | "# Stacking \n", 1095 | "- Stacking is used to join 2 different arrays.\n", 1096 | "- Vertical stacking\n", 1097 | "- Horizontal stacking" 1098 | ] 1099 | }, 1100 | { 1101 | "cell_type": "code", 1102 | "execution_count": 64, 1103 | "id": "2cc2ea35", 1104 | "metadata": { 1105 | "ExecuteTime": { 1106 | "end_time": "2022-11-29T05:39:50.978674Z", 1107 | "start_time": "2022-11-29T05:39:50.969550Z" 1108 | } 1109 | }, 1110 | "outputs": [], 1111 | "source": [ 1112 | "a = np.array([1,2,3,4,5])\n", 1113 | "b = np.array([4,5,6,8,7])" 1114 | ] 1115 | }, 1116 | { 1117 | "cell_type": "code", 1118 | "execution_count": 66, 1119 | "id": "7af3fa15", 1120 | "metadata": { 1121 | "ExecuteTime": { 1122 | "end_time": "2022-11-29T05:40:05.947809Z", 1123 | "start_time": "2022-11-29T05:40:05.938976Z" 1124 | } 1125 | }, 1126 | "outputs": [ 1127 | { 1128 | "data": { 1129 | "text/plain": [ 1130 | "array([1, 2, 3, 4, 5, 4, 5, 6, 8, 7])" 1131 | ] 1132 | }, 1133 | "execution_count": 66, 1134 | "metadata": {}, 1135 | "output_type": "execute_result" 1136 | } 1137 | ], 1138 | "source": [ 1139 | "np.hstack([a,b])" 1140 | ] 1141 | }, 1142 | { 1143 | "cell_type": "code", 1144 | "execution_count": 68, 1145 | "id": "fda110d8", 1146 | "metadata": { 1147 | "ExecuteTime": { 1148 | "end_time": "2022-11-29T05:40:40.279680Z", 1149 | "start_time": "2022-11-29T05:40:40.259612Z" 1150 | } 1151 | }, 1152 | "outputs": [ 1153 | { 1154 | "data": { 1155 | "text/plain": [ 1156 | "array([[1, 2, 3, 4, 5],\n", 1157 | " [4, 5, 6, 8, 7]])" 1158 | ] 1159 | }, 1160 | "execution_count": 68, 1161 | "metadata": {}, 1162 | "output_type": "execute_result" 1163 | } 1164 | ], 1165 | "source": [ 1166 | "np.vstack([a,b])" 1167 | ] 1168 | }, 1169 | { 1170 | "cell_type": "code", 1171 | "execution_count": null, 1172 | "id": "f04c6183", 1173 | "metadata": {}, 1174 | "outputs": [], 1175 | "source": [] 1176 | } 1177 | ], 1178 | "metadata": { 1179 | "_draft": { 1180 | "nbviewer_url": "https://gist.github.com/21c911ff193396ba12c34a5385ab8119" 1181 | }, 1182 | "gist": { 1183 | "data": { 1184 | "description": "ExcelR/Numpy.ipynb", 1185 | "public": true 1186 | }, 1187 | "id": "21c911ff193396ba12c34a5385ab8119" 1188 | }, 1189 | "kernelspec": { 1190 | "display_name": "Python 3 (ipykernel)", 1191 | "language": "python", 1192 | "name": "python3" 1193 | }, 1194 | "language_info": { 1195 | "codemirror_mode": { 1196 | "name": "ipython", 1197 | "version": 3 1198 | }, 1199 | "file_extension": ".py", 1200 | "mimetype": "text/x-python", 1201 | "name": "python", 1202 | "nbconvert_exporter": "python", 1203 | "pygments_lexer": "ipython3", 1204 | "version": "3.9.13" 1205 | } 1206 | }, 1207 | "nbformat": 4, 1208 | "nbformat_minor": 5 1209 | } 1210 | -------------------------------------------------------------------------------- /Python_Basics/PythonBasics.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "e4d1a026", 6 | "metadata": {}, 7 | "source": [ 8 | "# Basic Operations in Python" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "2b985c75", 15 | "metadata": { 16 | "ExecuteTime": { 17 | "end_time": "2023-01-31T12:04:00.926982Z", 18 | "start_time": "2023-01-31T12:04:00.886358Z" 19 | } 20 | }, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/plain": [ 25 | "10" 26 | ] 27 | }, 28 | "execution_count": 1, 29 | "metadata": {}, 30 | "output_type": "execute_result" 31 | } 32 | ], 33 | "source": [ 34 | "#variable\n", 35 | "10" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "id": "e74d253f", 42 | "metadata": { 43 | "ExecuteTime": { 44 | "end_time": "2023-01-30T16:28:25.807355Z", 45 | "start_time": "2023-01-30T16:28:25.795121Z" 46 | } 47 | }, 48 | "outputs": [], 49 | "source": [ 50 | "#Arithmetic operators (+,-,*,/,%)" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 2, 56 | "id": "60a25df8", 57 | "metadata": { 58 | "ExecuteTime": { 59 | "end_time": "2023-01-31T12:05:20.233288Z", 60 | "start_time": "2023-01-31T12:05:20.213145Z" 61 | } 62 | }, 63 | "outputs": [], 64 | "source": [ 65 | "a = 10" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 3, 71 | "id": "eea24328", 72 | "metadata": { 73 | "ExecuteTime": { 74 | "end_time": "2023-01-31T12:05:39.010060Z", 75 | "start_time": "2023-01-31T12:05:38.997801Z" 76 | } 77 | }, 78 | "outputs": [ 79 | { 80 | "data": { 81 | "text/plain": [ 82 | "10" 83 | ] 84 | }, 85 | "execution_count": 3, 86 | "metadata": {}, 87 | "output_type": "execute_result" 88 | } 89 | ], 90 | "source": [ 91 | "a" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": 4, 97 | "id": "2170ef19", 98 | "metadata": { 99 | "ExecuteTime": { 100 | "end_time": "2023-01-31T12:06:49.785511Z", 101 | "start_time": "2023-01-31T12:06:49.770906Z" 102 | } 103 | }, 104 | "outputs": [ 105 | { 106 | "data": { 107 | "text/plain": [ 108 | "30" 109 | ] 110 | }, 111 | "execution_count": 4, 112 | "metadata": {}, 113 | "output_type": "execute_result" 114 | } 115 | ], 116 | "source": [ 117 | "a + 20" 118 | ] 119 | }, 120 | { 121 | "cell_type": "code", 122 | "execution_count": 6, 123 | "id": "2cad6aeb", 124 | "metadata": { 125 | "ExecuteTime": { 126 | "end_time": "2023-01-31T12:07:13.226607Z", 127 | "start_time": "2023-01-31T12:07:13.212600Z" 128 | } 129 | }, 130 | "outputs": [ 131 | { 132 | "data": { 133 | "text/plain": [ 134 | "30" 135 | ] 136 | }, 137 | "execution_count": 6, 138 | "metadata": {}, 139 | "output_type": "execute_result" 140 | } 141 | ], 142 | "source": [ 143 | "b = a + 20\n", 144 | "b" 145 | ] 146 | }, 147 | { 148 | "cell_type": "code", 149 | "execution_count": 7, 150 | "id": "b9482fb8", 151 | "metadata": { 152 | "ExecuteTime": { 153 | "end_time": "2023-01-31T12:07:27.878648Z", 154 | "start_time": "2023-01-31T12:07:27.869821Z" 155 | } 156 | }, 157 | "outputs": [ 158 | { 159 | "data": { 160 | "text/plain": [ 161 | "0.2" 162 | ] 163 | }, 164 | "execution_count": 7, 165 | "metadata": {}, 166 | "output_type": "execute_result" 167 | } 168 | ], 169 | "source": [ 170 | "a = 2\n", 171 | "b = 10\n", 172 | "\n", 173 | "a/b" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": 8, 179 | "id": "e0febe9d", 180 | "metadata": { 181 | "ExecuteTime": { 182 | "end_time": "2023-01-31T12:07:33.722873Z", 183 | "start_time": "2023-01-31T12:07:33.709998Z" 184 | } 185 | }, 186 | "outputs": [ 187 | { 188 | "data": { 189 | "text/plain": [ 190 | "2" 191 | ] 192 | }, 193 | "execution_count": 8, 194 | "metadata": {}, 195 | "output_type": "execute_result" 196 | } 197 | ], 198 | "source": [ 199 | "a%b" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": 9, 205 | "id": "fe3c4944", 206 | "metadata": { 207 | "ExecuteTime": { 208 | "end_time": "2023-01-31T12:08:53.838176Z", 209 | "start_time": "2023-01-31T12:08:53.818915Z" 210 | } 211 | }, 212 | "outputs": [ 213 | { 214 | "data": { 215 | "text/plain": [ 216 | "int" 217 | ] 218 | }, 219 | "execution_count": 9, 220 | "metadata": {}, 221 | "output_type": "execute_result" 222 | } 223 | ], 224 | "source": [ 225 | "type(a)" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": 12, 231 | "id": "664c2728", 232 | "metadata": { 233 | "ExecuteTime": { 234 | "end_time": "2023-01-31T12:10:55.687615Z", 235 | "start_time": "2023-01-31T12:10:55.671576Z" 236 | } 237 | }, 238 | "outputs": [ 239 | { 240 | "data": { 241 | "text/plain": [ 242 | "52" 243 | ] 244 | }, 245 | "execution_count": 12, 246 | "metadata": {}, 247 | "output_type": "execute_result" 248 | } 249 | ], 250 | "source": [ 251 | "#Single line comment\n", 252 | "#This is first line\n", 253 | "# this is second line\n", 254 | "\n", 255 | "\n", 256 | "a + 50" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": 13, 262 | "id": "159d6f1b", 263 | "metadata": { 264 | "ExecuteTime": { 265 | "end_time": "2023-01-31T12:11:40.227556Z", 266 | "start_time": "2023-01-31T12:11:40.210506Z" 267 | } 268 | }, 269 | "outputs": [ 270 | { 271 | "data": { 272 | "text/plain": [ 273 | "'This is first line\\nThis is second line'" 274 | ] 275 | }, 276 | "execution_count": 13, 277 | "metadata": {}, 278 | "output_type": "execute_result" 279 | } 280 | ], 281 | "source": [ 282 | "#Multi-line comment\n", 283 | "'''This is first line\n", 284 | "This is second line'''" 285 | ] 286 | }, 287 | { 288 | "cell_type": "markdown", 289 | "id": "72a732b2", 290 | "metadata": {}, 291 | "source": [ 292 | "# Data types in python\n", 293 | "1. Integer\n", 294 | "2. Float\n", 295 | "3. String\n", 296 | "4. Boolean" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "execution_count": 14, 302 | "id": "85545b8e", 303 | "metadata": { 304 | "ExecuteTime": { 305 | "end_time": "2023-01-31T12:13:31.743018Z", 306 | "start_time": "2023-01-31T12:13:31.725794Z" 307 | } 308 | }, 309 | "outputs": [ 310 | { 311 | "data": { 312 | "text/plain": [ 313 | "int" 314 | ] 315 | }, 316 | "execution_count": 14, 317 | "metadata": {}, 318 | "output_type": "execute_result" 319 | } 320 | ], 321 | "source": [ 322 | "#Integer\n", 323 | "a = 10\n", 324 | "type(a)" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": 15, 330 | "id": "bdc54922", 331 | "metadata": { 332 | "ExecuteTime": { 333 | "end_time": "2023-01-31T12:13:47.343850Z", 334 | "start_time": "2023-01-31T12:13:47.335098Z" 335 | } 336 | }, 337 | "outputs": [ 338 | { 339 | "data": { 340 | "text/plain": [ 341 | "float" 342 | ] 343 | }, 344 | "execution_count": 15, 345 | "metadata": {}, 346 | "output_type": "execute_result" 347 | } 348 | ], 349 | "source": [ 350 | "b = 50.2\n", 351 | "type(b)" 352 | ] 353 | }, 354 | { 355 | "cell_type": "code", 356 | "execution_count": 18, 357 | "id": "9b89cdbe", 358 | "metadata": { 359 | "ExecuteTime": { 360 | "end_time": "2023-01-31T12:15:00.249970Z", 361 | "start_time": "2023-01-31T12:15:00.241348Z" 362 | } 363 | }, 364 | "outputs": [ 365 | { 366 | "data": { 367 | "text/plain": [ 368 | "'This is python'" 369 | ] 370 | }, 371 | "execution_count": 18, 372 | "metadata": {}, 373 | "output_type": "execute_result" 374 | } 375 | ], 376 | "source": [ 377 | "s = 'This is python'\n", 378 | "s" 379 | ] 380 | }, 381 | { 382 | "cell_type": "code", 383 | "execution_count": 19, 384 | "id": "95adac3a", 385 | "metadata": { 386 | "ExecuteTime": { 387 | "end_time": "2023-01-31T12:15:09.033589Z", 388 | "start_time": "2023-01-31T12:15:09.022606Z" 389 | } 390 | }, 391 | "outputs": [ 392 | { 393 | "data": { 394 | "text/plain": [ 395 | "str" 396 | ] 397 | }, 398 | "execution_count": 19, 399 | "metadata": {}, 400 | "output_type": "execute_result" 401 | } 402 | ], 403 | "source": [ 404 | "type(s)" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": 22, 410 | "id": "6e6af3e1", 411 | "metadata": { 412 | "ExecuteTime": { 413 | "end_time": "2023-01-31T12:16:38.328358Z", 414 | "start_time": "2023-01-31T12:16:38.310313Z" 415 | } 416 | }, 417 | "outputs": [], 418 | "source": [ 419 | "b = True" 420 | ] 421 | }, 422 | { 423 | "cell_type": "code", 424 | "execution_count": 23, 425 | "id": "2591c116", 426 | "metadata": { 427 | "ExecuteTime": { 428 | "end_time": "2023-01-31T12:16:45.167324Z", 429 | "start_time": "2023-01-31T12:16:45.159015Z" 430 | } 431 | }, 432 | "outputs": [ 433 | { 434 | "data": { 435 | "text/plain": [ 436 | "bool" 437 | ] 438 | }, 439 | "execution_count": 23, 440 | "metadata": {}, 441 | "output_type": "execute_result" 442 | } 443 | ], 444 | "source": [ 445 | "type(b)" 446 | ] 447 | }, 448 | { 449 | "cell_type": "markdown", 450 | "id": "6c46cfad", 451 | "metadata": {}, 452 | "source": [ 453 | "# Typecasting\n", 454 | "\n", 455 | "- Typecasting is used to change the data types." 456 | ] 457 | }, 458 | { 459 | "cell_type": "code", 460 | "execution_count": 28, 461 | "id": "99f56053", 462 | "metadata": { 463 | "ExecuteTime": { 464 | "end_time": "2023-01-31T12:21:35.462306Z", 465 | "start_time": "2023-01-31T12:21:35.438060Z" 466 | } 467 | }, 468 | "outputs": [ 469 | { 470 | "data": { 471 | "text/plain": [ 472 | "int" 473 | ] 474 | }, 475 | "execution_count": 28, 476 | "metadata": {}, 477 | "output_type": "execute_result" 478 | } 479 | ], 480 | "source": [ 481 | "x = 10\n", 482 | "type(x)" 483 | ] 484 | }, 485 | { 486 | "cell_type": "code", 487 | "execution_count": 30, 488 | "id": "af76e562", 489 | "metadata": { 490 | "ExecuteTime": { 491 | "end_time": "2023-01-31T12:21:49.176809Z", 492 | "start_time": "2023-01-31T12:21:49.157138Z" 493 | } 494 | }, 495 | "outputs": [ 496 | { 497 | "data": { 498 | "text/plain": [ 499 | "float" 500 | ] 501 | }, 502 | "execution_count": 30, 503 | "metadata": {}, 504 | "output_type": "execute_result" 505 | } 506 | ], 507 | "source": [ 508 | "x = float(x)\n", 509 | "type(x)" 510 | ] 511 | }, 512 | { 513 | "cell_type": "code", 514 | "execution_count": 27, 515 | "id": "f2fcb76c", 516 | "metadata": { 517 | "ExecuteTime": { 518 | "end_time": "2023-01-31T12:20:21.017882Z", 519 | "start_time": "2023-01-31T12:20:21.008432Z" 520 | } 521 | }, 522 | "outputs": [ 523 | { 524 | "data": { 525 | "text/plain": [ 526 | "'10.0'" 527 | ] 528 | }, 529 | "execution_count": 27, 530 | "metadata": {}, 531 | "output_type": "execute_result" 532 | } 533 | ], 534 | "source": [ 535 | "str(x)" 536 | ] 537 | }, 538 | { 539 | "cell_type": "code", 540 | "execution_count": 31, 541 | "id": "4f7ad132", 542 | "metadata": { 543 | "ExecuteTime": { 544 | "end_time": "2023-01-31T12:21:50.949508Z", 545 | "start_time": "2023-01-31T12:21:50.933163Z" 546 | } 547 | }, 548 | "outputs": [ 549 | { 550 | "data": { 551 | "text/plain": [ 552 | "float" 553 | ] 554 | }, 555 | "execution_count": 31, 556 | "metadata": {}, 557 | "output_type": "execute_result" 558 | } 559 | ], 560 | "source": [ 561 | "type(x)" 562 | ] 563 | }, 564 | { 565 | "cell_type": "code", 566 | "execution_count": 36, 567 | "id": "660cab1c", 568 | "metadata": { 569 | "ExecuteTime": { 570 | "end_time": "2023-01-31T12:23:39.327217Z", 571 | "start_time": "2023-01-31T12:23:39.315553Z" 572 | } 573 | }, 574 | "outputs": [ 575 | { 576 | "data": { 577 | "text/plain": [ 578 | "int" 579 | ] 580 | }, 581 | "execution_count": 36, 582 | "metadata": {}, 583 | "output_type": "execute_result" 584 | } 585 | ], 586 | "source": [ 587 | "a = 500\n", 588 | "type(a)" 589 | ] 590 | }, 591 | { 592 | "cell_type": "code", 593 | "execution_count": 37, 594 | "id": "2e84c187", 595 | "metadata": { 596 | "ExecuteTime": { 597 | "end_time": "2023-01-31T12:23:39.617491Z", 598 | "start_time": "2023-01-31T12:23:39.598751Z" 599 | } 600 | }, 601 | "outputs": [ 602 | { 603 | "data": { 604 | "text/plain": [ 605 | "True" 606 | ] 607 | }, 608 | "execution_count": 37, 609 | "metadata": {}, 610 | "output_type": "execute_result" 611 | } 612 | ], 613 | "source": [ 614 | "bool(a)" 615 | ] 616 | }, 617 | { 618 | "cell_type": "code", 619 | "execution_count": 34, 620 | "id": "003b9294", 621 | "metadata": { 622 | "ExecuteTime": { 623 | "end_time": "2023-01-31T12:23:28.130533Z", 624 | "start_time": "2023-01-31T12:23:28.117286Z" 625 | } 626 | }, 627 | "outputs": [ 628 | { 629 | "data": { 630 | "text/plain": [ 631 | "int" 632 | ] 633 | }, 634 | "execution_count": 34, 635 | "metadata": {}, 636 | "output_type": "execute_result" 637 | } 638 | ], 639 | "source": [ 640 | "z = 0\n", 641 | "type(z)" 642 | ] 643 | }, 644 | { 645 | "cell_type": "code", 646 | "execution_count": 35, 647 | "id": "5c3504aa", 648 | "metadata": { 649 | "ExecuteTime": { 650 | "end_time": "2023-01-31T12:23:32.644202Z", 651 | "start_time": "2023-01-31T12:23:32.633538Z" 652 | } 653 | }, 654 | "outputs": [ 655 | { 656 | "data": { 657 | "text/plain": [ 658 | "False" 659 | ] 660 | }, 661 | "execution_count": 35, 662 | "metadata": {}, 663 | "output_type": "execute_result" 664 | } 665 | ], 666 | "source": [ 667 | "bool(z)" 668 | ] 669 | }, 670 | { 671 | "cell_type": "code", 672 | "execution_count": null, 673 | "id": "0b7dbc55", 674 | "metadata": { 675 | "ExecuteTime": { 676 | "end_time": "2023-01-31T09:53:21.654327Z", 677 | "start_time": "2023-01-31T09:53:21.635640Z" 678 | } 679 | }, 680 | "outputs": [], 681 | "source": [ 682 | "#We can convert any type of values to bool type, and the output for all values will be True , \n", 683 | "#Except 0, which is False" 684 | ] 685 | }, 686 | { 687 | "cell_type": "markdown", 688 | "id": "25d2594c", 689 | "metadata": {}, 690 | "source": [ 691 | "# String methods" 692 | ] 693 | }, 694 | { 695 | "cell_type": "code", 696 | "execution_count": 9, 697 | "id": "692d80bf", 698 | "metadata": { 699 | "ExecuteTime": { 700 | "end_time": "2023-02-01T10:41:05.399443Z", 701 | "start_time": "2023-02-01T10:41:05.388810Z" 702 | } 703 | }, 704 | "outputs": [], 705 | "source": [ 706 | "#Create string\n", 707 | "s = 'We are learning python'\n", 708 | "s1 = \"We are learning python\"\n", 709 | "s2 = \"\"\"We are learning python\"\"\"" 710 | ] 711 | }, 712 | { 713 | "cell_type": "code", 714 | "execution_count": 5, 715 | "id": "b3df3f10", 716 | "metadata": { 717 | "ExecuteTime": { 718 | "end_time": "2023-02-01T10:39:43.893128Z", 719 | "start_time": "2023-02-01T10:39:43.885285Z" 720 | } 721 | }, 722 | "outputs": [ 723 | { 724 | "ename": "SyntaxError", 725 | "evalue": "invalid syntax (2877960538.py, line 1)", 726 | "output_type": "error", 727 | "traceback": [ 728 | "\u001b[1;36m File \u001b[1;32m\"C:\\Users\\Aishwarya\\AppData\\Local\\Temp\\ipykernel_53488\\2877960538.py\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m s = 'It's a laptop\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" 729 | ] 730 | } 731 | ], 732 | "source": [ 733 | "s = 'It's a laptop" 734 | ] 735 | }, 736 | { 737 | "cell_type": "code", 738 | "execution_count": 8, 739 | "id": "9b2bde9a", 740 | "metadata": { 741 | "ExecuteTime": { 742 | "end_time": "2023-02-01T10:40:41.378929Z", 743 | "start_time": "2023-02-01T10:40:41.368827Z" 744 | } 745 | }, 746 | "outputs": [ 747 | { 748 | "data": { 749 | "text/plain": [ 750 | "'It\"s is a laptop'" 751 | ] 752 | }, 753 | "execution_count": 8, 754 | "metadata": {}, 755 | "output_type": "execute_result" 756 | } 757 | ], 758 | "source": [ 759 | "s = \"It's a laptop\"\n", 760 | "s = 'It\"s is a laptop'\n", 761 | "s" 762 | ] 763 | }, 764 | { 765 | "cell_type": "code", 766 | "execution_count": 13, 767 | "id": "8f261d39", 768 | "metadata": { 769 | "ExecuteTime": { 770 | "end_time": "2023-02-01T10:42:27.340224Z", 771 | "start_time": "2023-02-01T10:42:27.325737Z" 772 | } 773 | }, 774 | "outputs": [], 775 | "source": [ 776 | "#Create string\n", 777 | "s = 'We are learning python'\n", 778 | "s1 = \"We are Learning python\"\n", 779 | "s2 = \"\"\"We are learning python\"\"\"" 780 | ] 781 | }, 782 | { 783 | "cell_type": "code", 784 | "execution_count": 14, 785 | "id": "90e758e9", 786 | "metadata": { 787 | "ExecuteTime": { 788 | "end_time": "2023-02-01T10:42:27.791988Z", 789 | "start_time": "2023-02-01T10:42:27.785159Z" 790 | } 791 | }, 792 | "outputs": [ 793 | { 794 | "data": { 795 | "text/plain": [ 796 | "False" 797 | ] 798 | }, 799 | "execution_count": 14, 800 | "metadata": {}, 801 | "output_type": "execute_result" 802 | } 803 | ], 804 | "source": [ 805 | "s == s1" 806 | ] 807 | }, 808 | { 809 | "cell_type": "code", 810 | "execution_count": 16, 811 | "id": "6498f994", 812 | "metadata": { 813 | "ExecuteTime": { 814 | "end_time": "2023-02-01T10:43:19.045685Z", 815 | "start_time": "2023-02-01T10:43:19.025661Z" 816 | } 817 | }, 818 | "outputs": [ 819 | { 820 | "data": { 821 | "text/plain": [ 822 | "False" 823 | ] 824 | }, 825 | "execution_count": 16, 826 | "metadata": {}, 827 | "output_type": "execute_result" 828 | } 829 | ], 830 | "source": [ 831 | "s != s2" 832 | ] 833 | }, 834 | { 835 | "cell_type": "code", 836 | "execution_count": 19, 837 | "id": "5c20c797", 838 | "metadata": { 839 | "ExecuteTime": { 840 | "end_time": "2023-02-01T10:45:09.350505Z", 841 | "start_time": "2023-02-01T10:45:09.337819Z" 842 | } 843 | }, 844 | "outputs": [], 845 | "source": [ 846 | "s = 'we are learning python'" 847 | ] 848 | }, 849 | { 850 | "cell_type": "code", 851 | "execution_count": 20, 852 | "id": "63671542", 853 | "metadata": { 854 | "ExecuteTime": { 855 | "end_time": "2023-02-01T10:45:10.393664Z", 856 | "start_time": "2023-02-01T10:45:10.376627Z" 857 | } 858 | }, 859 | "outputs": [ 860 | { 861 | "data": { 862 | "text/plain": [ 863 | "'We are learning python'" 864 | ] 865 | }, 866 | "execution_count": 20, 867 | "metadata": {}, 868 | "output_type": "execute_result" 869 | } 870 | ], 871 | "source": [ 872 | "s.capitalize()" 873 | ] 874 | }, 875 | { 876 | "cell_type": "code", 877 | "execution_count": 23, 878 | "id": "6122e0b5", 879 | "metadata": { 880 | "ExecuteTime": { 881 | "end_time": "2023-02-01T10:46:44.538338Z", 882 | "start_time": "2023-02-01T10:46:44.530789Z" 883 | } 884 | }, 885 | "outputs": [ 886 | { 887 | "data": { 888 | "text/plain": [ 889 | "True" 890 | ] 891 | }, 892 | "execution_count": 23, 893 | "metadata": {}, 894 | "output_type": "execute_result" 895 | } 896 | ], 897 | "source": [ 898 | "s.endswith('n')" 899 | ] 900 | }, 901 | { 902 | "cell_type": "code", 903 | "execution_count": null, 904 | "id": "574edfab", 905 | "metadata": { 906 | "ExecuteTime": { 907 | "end_time": "2023-01-30T16:28:25.915385Z", 908 | "start_time": "2023-01-30T16:28:25.912384Z" 909 | } 910 | }, 911 | "outputs": [], 912 | "source": [ 913 | "#find" 914 | ] 915 | }, 916 | { 917 | "cell_type": "code", 918 | "execution_count": 25, 919 | "id": "5a6e1bad", 920 | "metadata": { 921 | "ExecuteTime": { 922 | "end_time": "2023-02-01T10:48:48.941414Z", 923 | "start_time": "2023-02-01T10:48:48.920866Z" 924 | } 925 | }, 926 | "outputs": [ 927 | { 928 | "data": { 929 | "text/plain": [ 930 | "16" 931 | ] 932 | }, 933 | "execution_count": 25, 934 | "metadata": {}, 935 | "output_type": "execute_result" 936 | } 937 | ], 938 | "source": [ 939 | "s.find('python')" 940 | ] 941 | }, 942 | { 943 | "cell_type": "code", 944 | "execution_count": null, 945 | "id": "1c83cfa6", 946 | "metadata": { 947 | "ExecuteTime": { 948 | "end_time": "2023-01-30T16:28:25.947675Z", 949 | "start_time": "2023-01-30T16:28:25.929497Z" 950 | } 951 | }, 952 | "outputs": [], 953 | "source": [ 954 | "#join" 955 | ] 956 | }, 957 | { 958 | "cell_type": "code", 959 | "execution_count": 27, 960 | "id": "cdb46bc1", 961 | "metadata": { 962 | "ExecuteTime": { 963 | "end_time": "2023-02-01T10:49:44.019934Z", 964 | "start_time": "2023-02-01T10:49:44.010180Z" 965 | } 966 | }, 967 | "outputs": [], 968 | "source": [ 969 | "s = 'Python Basics part one'" 970 | ] 971 | }, 972 | { 973 | "cell_type": "code", 974 | "execution_count": 29, 975 | "id": "68169690", 976 | "metadata": { 977 | "ExecuteTime": { 978 | "end_time": "2023-02-01T10:50:54.194024Z", 979 | "start_time": "2023-02-01T10:50:54.182725Z" 980 | } 981 | }, 982 | "outputs": [ 983 | { 984 | "data": { 985 | "text/plain": [ 986 | "'P=y=t=h=o=n= =B=a=s=i=c=s= =p=a=r=t= =o=n=e'" 987 | ] 988 | }, 989 | "execution_count": 29, 990 | "metadata": {}, 991 | "output_type": "execute_result" 992 | } 993 | ], 994 | "source": [ 995 | "'='.join(s)" 996 | ] 997 | }, 998 | { 999 | "cell_type": "code", 1000 | "execution_count": null, 1001 | "id": "827aa51d", 1002 | "metadata": { 1003 | "ExecuteTime": { 1004 | "end_time": "2023-01-30T16:28:25.963077Z", 1005 | "start_time": "2023-01-30T16:28:25.950796Z" 1006 | } 1007 | }, 1008 | "outputs": [], 1009 | "source": [ 1010 | "#replace" 1011 | ] 1012 | }, 1013 | { 1014 | "cell_type": "code", 1015 | "execution_count": 30, 1016 | "id": "4787d34a", 1017 | "metadata": { 1018 | "ExecuteTime": { 1019 | "end_time": "2023-02-01T10:51:38.346573Z", 1020 | "start_time": "2023-02-01T10:51:38.328379Z" 1021 | } 1022 | }, 1023 | "outputs": [], 1024 | "source": [ 1025 | "s = 'Python/Basics/part/one'" 1026 | ] 1027 | }, 1028 | { 1029 | "cell_type": "code", 1030 | "execution_count": 34, 1031 | "id": "74c14e4b", 1032 | "metadata": { 1033 | "ExecuteTime": { 1034 | "end_time": "2023-02-01T10:54:09.280996Z", 1035 | "start_time": "2023-02-01T10:54:09.271553Z" 1036 | } 1037 | }, 1038 | "outputs": [], 1039 | "source": [ 1040 | "s = s.replace('/','-')" 1041 | ] 1042 | }, 1043 | { 1044 | "cell_type": "code", 1045 | "execution_count": 35, 1046 | "id": "29603076", 1047 | "metadata": { 1048 | "ExecuteTime": { 1049 | "end_time": "2023-02-01T10:54:11.518178Z", 1050 | "start_time": "2023-02-01T10:54:11.509568Z" 1051 | } 1052 | }, 1053 | "outputs": [ 1054 | { 1055 | "data": { 1056 | "text/plain": [ 1057 | "'Python-Basics-part-one'" 1058 | ] 1059 | }, 1060 | "execution_count": 35, 1061 | "metadata": {}, 1062 | "output_type": "execute_result" 1063 | } 1064 | ], 1065 | "source": [ 1066 | "s" 1067 | ] 1068 | }, 1069 | { 1070 | "cell_type": "code", 1071 | "execution_count": null, 1072 | "id": "c26137c1", 1073 | "metadata": { 1074 | "ExecuteTime": { 1075 | "end_time": "2023-01-30T16:28:25.978777Z", 1076 | "start_time": "2023-01-30T16:28:25.965263Z" 1077 | } 1078 | }, 1079 | "outputs": [], 1080 | "source": [ 1081 | "#split" 1082 | ] 1083 | }, 1084 | { 1085 | "cell_type": "code", 1086 | "execution_count": 36, 1087 | "id": "e0b71753", 1088 | "metadata": { 1089 | "ExecuteTime": { 1090 | "end_time": "2023-02-01T10:55:11.446812Z", 1091 | "start_time": "2023-02-01T10:55:11.427621Z" 1092 | } 1093 | }, 1094 | "outputs": [ 1095 | { 1096 | "data": { 1097 | "text/plain": [ 1098 | "'Python-Basics-part-one'" 1099 | ] 1100 | }, 1101 | "execution_count": 36, 1102 | "metadata": {}, 1103 | "output_type": "execute_result" 1104 | } 1105 | ], 1106 | "source": [ 1107 | "s" 1108 | ] 1109 | }, 1110 | { 1111 | "cell_type": "code", 1112 | "execution_count": 37, 1113 | "id": "107cb9c8", 1114 | "metadata": { 1115 | "ExecuteTime": { 1116 | "end_time": "2023-02-01T10:56:11.555189Z", 1117 | "start_time": "2023-02-01T10:56:11.541715Z" 1118 | } 1119 | }, 1120 | "outputs": [ 1121 | { 1122 | "data": { 1123 | "text/plain": [ 1124 | "['Python', 'Basics', 'part', 'one']" 1125 | ] 1126 | }, 1127 | "execution_count": 37, 1128 | "metadata": {}, 1129 | "output_type": "execute_result" 1130 | } 1131 | ], 1132 | "source": [ 1133 | "s.split('-')" 1134 | ] 1135 | }, 1136 | { 1137 | "cell_type": "code", 1138 | "execution_count": 38, 1139 | "id": "d555d233", 1140 | "metadata": { 1141 | "ExecuteTime": { 1142 | "end_time": "2023-02-01T10:56:30.166064Z", 1143 | "start_time": "2023-02-01T10:56:30.156196Z" 1144 | } 1145 | }, 1146 | "outputs": [], 1147 | "source": [ 1148 | "email = 'abc@gmail.com'" 1149 | ] 1150 | }, 1151 | { 1152 | "cell_type": "code", 1153 | "execution_count": 39, 1154 | "id": "7dc66dee", 1155 | "metadata": { 1156 | "ExecuteTime": { 1157 | "end_time": "2023-02-01T10:57:13.502986Z", 1158 | "start_time": "2023-02-01T10:57:13.490839Z" 1159 | } 1160 | }, 1161 | "outputs": [ 1162 | { 1163 | "data": { 1164 | "text/plain": [ 1165 | "['abc', 'gmail.com']" 1166 | ] 1167 | }, 1168 | "execution_count": 39, 1169 | "metadata": {}, 1170 | "output_type": "execute_result" 1171 | } 1172 | ], 1173 | "source": [ 1174 | "email.split('@')" 1175 | ] 1176 | }, 1177 | { 1178 | "cell_type": "code", 1179 | "execution_count": 40, 1180 | "id": "79c9ffa6", 1181 | "metadata": { 1182 | "ExecuteTime": { 1183 | "end_time": "2023-02-01T10:59:35.066718Z", 1184 | "start_time": "2023-02-01T10:59:35.045252Z" 1185 | } 1186 | }, 1187 | "outputs": [ 1188 | { 1189 | "data": { 1190 | "text/plain": [ 1191 | "'wE ARE LEARNING pYTHON'" 1192 | ] 1193 | }, 1194 | "execution_count": 40, 1195 | "metadata": {}, 1196 | "output_type": "execute_result" 1197 | } 1198 | ], 1199 | "source": [ 1200 | "#swapcase\n", 1201 | "\n", 1202 | "a = 'We are learning Python'\n", 1203 | "\n", 1204 | "a.swapcase()" 1205 | ] 1206 | }, 1207 | { 1208 | "cell_type": "code", 1209 | "execution_count": null, 1210 | "id": "4f210d86", 1211 | "metadata": { 1212 | "ExecuteTime": { 1213 | "end_time": "2023-01-30T16:28:26.010432Z", 1214 | "start_time": "2023-01-30T16:28:25.996912Z" 1215 | } 1216 | }, 1217 | "outputs": [], 1218 | "source": [ 1219 | "#Upper, Lower,Title" 1220 | ] 1221 | }, 1222 | { 1223 | "cell_type": "code", 1224 | "execution_count": 41, 1225 | "id": "1bb16fb7", 1226 | "metadata": { 1227 | "ExecuteTime": { 1228 | "end_time": "2023-02-01T10:59:45.972996Z", 1229 | "start_time": "2023-02-01T10:59:45.957253Z" 1230 | } 1231 | }, 1232 | "outputs": [ 1233 | { 1234 | "data": { 1235 | "text/plain": [ 1236 | "'WE ARE LEARNING PYTHON'" 1237 | ] 1238 | }, 1239 | "execution_count": 41, 1240 | "metadata": {}, 1241 | "output_type": "execute_result" 1242 | } 1243 | ], 1244 | "source": [ 1245 | "a.upper()" 1246 | ] 1247 | }, 1248 | { 1249 | "cell_type": "code", 1250 | "execution_count": 42, 1251 | "id": "cfe1ad7e", 1252 | "metadata": { 1253 | "ExecuteTime": { 1254 | "end_time": "2023-02-01T11:00:02.023421Z", 1255 | "start_time": "2023-02-01T11:00:02.005418Z" 1256 | } 1257 | }, 1258 | "outputs": [ 1259 | { 1260 | "data": { 1261 | "text/plain": [ 1262 | "'we are learning python'" 1263 | ] 1264 | }, 1265 | "execution_count": 42, 1266 | "metadata": {}, 1267 | "output_type": "execute_result" 1268 | } 1269 | ], 1270 | "source": [ 1271 | "a.lower()" 1272 | ] 1273 | }, 1274 | { 1275 | "cell_type": "code", 1276 | "execution_count": 43, 1277 | "id": "83a246cb", 1278 | "metadata": { 1279 | "ExecuteTime": { 1280 | "end_time": "2023-02-01T11:00:07.609867Z", 1281 | "start_time": "2023-02-01T11:00:07.602482Z" 1282 | } 1283 | }, 1284 | "outputs": [ 1285 | { 1286 | "data": { 1287 | "text/plain": [ 1288 | "'We Are Learning Python'" 1289 | ] 1290 | }, 1291 | "execution_count": 43, 1292 | "metadata": {}, 1293 | "output_type": "execute_result" 1294 | } 1295 | ], 1296 | "source": [ 1297 | "a.title()" 1298 | ] 1299 | }, 1300 | { 1301 | "cell_type": "markdown", 1302 | "id": "48220fa4", 1303 | "metadata": {}, 1304 | "source": [ 1305 | "# Data Structures\n", 1306 | "1. Lists\n", 1307 | "2. Tuple\n", 1308 | "3. Dictionary\n", 1309 | "4. Sets" 1310 | ] 1311 | }, 1312 | { 1313 | "cell_type": "markdown", 1314 | "id": "78753086", 1315 | "metadata": {}, 1316 | "source": [ 1317 | "**Lists**\n", 1318 | "\n", 1319 | "- Lists are the built in data structures in python.\n", 1320 | "- Lists are heterogenous data structure.\n", 1321 | "- Lists are mutable." 1322 | ] 1323 | }, 1324 | { 1325 | "cell_type": "code", 1326 | "execution_count": null, 1327 | "id": "8417c924", 1328 | "metadata": { 1329 | "ExecuteTime": { 1330 | "end_time": "2023-01-30T16:28:26.026599Z", 1331 | "start_time": "2023-01-30T16:28:26.012432Z" 1332 | } 1333 | }, 1334 | "outputs": [], 1335 | "source": [ 1336 | "#Creating lists" 1337 | ] 1338 | }, 1339 | { 1340 | "cell_type": "code", 1341 | "execution_count": 44, 1342 | "id": "f1570c8d", 1343 | "metadata": { 1344 | "ExecuteTime": { 1345 | "end_time": "2023-02-01T11:03:40.183589Z", 1346 | "start_time": "2023-02-01T11:03:40.177342Z" 1347 | } 1348 | }, 1349 | "outputs": [ 1350 | { 1351 | "data": { 1352 | "text/plain": [ 1353 | "list" 1354 | ] 1355 | }, 1356 | "execution_count": 44, 1357 | "metadata": {}, 1358 | "output_type": "execute_result" 1359 | } 1360 | ], 1361 | "source": [ 1362 | "lst = []\n", 1363 | "\n", 1364 | "type(lst)" 1365 | ] 1366 | }, 1367 | { 1368 | "cell_type": "code", 1369 | "execution_count": 45, 1370 | "id": "3f4790ef", 1371 | "metadata": { 1372 | "ExecuteTime": { 1373 | "end_time": "2023-02-01T11:04:40.142484Z", 1374 | "start_time": "2023-02-01T11:04:40.132358Z" 1375 | } 1376 | }, 1377 | "outputs": [ 1378 | { 1379 | "data": { 1380 | "text/plain": [ 1381 | "list" 1382 | ] 1383 | }, 1384 | "execution_count": 45, 1385 | "metadata": {}, 1386 | "output_type": "execute_result" 1387 | } 1388 | ], 1389 | "source": [ 1390 | "l1 = list()\n", 1391 | "type(l1)" 1392 | ] 1393 | }, 1394 | { 1395 | "cell_type": "code", 1396 | "execution_count": 74, 1397 | "id": "8884c02e", 1398 | "metadata": { 1399 | "ExecuteTime": { 1400 | "end_time": "2023-02-01T11:14:47.779036Z", 1401 | "start_time": "2023-02-01T11:14:47.772308Z" 1402 | } 1403 | }, 1404 | "outputs": [], 1405 | "source": [ 1406 | "lst = [10,18.2,True, 'Python']" 1407 | ] 1408 | }, 1409 | { 1410 | "cell_type": "code", 1411 | "execution_count": 49, 1412 | "id": "abd528a2", 1413 | "metadata": { 1414 | "ExecuteTime": { 1415 | "end_time": "2023-02-01T11:07:11.126854Z", 1416 | "start_time": "2023-02-01T11:07:11.121464Z" 1417 | } 1418 | }, 1419 | "outputs": [ 1420 | { 1421 | "data": { 1422 | "text/plain": [ 1423 | "[10, 18.2, True, 'Python']" 1424 | ] 1425 | }, 1426 | "execution_count": 49, 1427 | "metadata": {}, 1428 | "output_type": "execute_result" 1429 | } 1430 | ], 1431 | "source": [ 1432 | "lst" 1433 | ] 1434 | }, 1435 | { 1436 | "cell_type": "code", 1437 | "execution_count": 48, 1438 | "id": "0ae2e07b", 1439 | "metadata": { 1440 | "ExecuteTime": { 1441 | "end_time": "2023-02-01T11:06:59.978105Z", 1442 | "start_time": "2023-02-01T11:06:59.966042Z" 1443 | } 1444 | }, 1445 | "outputs": [ 1446 | { 1447 | "data": { 1448 | "text/plain": [ 1449 | "True" 1450 | ] 1451 | }, 1452 | "execution_count": 48, 1453 | "metadata": {}, 1454 | "output_type": "execute_result" 1455 | } 1456 | ], 1457 | "source": [ 1458 | "#Accessing elements from a list\n", 1459 | "lst[2]" 1460 | ] 1461 | }, 1462 | { 1463 | "cell_type": "code", 1464 | "execution_count": 50, 1465 | "id": "def7bd1a", 1466 | "metadata": { 1467 | "ExecuteTime": { 1468 | "end_time": "2023-02-01T11:07:13.416479Z", 1469 | "start_time": "2023-02-01T11:07:13.395439Z" 1470 | } 1471 | }, 1472 | "outputs": [ 1473 | { 1474 | "data": { 1475 | "text/plain": [ 1476 | "'Python'" 1477 | ] 1478 | }, 1479 | "execution_count": 50, 1480 | "metadata": {}, 1481 | "output_type": "execute_result" 1482 | } 1483 | ], 1484 | "source": [ 1485 | "lst[-1]" 1486 | ] 1487 | }, 1488 | { 1489 | "cell_type": "code", 1490 | "execution_count": 53, 1491 | "id": "c87a0394", 1492 | "metadata": { 1493 | "ExecuteTime": { 1494 | "end_time": "2023-02-01T11:08:18.927677Z", 1495 | "start_time": "2023-02-01T11:08:18.910156Z" 1496 | } 1497 | }, 1498 | "outputs": [ 1499 | { 1500 | "data": { 1501 | "text/plain": [ 1502 | "[10, 18.2, True, 'Python']" 1503 | ] 1504 | }, 1505 | "execution_count": 53, 1506 | "metadata": {}, 1507 | "output_type": "execute_result" 1508 | } 1509 | ], 1510 | "source": [ 1511 | "lst" 1512 | ] 1513 | }, 1514 | { 1515 | "cell_type": "code", 1516 | "execution_count": 54, 1517 | "id": "f592a328", 1518 | "metadata": { 1519 | "ExecuteTime": { 1520 | "end_time": "2023-02-01T11:08:20.548380Z", 1521 | "start_time": "2023-02-01T11:08:20.527043Z" 1522 | } 1523 | }, 1524 | "outputs": [ 1525 | { 1526 | "data": { 1527 | "text/plain": [ 1528 | "[10, 18.2, True]" 1529 | ] 1530 | }, 1531 | "execution_count": 54, 1532 | "metadata": {}, 1533 | "output_type": "execute_result" 1534 | } 1535 | ], 1536 | "source": [ 1537 | "lst[0:3]" 1538 | ] 1539 | }, 1540 | { 1541 | "cell_type": "code", 1542 | "execution_count": 56, 1543 | "id": "830edbcf", 1544 | "metadata": { 1545 | "ExecuteTime": { 1546 | "end_time": "2023-02-01T11:09:17.731253Z", 1547 | "start_time": "2023-02-01T11:09:17.712618Z" 1548 | } 1549 | }, 1550 | "outputs": [ 1551 | { 1552 | "data": { 1553 | "text/plain": [ 1554 | "[18.2, True, 'Python']" 1555 | ] 1556 | }, 1557 | "execution_count": 56, 1558 | "metadata": {}, 1559 | "output_type": "execute_result" 1560 | } 1561 | ], 1562 | "source": [ 1563 | "lst[1:]" 1564 | ] 1565 | }, 1566 | { 1567 | "cell_type": "code", 1568 | "execution_count": null, 1569 | "id": "405e6788", 1570 | "metadata": { 1571 | "ExecuteTime": { 1572 | "end_time": "2023-01-30T16:28:26.057775Z", 1573 | "start_time": "2023-01-30T16:28:26.044245Z" 1574 | } 1575 | }, 1576 | "outputs": [], 1577 | "source": [ 1578 | "#append" 1579 | ] 1580 | }, 1581 | { 1582 | "cell_type": "code", 1583 | "execution_count": 57, 1584 | "id": "6fbff13b", 1585 | "metadata": { 1586 | "ExecuteTime": { 1587 | "end_time": "2023-02-01T11:10:09.724162Z", 1588 | "start_time": "2023-02-01T11:10:09.705257Z" 1589 | } 1590 | }, 1591 | "outputs": [], 1592 | "source": [ 1593 | "lst.append(100)" 1594 | ] 1595 | }, 1596 | { 1597 | "cell_type": "code", 1598 | "execution_count": 58, 1599 | "id": "4676126e", 1600 | "metadata": { 1601 | "ExecuteTime": { 1602 | "end_time": "2023-02-01T11:10:13.964489Z", 1603 | "start_time": "2023-02-01T11:10:13.954918Z" 1604 | } 1605 | }, 1606 | "outputs": [ 1607 | { 1608 | "data": { 1609 | "text/plain": [ 1610 | "[10, 18.2, True, 'Python', 100]" 1611 | ] 1612 | }, 1613 | "execution_count": 58, 1614 | "metadata": {}, 1615 | "output_type": "execute_result" 1616 | } 1617 | ], 1618 | "source": [ 1619 | "lst" 1620 | ] 1621 | }, 1622 | { 1623 | "cell_type": "code", 1624 | "execution_count": 59, 1625 | "id": "9a904e7f", 1626 | "metadata": { 1627 | "ExecuteTime": { 1628 | "end_time": "2023-02-01T11:10:41.191736Z", 1629 | "start_time": "2023-02-01T11:10:41.179896Z" 1630 | } 1631 | }, 1632 | "outputs": [ 1633 | { 1634 | "data": { 1635 | "text/plain": [ 1636 | "[10, 18.2, True, 'Python', 100, 'ML']" 1637 | ] 1638 | }, 1639 | "execution_count": 59, 1640 | "metadata": {}, 1641 | "output_type": "execute_result" 1642 | } 1643 | ], 1644 | "source": [ 1645 | "lst.append('ML')\n", 1646 | "lst" 1647 | ] 1648 | }, 1649 | { 1650 | "cell_type": "code", 1651 | "execution_count": 61, 1652 | "id": "59386c93", 1653 | "metadata": { 1654 | "ExecuteTime": { 1655 | "end_time": "2023-02-01T11:11:36.278618Z", 1656 | "start_time": "2023-02-01T11:11:36.266591Z" 1657 | } 1658 | }, 1659 | "outputs": [], 1660 | "source": [ 1661 | "lst.append(18.2)" 1662 | ] 1663 | }, 1664 | { 1665 | "cell_type": "code", 1666 | "execution_count": 64, 1667 | "id": "1a86cb29", 1668 | "metadata": { 1669 | "ExecuteTime": { 1670 | "end_time": "2023-02-01T11:11:43.077788Z", 1671 | "start_time": "2023-02-01T11:11:43.063710Z" 1672 | } 1673 | }, 1674 | "outputs": [ 1675 | { 1676 | "data": { 1677 | "text/plain": [ 1678 | "[10, 18.2, True, 'Python', 100, 'ML', 18.2]" 1679 | ] 1680 | }, 1681 | "execution_count": 64, 1682 | "metadata": {}, 1683 | "output_type": "execute_result" 1684 | } 1685 | ], 1686 | "source": [ 1687 | "lst" 1688 | ] 1689 | }, 1690 | { 1691 | "cell_type": "code", 1692 | "execution_count": 62, 1693 | "id": "3b379bef", 1694 | "metadata": { 1695 | "ExecuteTime": { 1696 | "end_time": "2023-02-01T11:11:36.606720Z", 1697 | "start_time": "2023-02-01T11:11:36.600692Z" 1698 | } 1699 | }, 1700 | "outputs": [], 1701 | "source": [ 1702 | "#Count " 1703 | ] 1704 | }, 1705 | { 1706 | "cell_type": "code", 1707 | "execution_count": 63, 1708 | "id": "41e60574", 1709 | "metadata": { 1710 | "ExecuteTime": { 1711 | "end_time": "2023-02-01T11:11:37.071894Z", 1712 | "start_time": "2023-02-01T11:11:37.051857Z" 1713 | } 1714 | }, 1715 | "outputs": [ 1716 | { 1717 | "data": { 1718 | "text/plain": [ 1719 | "2" 1720 | ] 1721 | }, 1722 | "execution_count": 63, 1723 | "metadata": {}, 1724 | "output_type": "execute_result" 1725 | } 1726 | ], 1727 | "source": [ 1728 | "lst.count(18.2)" 1729 | ] 1730 | }, 1731 | { 1732 | "cell_type": "code", 1733 | "execution_count": null, 1734 | "id": "d6b0a78f", 1735 | "metadata": { 1736 | "ExecuteTime": { 1737 | "end_time": "2023-01-30T16:28:26.079327Z", 1738 | "start_time": "2023-01-30T16:28:26.074135Z" 1739 | } 1740 | }, 1741 | "outputs": [], 1742 | "source": [ 1743 | "#Index" 1744 | ] 1745 | }, 1746 | { 1747 | "cell_type": "code", 1748 | "execution_count": 65, 1749 | "id": "04130f5c", 1750 | "metadata": { 1751 | "ExecuteTime": { 1752 | "end_time": "2023-02-01T11:12:26.196986Z", 1753 | "start_time": "2023-02-01T11:12:26.177711Z" 1754 | } 1755 | }, 1756 | "outputs": [ 1757 | { 1758 | "data": { 1759 | "text/plain": [ 1760 | "3" 1761 | ] 1762 | }, 1763 | "execution_count": 65, 1764 | "metadata": {}, 1765 | "output_type": "execute_result" 1766 | } 1767 | ], 1768 | "source": [ 1769 | "lst.index('Python')" 1770 | ] 1771 | }, 1772 | { 1773 | "cell_type": "code", 1774 | "execution_count": null, 1775 | "id": "ec790de7", 1776 | "metadata": { 1777 | "ExecuteTime": { 1778 | "end_time": "2023-01-30T16:28:26.093199Z", 1779 | "start_time": "2023-01-30T16:28:26.081809Z" 1780 | } 1781 | }, 1782 | "outputs": [], 1783 | "source": [ 1784 | "#Insert" 1785 | ] 1786 | }, 1787 | { 1788 | "cell_type": "code", 1789 | "execution_count": 66, 1790 | "id": "b2e67472", 1791 | "metadata": { 1792 | "ExecuteTime": { 1793 | "end_time": "2023-02-01T11:12:53.292601Z", 1794 | "start_time": "2023-02-01T11:12:53.279269Z" 1795 | } 1796 | }, 1797 | "outputs": [ 1798 | { 1799 | "data": { 1800 | "text/plain": [ 1801 | "[10, 18.2, True, 'Python', 100, 'ML', 18.2]" 1802 | ] 1803 | }, 1804 | "execution_count": 66, 1805 | "metadata": {}, 1806 | "output_type": "execute_result" 1807 | } 1808 | ], 1809 | "source": [ 1810 | "lst" 1811 | ] 1812 | }, 1813 | { 1814 | "cell_type": "code", 1815 | "execution_count": 67, 1816 | "id": "45aac18b", 1817 | "metadata": { 1818 | "ExecuteTime": { 1819 | "end_time": "2023-02-01T11:13:36.454945Z", 1820 | "start_time": "2023-02-01T11:13:36.435313Z" 1821 | } 1822 | }, 1823 | "outputs": [], 1824 | "source": [ 1825 | "lst.insert(0,1000)" 1826 | ] 1827 | }, 1828 | { 1829 | "cell_type": "code", 1830 | "execution_count": 68, 1831 | "id": "7bb906d0", 1832 | "metadata": { 1833 | "ExecuteTime": { 1834 | "end_time": "2023-02-01T11:13:38.741818Z", 1835 | "start_time": "2023-02-01T11:13:38.735231Z" 1836 | } 1837 | }, 1838 | "outputs": [ 1839 | { 1840 | "data": { 1841 | "text/plain": [ 1842 | "[1000, 10, 18.2, True, 'Python', 100, 'ML', 18.2]" 1843 | ] 1844 | }, 1845 | "execution_count": 68, 1846 | "metadata": {}, 1847 | "output_type": "execute_result" 1848 | } 1849 | ], 1850 | "source": [ 1851 | "lst" 1852 | ] 1853 | }, 1854 | { 1855 | "cell_type": "code", 1856 | "execution_count": 71, 1857 | "id": "0bd3d2de", 1858 | "metadata": { 1859 | "ExecuteTime": { 1860 | "end_time": "2023-02-01T11:14:09.635696Z", 1861 | "start_time": "2023-02-01T11:14:09.624525Z" 1862 | } 1863 | }, 1864 | "outputs": [ 1865 | { 1866 | "data": { 1867 | "text/plain": [ 1868 | "[1000, 10, 18.2, True, 'Python', 100, 'ML', 500, 500, 18.2]" 1869 | ] 1870 | }, 1871 | "execution_count": 71, 1872 | "metadata": {}, 1873 | "output_type": "execute_result" 1874 | } 1875 | ], 1876 | "source": [ 1877 | "lst.insert(-1,500)" 1878 | ] 1879 | }, 1880 | { 1881 | "cell_type": "code", 1882 | "execution_count": 78, 1883 | "id": "337583b6", 1884 | "metadata": { 1885 | "ExecuteTime": { 1886 | "end_time": "2023-02-01T11:15:11.010030Z", 1887 | "start_time": "2023-02-01T11:15:10.991672Z" 1888 | } 1889 | }, 1890 | "outputs": [], 1891 | "source": [ 1892 | "lst.insert(4,20)" 1893 | ] 1894 | }, 1895 | { 1896 | "cell_type": "code", 1897 | "execution_count": 79, 1898 | "id": "93829792", 1899 | "metadata": { 1900 | "ExecuteTime": { 1901 | "end_time": "2023-02-01T11:15:11.724531Z", 1902 | "start_time": "2023-02-01T11:15:11.714399Z" 1903 | } 1904 | }, 1905 | "outputs": [ 1906 | { 1907 | "data": { 1908 | "text/plain": [ 1909 | "[10, 18.2, True, 20, 20, 'Python']" 1910 | ] 1911 | }, 1912 | "execution_count": 79, 1913 | "metadata": {}, 1914 | "output_type": "execute_result" 1915 | } 1916 | ], 1917 | "source": [ 1918 | "lst" 1919 | ] 1920 | }, 1921 | { 1922 | "cell_type": "code", 1923 | "execution_count": null, 1924 | "id": "cc3629cb", 1925 | "metadata": { 1926 | "ExecuteTime": { 1927 | "end_time": "2023-01-30T16:28:26.108854Z", 1928 | "start_time": "2023-01-30T16:28:26.095325Z" 1929 | } 1930 | }, 1931 | "outputs": [], 1932 | "source": [ 1933 | "#pop" 1934 | ] 1935 | }, 1936 | { 1937 | "cell_type": "code", 1938 | "execution_count": 80, 1939 | "id": "5fd7d1ba", 1940 | "metadata": { 1941 | "ExecuteTime": { 1942 | "end_time": "2023-02-01T11:15:42.095770Z", 1943 | "start_time": "2023-02-01T11:15:42.081011Z" 1944 | } 1945 | }, 1946 | "outputs": [ 1947 | { 1948 | "data": { 1949 | "text/plain": [ 1950 | "'Python'" 1951 | ] 1952 | }, 1953 | "execution_count": 80, 1954 | "metadata": {}, 1955 | "output_type": "execute_result" 1956 | } 1957 | ], 1958 | "source": [ 1959 | "lst.pop()" 1960 | ] 1961 | }, 1962 | { 1963 | "cell_type": "code", 1964 | "execution_count": 81, 1965 | "id": "6ab33471", 1966 | "metadata": { 1967 | "ExecuteTime": { 1968 | "end_time": "2023-02-01T11:15:48.304816Z", 1969 | "start_time": "2023-02-01T11:15:48.290711Z" 1970 | } 1971 | }, 1972 | "outputs": [ 1973 | { 1974 | "data": { 1975 | "text/plain": [ 1976 | "[10, 18.2, True, 20, 20]" 1977 | ] 1978 | }, 1979 | "execution_count": 81, 1980 | "metadata": {}, 1981 | "output_type": "execute_result" 1982 | } 1983 | ], 1984 | "source": [ 1985 | "lst" 1986 | ] 1987 | }, 1988 | { 1989 | "cell_type": "code", 1990 | "execution_count": null, 1991 | "id": "041ea0f3", 1992 | "metadata": { 1993 | "ExecuteTime": { 1994 | "end_time": "2023-01-30T16:28:26.124705Z", 1995 | "start_time": "2023-01-30T16:28:26.108854Z" 1996 | } 1997 | }, 1998 | "outputs": [], 1999 | "source": [ 2000 | "#reverse" 2001 | ] 2002 | }, 2003 | { 2004 | "cell_type": "code", 2005 | "execution_count": 82, 2006 | "id": "f3bdbd28", 2007 | "metadata": { 2008 | "ExecuteTime": { 2009 | "end_time": "2023-02-01T11:16:29.275176Z", 2010 | "start_time": "2023-02-01T11:16:29.263653Z" 2011 | } 2012 | }, 2013 | "outputs": [], 2014 | "source": [ 2015 | "lst.reverse()" 2016 | ] 2017 | }, 2018 | { 2019 | "cell_type": "code", 2020 | "execution_count": 83, 2021 | "id": "88092c1b", 2022 | "metadata": { 2023 | "ExecuteTime": { 2024 | "end_time": "2023-02-01T11:16:31.518360Z", 2025 | "start_time": "2023-02-01T11:16:31.504782Z" 2026 | } 2027 | }, 2028 | "outputs": [ 2029 | { 2030 | "data": { 2031 | "text/plain": [ 2032 | "[20, 20, True, 18.2, 10]" 2033 | ] 2034 | }, 2035 | "execution_count": 83, 2036 | "metadata": {}, 2037 | "output_type": "execute_result" 2038 | } 2039 | ], 2040 | "source": [ 2041 | "lst" 2042 | ] 2043 | }, 2044 | { 2045 | "cell_type": "code", 2046 | "execution_count": null, 2047 | "id": "e5a6f491", 2048 | "metadata": { 2049 | "ExecuteTime": { 2050 | "end_time": "2023-01-30T16:28:26.140503Z", 2051 | "start_time": "2023-01-30T16:28:26.124705Z" 2052 | } 2053 | }, 2054 | "outputs": [], 2055 | "source": [ 2056 | "#remove" 2057 | ] 2058 | }, 2059 | { 2060 | "cell_type": "code", 2061 | "execution_count": 84, 2062 | "id": "4c1b2ec0", 2063 | "metadata": { 2064 | "ExecuteTime": { 2065 | "end_time": "2023-02-01T11:17:02.249549Z", 2066 | "start_time": "2023-02-01T11:17:02.231487Z" 2067 | } 2068 | }, 2069 | "outputs": [ 2070 | { 2071 | "data": { 2072 | "text/plain": [ 2073 | "[20, 20, True, 18.2, 10]" 2074 | ] 2075 | }, 2076 | "execution_count": 84, 2077 | "metadata": {}, 2078 | "output_type": "execute_result" 2079 | } 2080 | ], 2081 | "source": [ 2082 | "lst" 2083 | ] 2084 | }, 2085 | { 2086 | "cell_type": "code", 2087 | "execution_count": 85, 2088 | "id": "d079c056", 2089 | "metadata": { 2090 | "ExecuteTime": { 2091 | "end_time": "2023-02-01T11:17:12.381745Z", 2092 | "start_time": "2023-02-01T11:17:12.370753Z" 2093 | } 2094 | }, 2095 | "outputs": [], 2096 | "source": [ 2097 | "lst.remove(True)" 2098 | ] 2099 | }, 2100 | { 2101 | "cell_type": "code", 2102 | "execution_count": 86, 2103 | "id": "8e316c6c", 2104 | "metadata": { 2105 | "ExecuteTime": { 2106 | "end_time": "2023-02-01T11:17:15.117829Z", 2107 | "start_time": "2023-02-01T11:17:15.106169Z" 2108 | } 2109 | }, 2110 | "outputs": [ 2111 | { 2112 | "data": { 2113 | "text/plain": [ 2114 | "[20, 20, 18.2, 10]" 2115 | ] 2116 | }, 2117 | "execution_count": 86, 2118 | "metadata": {}, 2119 | "output_type": "execute_result" 2120 | } 2121 | ], 2122 | "source": [ 2123 | "lst" 2124 | ] 2125 | }, 2126 | { 2127 | "cell_type": "code", 2128 | "execution_count": null, 2129 | "id": "2c6eb636", 2130 | "metadata": { 2131 | "ExecuteTime": { 2132 | "end_time": "2023-01-30T16:28:26.156392Z", 2133 | "start_time": "2023-01-30T16:28:26.140503Z" 2134 | } 2135 | }, 2136 | "outputs": [], 2137 | "source": [ 2138 | "#Replacing elements in lists" 2139 | ] 2140 | }, 2141 | { 2142 | "cell_type": "code", 2143 | "execution_count": 87, 2144 | "id": "521b8b04", 2145 | "metadata": { 2146 | "ExecuteTime": { 2147 | "end_time": "2023-02-01T11:18:04.156430Z", 2148 | "start_time": "2023-02-01T11:18:04.145902Z" 2149 | } 2150 | }, 2151 | "outputs": [], 2152 | "source": [ 2153 | "lst = [10,12,14,'False','Python']" 2154 | ] 2155 | }, 2156 | { 2157 | "cell_type": "code", 2158 | "execution_count": 88, 2159 | "id": "1191f014", 2160 | "metadata": { 2161 | "ExecuteTime": { 2162 | "end_time": "2023-02-01T11:19:03.328112Z", 2163 | "start_time": "2023-02-01T11:19:03.316974Z" 2164 | } 2165 | }, 2166 | "outputs": [], 2167 | "source": [ 2168 | "lst[3] = True" 2169 | ] 2170 | }, 2171 | { 2172 | "cell_type": "code", 2173 | "execution_count": 89, 2174 | "id": "01d531dd", 2175 | "metadata": { 2176 | "ExecuteTime": { 2177 | "end_time": "2023-02-01T11:19:05.827145Z", 2178 | "start_time": "2023-02-01T11:19:05.810895Z" 2179 | } 2180 | }, 2181 | "outputs": [ 2182 | { 2183 | "data": { 2184 | "text/plain": [ 2185 | "[10, 12, 14, True, 'Python']" 2186 | ] 2187 | }, 2188 | "execution_count": 89, 2189 | "metadata": {}, 2190 | "output_type": "execute_result" 2191 | } 2192 | ], 2193 | "source": [ 2194 | "lst" 2195 | ] 2196 | }, 2197 | { 2198 | "cell_type": "markdown", 2199 | "id": "5dbba063", 2200 | "metadata": {}, 2201 | "source": [ 2202 | "**Tuple**\n", 2203 | "\n", 2204 | "- Tuples are ordered and heterogenous data structure.\n", 2205 | "- Tuples are immutable." 2206 | ] 2207 | }, 2208 | { 2209 | "cell_type": "code", 2210 | "execution_count": 90, 2211 | "id": "174d82a7", 2212 | "metadata": { 2213 | "ExecuteTime": { 2214 | "end_time": "2023-02-01T11:19:57.967890Z", 2215 | "start_time": "2023-02-01T11:19:57.956360Z" 2216 | } 2217 | }, 2218 | "outputs": [ 2219 | { 2220 | "data": { 2221 | "text/plain": [ 2222 | "tuple" 2223 | ] 2224 | }, 2225 | "execution_count": 90, 2226 | "metadata": {}, 2227 | "output_type": "execute_result" 2228 | } 2229 | ], 2230 | "source": [ 2231 | "#Create a tuple\n", 2232 | "\n", 2233 | "t = ()\n", 2234 | "type(t)" 2235 | ] 2236 | }, 2237 | { 2238 | "cell_type": "code", 2239 | "execution_count": 91, 2240 | "id": "52b0c1d4", 2241 | "metadata": { 2242 | "ExecuteTime": { 2243 | "end_time": "2023-02-01T11:20:20.157635Z", 2244 | "start_time": "2023-02-01T11:20:20.145832Z" 2245 | } 2246 | }, 2247 | "outputs": [ 2248 | { 2249 | "data": { 2250 | "text/plain": [ 2251 | "tuple" 2252 | ] 2253 | }, 2254 | "execution_count": 91, 2255 | "metadata": {}, 2256 | "output_type": "execute_result" 2257 | } 2258 | ], 2259 | "source": [ 2260 | "t1 = tuple()\n", 2261 | "type(t1)" 2262 | ] 2263 | }, 2264 | { 2265 | "cell_type": "code", 2266 | "execution_count": 96, 2267 | "id": "9d6cc3a9", 2268 | "metadata": { 2269 | "ExecuteTime": { 2270 | "end_time": "2023-02-01T11:23:09.241655Z", 2271 | "start_time": "2023-02-01T11:23:09.224249Z" 2272 | } 2273 | }, 2274 | "outputs": [], 2275 | "source": [ 2276 | "t = (10,20,10.5,\"python\",10.5)" 2277 | ] 2278 | }, 2279 | { 2280 | "cell_type": "code", 2281 | "execution_count": 97, 2282 | "id": "5b616bb0", 2283 | "metadata": { 2284 | "ExecuteTime": { 2285 | "end_time": "2023-02-01T11:23:09.741291Z", 2286 | "start_time": "2023-02-01T11:23:09.723792Z" 2287 | } 2288 | }, 2289 | "outputs": [ 2290 | { 2291 | "data": { 2292 | "text/plain": [ 2293 | "(10, 20, 10.5, 'python', 10.5)" 2294 | ] 2295 | }, 2296 | "execution_count": 97, 2297 | "metadata": {}, 2298 | "output_type": "execute_result" 2299 | } 2300 | ], 2301 | "source": [ 2302 | "t" 2303 | ] 2304 | }, 2305 | { 2306 | "cell_type": "code", 2307 | "execution_count": 98, 2308 | "id": "9d276878", 2309 | "metadata": { 2310 | "ExecuteTime": { 2311 | "end_time": "2023-02-01T11:23:10.735274Z", 2312 | "start_time": "2023-02-01T11:23:10.712453Z" 2313 | } 2314 | }, 2315 | "outputs": [ 2316 | { 2317 | "data": { 2318 | "text/plain": [ 2319 | "2" 2320 | ] 2321 | }, 2322 | "execution_count": 98, 2323 | "metadata": {}, 2324 | "output_type": "execute_result" 2325 | } 2326 | ], 2327 | "source": [ 2328 | "t.count(10.5)" 2329 | ] 2330 | }, 2331 | { 2332 | "cell_type": "code", 2333 | "execution_count": null, 2334 | "id": "e6436ef7", 2335 | "metadata": { 2336 | "ExecuteTime": { 2337 | "end_time": "2023-01-30T16:28:26.188478Z", 2338 | "start_time": "2023-01-30T16:28:26.177138Z" 2339 | } 2340 | }, 2341 | "outputs": [], 2342 | "source": [ 2343 | "#Accessing elements from tuple" 2344 | ] 2345 | }, 2346 | { 2347 | "cell_type": "code", 2348 | "execution_count": 95, 2349 | "id": "a913ba15", 2350 | "metadata": { 2351 | "ExecuteTime": { 2352 | "end_time": "2023-02-01T11:21:36.427435Z", 2353 | "start_time": "2023-02-01T11:21:36.412865Z" 2354 | } 2355 | }, 2356 | "outputs": [ 2357 | { 2358 | "data": { 2359 | "text/plain": [ 2360 | "10" 2361 | ] 2362 | }, 2363 | "execution_count": 95, 2364 | "metadata": {}, 2365 | "output_type": "execute_result" 2366 | } 2367 | ], 2368 | "source": [ 2369 | "t[0]" 2370 | ] 2371 | }, 2372 | { 2373 | "cell_type": "code", 2374 | "execution_count": null, 2375 | "id": "bd50381a", 2376 | "metadata": { 2377 | "ExecuteTime": { 2378 | "end_time": "2023-01-30T16:28:26.204332Z", 2379 | "start_time": "2023-01-30T16:28:26.188478Z" 2380 | } 2381 | }, 2382 | "outputs": [], 2383 | "source": [ 2384 | "#Replacing elements" 2385 | ] 2386 | }, 2387 | { 2388 | "cell_type": "code", 2389 | "execution_count": 99, 2390 | "id": "9af3e5b9", 2391 | "metadata": { 2392 | "ExecuteTime": { 2393 | "end_time": "2023-02-01T11:23:41.012926Z", 2394 | "start_time": "2023-02-01T11:23:40.998433Z" 2395 | } 2396 | }, 2397 | "outputs": [ 2398 | { 2399 | "data": { 2400 | "text/plain": [ 2401 | "(10, 20, 10.5, 'python', 10.5)" 2402 | ] 2403 | }, 2404 | "execution_count": 99, 2405 | "metadata": {}, 2406 | "output_type": "execute_result" 2407 | } 2408 | ], 2409 | "source": [ 2410 | "t" 2411 | ] 2412 | }, 2413 | { 2414 | "cell_type": "code", 2415 | "execution_count": 100, 2416 | "id": "862e38c3", 2417 | "metadata": { 2418 | "ExecuteTime": { 2419 | "end_time": "2023-02-01T11:23:56.550193Z", 2420 | "start_time": "2023-02-01T11:23:56.528989Z" 2421 | } 2422 | }, 2423 | "outputs": [ 2424 | { 2425 | "ename": "TypeError", 2426 | "evalue": "'tuple' object does not support item assignment", 2427 | "output_type": "error", 2428 | "traceback": [ 2429 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 2430 | "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", 2431 | "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_53488\\1869328956.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m2000\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 2432 | "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment" 2433 | ] 2434 | } 2435 | ], 2436 | "source": [ 2437 | "t[1] = 2000" 2438 | ] 2439 | }, 2440 | { 2441 | "cell_type": "code", 2442 | "execution_count": 101, 2443 | "id": "68f34c47", 2444 | "metadata": { 2445 | "ExecuteTime": { 2446 | "end_time": "2023-02-01T11:24:36.667784Z", 2447 | "start_time": "2023-02-01T11:24:36.655287Z" 2448 | } 2449 | }, 2450 | "outputs": [ 2451 | { 2452 | "data": { 2453 | "text/plain": [ 2454 | "tuple" 2455 | ] 2456 | }, 2457 | "execution_count": 101, 2458 | "metadata": {}, 2459 | "output_type": "execute_result" 2460 | } 2461 | ], 2462 | "source": [ 2463 | "type(t)" 2464 | ] 2465 | }, 2466 | { 2467 | "cell_type": "code", 2468 | "execution_count": 104, 2469 | "id": "d1c38758", 2470 | "metadata": { 2471 | "ExecuteTime": { 2472 | "end_time": "2023-02-01T11:26:09.141822Z", 2473 | "start_time": "2023-02-01T11:26:09.127569Z" 2474 | } 2475 | }, 2476 | "outputs": [ 2477 | { 2478 | "data": { 2479 | "text/plain": [ 2480 | "[10, 20, 10.5, 'python', 10.5]" 2481 | ] 2482 | }, 2483 | "execution_count": 104, 2484 | "metadata": {}, 2485 | "output_type": "execute_result" 2486 | } 2487 | ], 2488 | "source": [ 2489 | "t1 = list(t)\n", 2490 | "t1\n", 2491 | "type(t1)\n", 2492 | "t1" 2493 | ] 2494 | }, 2495 | { 2496 | "cell_type": "code", 2497 | "execution_count": 105, 2498 | "id": "0606a994", 2499 | "metadata": { 2500 | "ExecuteTime": { 2501 | "end_time": "2023-02-01T11:26:16.948799Z", 2502 | "start_time": "2023-02-01T11:26:16.944986Z" 2503 | } 2504 | }, 2505 | "outputs": [], 2506 | "source": [ 2507 | "t1[1] = 2000" 2508 | ] 2509 | }, 2510 | { 2511 | "cell_type": "code", 2512 | "execution_count": 106, 2513 | "id": "c1463d35", 2514 | "metadata": { 2515 | "ExecuteTime": { 2516 | "end_time": "2023-02-01T11:26:20.266185Z", 2517 | "start_time": "2023-02-01T11:26:20.256542Z" 2518 | } 2519 | }, 2520 | "outputs": [ 2521 | { 2522 | "data": { 2523 | "text/plain": [ 2524 | "[10, 2000, 10.5, 'python', 10.5]" 2525 | ] 2526 | }, 2527 | "execution_count": 106, 2528 | "metadata": {}, 2529 | "output_type": "execute_result" 2530 | } 2531 | ], 2532 | "source": [ 2533 | "t1" 2534 | ] 2535 | }, 2536 | { 2537 | "cell_type": "code", 2538 | "execution_count": 107, 2539 | "id": "b020c463", 2540 | "metadata": { 2541 | "ExecuteTime": { 2542 | "end_time": "2023-02-01T11:26:40.341421Z", 2543 | "start_time": "2023-02-01T11:26:40.331509Z" 2544 | } 2545 | }, 2546 | "outputs": [ 2547 | { 2548 | "data": { 2549 | "text/plain": [ 2550 | "(10, 2000, 10.5, 'python', 10.5)" 2551 | ] 2552 | }, 2553 | "execution_count": 107, 2554 | "metadata": {}, 2555 | "output_type": "execute_result" 2556 | } 2557 | ], 2558 | "source": [ 2559 | "t = tuple(t1)\n", 2560 | "t" 2561 | ] 2562 | }, 2563 | { 2564 | "cell_type": "code", 2565 | "execution_count": 108, 2566 | "id": "377b51f6", 2567 | "metadata": { 2568 | "ExecuteTime": { 2569 | "end_time": "2023-02-01T11:27:01.962442Z", 2570 | "start_time": "2023-02-01T11:27:01.951982Z" 2571 | } 2572 | }, 2573 | "outputs": [ 2574 | { 2575 | "data": { 2576 | "text/plain": [ 2577 | "tuple" 2578 | ] 2579 | }, 2580 | "execution_count": 108, 2581 | "metadata": {}, 2582 | "output_type": "execute_result" 2583 | } 2584 | ], 2585 | "source": [ 2586 | "type(t)" 2587 | ] 2588 | }, 2589 | { 2590 | "cell_type": "markdown", 2591 | "id": "fb3d7af9", 2592 | "metadata": {}, 2593 | "source": [ 2594 | "**Dictionary**\n", 2595 | "\n", 2596 | "- Python dictionaries are ordered collection of items.\n", 2597 | "- Dictionary is mutable data structure.\n", 2598 | "- It has key and value pair." 2599 | ] 2600 | }, 2601 | { 2602 | "cell_type": "code", 2603 | "execution_count": null, 2604 | "id": "5a7874ad", 2605 | "metadata": { 2606 | "ExecuteTime": { 2607 | "end_time": "2023-01-30T16:28:26.220297Z", 2608 | "start_time": "2023-01-30T16:28:26.204332Z" 2609 | } 2610 | }, 2611 | "outputs": [], 2612 | "source": [ 2613 | "#Creating an empty dictionary" 2614 | ] 2615 | }, 2616 | { 2617 | "cell_type": "code", 2618 | "execution_count": 109, 2619 | "id": "027b0252", 2620 | "metadata": { 2621 | "ExecuteTime": { 2622 | "end_time": "2023-02-01T11:36:50.878825Z", 2623 | "start_time": "2023-02-01T11:36:50.859144Z" 2624 | } 2625 | }, 2626 | "outputs": [ 2627 | { 2628 | "data": { 2629 | "text/plain": [ 2630 | "dict" 2631 | ] 2632 | }, 2633 | "execution_count": 109, 2634 | "metadata": {}, 2635 | "output_type": "execute_result" 2636 | } 2637 | ], 2638 | "source": [ 2639 | "d = {}\n", 2640 | "d1 = dict()\n", 2641 | "type(d1)" 2642 | ] 2643 | }, 2644 | { 2645 | "cell_type": "code", 2646 | "execution_count": 111, 2647 | "id": "a282f8f2", 2648 | "metadata": { 2649 | "ExecuteTime": { 2650 | "end_time": "2023-02-01T11:38:24.357701Z", 2651 | "start_time": "2023-02-01T11:38:24.340253Z" 2652 | } 2653 | }, 2654 | "outputs": [ 2655 | { 2656 | "data": { 2657 | "text/plain": [ 2658 | "{'A': 100, 'B': 200, 'C': 300}" 2659 | ] 2660 | }, 2661 | "execution_count": 111, 2662 | "metadata": {}, 2663 | "output_type": "execute_result" 2664 | } 2665 | ], 2666 | "source": [ 2667 | "d = {'A':100,'B':200,'C':300}\n", 2668 | "d" 2669 | ] 2670 | }, 2671 | { 2672 | "cell_type": "code", 2673 | "execution_count": null, 2674 | "id": "5639636a", 2675 | "metadata": { 2676 | "ExecuteTime": { 2677 | "end_time": "2023-01-30T16:28:26.252454Z", 2678 | "start_time": "2023-01-30T16:28:26.236403Z" 2679 | } 2680 | }, 2681 | "outputs": [], 2682 | "source": [ 2683 | "#get" 2684 | ] 2685 | }, 2686 | { 2687 | "cell_type": "code", 2688 | "execution_count": 113, 2689 | "id": "2cfa72e3", 2690 | "metadata": { 2691 | "ExecuteTime": { 2692 | "end_time": "2023-02-01T11:39:21.612695Z", 2693 | "start_time": "2023-02-01T11:39:21.597666Z" 2694 | } 2695 | }, 2696 | "outputs": [ 2697 | { 2698 | "data": { 2699 | "text/plain": [ 2700 | "100" 2701 | ] 2702 | }, 2703 | "execution_count": 113, 2704 | "metadata": {}, 2705 | "output_type": "execute_result" 2706 | } 2707 | ], 2708 | "source": [ 2709 | "d.get('A')" 2710 | ] 2711 | }, 2712 | { 2713 | "cell_type": "code", 2714 | "execution_count": 114, 2715 | "id": "11d4036b", 2716 | "metadata": { 2717 | "ExecuteTime": { 2718 | "end_time": "2023-02-01T11:39:39.710248Z", 2719 | "start_time": "2023-02-01T11:39:39.697555Z" 2720 | } 2721 | }, 2722 | "outputs": [ 2723 | { 2724 | "data": { 2725 | "text/plain": [ 2726 | "300" 2727 | ] 2728 | }, 2729 | "execution_count": 114, 2730 | "metadata": {}, 2731 | "output_type": "execute_result" 2732 | } 2733 | ], 2734 | "source": [ 2735 | "d.get('C')" 2736 | ] 2737 | }, 2738 | { 2739 | "cell_type": "code", 2740 | "execution_count": null, 2741 | "id": "fdeec872", 2742 | "metadata": { 2743 | "ExecuteTime": { 2744 | "end_time": "2023-01-30T16:28:26.268490Z", 2745 | "start_time": "2023-01-30T16:28:26.252454Z" 2746 | } 2747 | }, 2748 | "outputs": [], 2749 | "source": [ 2750 | "#items" 2751 | ] 2752 | }, 2753 | { 2754 | "cell_type": "code", 2755 | "execution_count": 115, 2756 | "id": "300c3556", 2757 | "metadata": { 2758 | "ExecuteTime": { 2759 | "end_time": "2023-02-01T11:39:45.825377Z", 2760 | "start_time": "2023-02-01T11:39:45.808617Z" 2761 | }, 2762 | "scrolled": false 2763 | }, 2764 | "outputs": [ 2765 | { 2766 | "data": { 2767 | "text/plain": [ 2768 | "dict_items([('A', 100), ('B', 200), ('C', 300)])" 2769 | ] 2770 | }, 2771 | "execution_count": 115, 2772 | "metadata": {}, 2773 | "output_type": "execute_result" 2774 | } 2775 | ], 2776 | "source": [ 2777 | "d.items()" 2778 | ] 2779 | }, 2780 | { 2781 | "cell_type": "code", 2782 | "execution_count": null, 2783 | "id": "65a60573", 2784 | "metadata": { 2785 | "ExecuteTime": { 2786 | "end_time": "2023-01-30T16:28:26.284624Z", 2787 | "start_time": "2023-01-30T16:28:26.268490Z" 2788 | } 2789 | }, 2790 | "outputs": [], 2791 | "source": [ 2792 | "#keys" 2793 | ] 2794 | }, 2795 | { 2796 | "cell_type": "code", 2797 | "execution_count": 120, 2798 | "id": "b7d5bcc1", 2799 | "metadata": { 2800 | "ExecuteTime": { 2801 | "end_time": "2023-02-01T11:41:31.130920Z", 2802 | "start_time": "2023-02-01T11:41:31.110721Z" 2803 | } 2804 | }, 2805 | "outputs": [ 2806 | { 2807 | "data": { 2808 | "text/plain": [ 2809 | "'A'" 2810 | ] 2811 | }, 2812 | "execution_count": 120, 2813 | "metadata": {}, 2814 | "output_type": "execute_result" 2815 | } 2816 | ], 2817 | "source": [ 2818 | "list(d.keys())[0]" 2819 | ] 2820 | }, 2821 | { 2822 | "cell_type": "code", 2823 | "execution_count": 121, 2824 | "id": "093b715b", 2825 | "metadata": { 2826 | "ExecuteTime": { 2827 | "end_time": "2023-02-01T11:42:20.450076Z", 2828 | "start_time": "2023-02-01T11:42:20.442264Z" 2829 | } 2830 | }, 2831 | "outputs": [], 2832 | "source": [ 2833 | "#Adding values in dictionary(update)\n", 2834 | "d.update({'D':500})" 2835 | ] 2836 | }, 2837 | { 2838 | "cell_type": "code", 2839 | "execution_count": 122, 2840 | "id": "d3f5e395", 2841 | "metadata": { 2842 | "ExecuteTime": { 2843 | "end_time": "2023-02-01T11:42:22.420901Z", 2844 | "start_time": "2023-02-01T11:42:22.400484Z" 2845 | } 2846 | }, 2847 | "outputs": [ 2848 | { 2849 | "data": { 2850 | "text/plain": [ 2851 | "{'A': 100, 'B': 200, 'C': 300, 'D': 500}" 2852 | ] 2853 | }, 2854 | "execution_count": 122, 2855 | "metadata": {}, 2856 | "output_type": "execute_result" 2857 | } 2858 | ], 2859 | "source": [ 2860 | "d" 2861 | ] 2862 | }, 2863 | { 2864 | "cell_type": "code", 2865 | "execution_count": null, 2866 | "id": "116a2fd3", 2867 | "metadata": { 2868 | "ExecuteTime": { 2869 | "end_time": "2023-01-30T16:28:26.564259Z", 2870 | "start_time": "2023-01-30T16:28:26.564259Z" 2871 | } 2872 | }, 2873 | "outputs": [], 2874 | "source": [ 2875 | "#pop" 2876 | ] 2877 | }, 2878 | { 2879 | "cell_type": "code", 2880 | "execution_count": 124, 2881 | "id": "911dd6c1", 2882 | "metadata": { 2883 | "ExecuteTime": { 2884 | "end_time": "2023-02-01T11:43:41.268890Z", 2885 | "start_time": "2023-02-01T11:43:41.255146Z" 2886 | } 2887 | }, 2888 | "outputs": [ 2889 | { 2890 | "data": { 2891 | "text/plain": [ 2892 | "300" 2893 | ] 2894 | }, 2895 | "execution_count": 124, 2896 | "metadata": {}, 2897 | "output_type": "execute_result" 2898 | } 2899 | ], 2900 | "source": [ 2901 | "d.pop('C')" 2902 | ] 2903 | }, 2904 | { 2905 | "cell_type": "code", 2906 | "execution_count": 125, 2907 | "id": "31f071b3", 2908 | "metadata": { 2909 | "ExecuteTime": { 2910 | "end_time": "2023-02-01T11:43:57.479005Z", 2911 | "start_time": "2023-02-01T11:43:57.462201Z" 2912 | } 2913 | }, 2914 | "outputs": [ 2915 | { 2916 | "data": { 2917 | "text/plain": [ 2918 | "{'A': 100, 'B': 200, 'D': 500}" 2919 | ] 2920 | }, 2921 | "execution_count": 125, 2922 | "metadata": {}, 2923 | "output_type": "execute_result" 2924 | } 2925 | ], 2926 | "source": [ 2927 | "d" 2928 | ] 2929 | }, 2930 | { 2931 | "cell_type": "code", 2932 | "execution_count": null, 2933 | "id": "1e002393", 2934 | "metadata": { 2935 | "ExecuteTime": { 2936 | "end_time": "2023-01-30T16:28:26.566772Z", 2937 | "start_time": "2023-01-30T16:28:26.566772Z" 2938 | } 2939 | }, 2940 | "outputs": [], 2941 | "source": [ 2942 | "#values" 2943 | ] 2944 | }, 2945 | { 2946 | "cell_type": "code", 2947 | "execution_count": 126, 2948 | "id": "702021e4", 2949 | "metadata": { 2950 | "ExecuteTime": { 2951 | "end_time": "2023-02-01T11:44:17.220623Z", 2952 | "start_time": "2023-02-01T11:44:17.208701Z" 2953 | } 2954 | }, 2955 | "outputs": [ 2956 | { 2957 | "data": { 2958 | "text/plain": [ 2959 | "dict_values([100, 200, 500])" 2960 | ] 2961 | }, 2962 | "execution_count": 126, 2963 | "metadata": {}, 2964 | "output_type": "execute_result" 2965 | } 2966 | ], 2967 | "source": [ 2968 | "d.values()" 2969 | ] 2970 | }, 2971 | { 2972 | "cell_type": "markdown", 2973 | "id": "da0825b4", 2974 | "metadata": {}, 2975 | "source": [ 2976 | "**Set**\n", 2977 | "\n", 2978 | "- Set is a collection which is unordered,unindexed.\n", 2979 | "- Set is immutable.\n", 2980 | "- Sets are unordered, so you cannot be sure in which order the items will appear.\n", 2981 | "- Sets do not allow duplicate values.\n", 2982 | "- Once a set is created, you cannot change its items, but you can remove items and add new items.\n", 2983 | "- As sets are unordered, they do not support indexing and slicing operations." 2984 | ] 2985 | }, 2986 | { 2987 | "cell_type": "code", 2988 | "execution_count": 129, 2989 | "id": "f77bace1", 2990 | "metadata": { 2991 | "ExecuteTime": { 2992 | "end_time": "2023-02-01T11:47:40.666885Z", 2993 | "start_time": "2023-02-01T11:47:40.654416Z" 2994 | } 2995 | }, 2996 | "outputs": [ 2997 | { 2998 | "data": { 2999 | "text/plain": [ 3000 | "{1, 2, 3, 4, 10.5}" 3001 | ] 3002 | }, 3003 | "execution_count": 129, 3004 | "metadata": {}, 3005 | "output_type": "execute_result" 3006 | } 3007 | ], 3008 | "source": [ 3009 | "#creating an empty set\n", 3010 | "\n", 3011 | "s = {1,2,3,4,10.5}\n", 3012 | "s" 3013 | ] 3014 | }, 3015 | { 3016 | "cell_type": "code", 3017 | "execution_count": 130, 3018 | "id": "d5c148cf", 3019 | "metadata": { 3020 | "ExecuteTime": { 3021 | "end_time": "2023-02-01T11:48:27.455332Z", 3022 | "start_time": "2023-02-01T11:48:27.449297Z" 3023 | } 3024 | }, 3025 | "outputs": [ 3026 | { 3027 | "data": { 3028 | "text/plain": [ 3029 | "{1, 2, 3, 4, 5}" 3030 | ] 3031 | }, 3032 | "execution_count": 130, 3033 | "metadata": {}, 3034 | "output_type": "execute_result" 3035 | } 3036 | ], 3037 | "source": [ 3038 | "#Does not allow duplicate items\n", 3039 | "s = {1,1,2,3,4,5,5}\n", 3040 | "s" 3041 | ] 3042 | }, 3043 | { 3044 | "cell_type": "code", 3045 | "execution_count": 132, 3046 | "id": "037e0a3f", 3047 | "metadata": { 3048 | "ExecuteTime": { 3049 | "end_time": "2023-02-01T11:49:18.420805Z", 3050 | "start_time": "2023-02-01T11:49:18.407165Z" 3051 | } 3052 | }, 3053 | "outputs": [ 3054 | { 3055 | "ename": "TypeError", 3056 | "evalue": "'set' object is not subscriptable", 3057 | "output_type": "error", 3058 | "traceback": [ 3059 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 3060 | "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", 3061 | "\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_53488\\2875943081.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m#Does not support indexing\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0ms\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 3062 | "\u001b[1;31mTypeError\u001b[0m: 'set' object is not subscriptable" 3063 | ] 3064 | } 3065 | ], 3066 | "source": [ 3067 | "#Does not support indexing\n", 3068 | "s[2]" 3069 | ] 3070 | }, 3071 | { 3072 | "cell_type": "code", 3073 | "execution_count": 133, 3074 | "id": "8e54da96", 3075 | "metadata": { 3076 | "ExecuteTime": { 3077 | "end_time": "2023-02-01T11:49:52.841990Z", 3078 | "start_time": "2023-02-01T11:49:52.824706Z" 3079 | } 3080 | }, 3081 | "outputs": [ 3082 | { 3083 | "data": { 3084 | "text/plain": [ 3085 | "{1, 2, 3, 4, 5}" 3086 | ] 3087 | }, 3088 | "execution_count": 133, 3089 | "metadata": {}, 3090 | "output_type": "execute_result" 3091 | } 3092 | ], 3093 | "source": [ 3094 | "s" 3095 | ] 3096 | }, 3097 | { 3098 | "cell_type": "code", 3099 | "execution_count": 134, 3100 | "id": "e982d040", 3101 | "metadata": { 3102 | "ExecuteTime": { 3103 | "end_time": "2023-02-01T11:49:58.726288Z", 3104 | "start_time": "2023-02-01T11:49:58.716783Z" 3105 | } 3106 | }, 3107 | "outputs": [ 3108 | { 3109 | "data": { 3110 | "text/plain": [ 3111 | "{1, 2, 3, 4, 5, 100}" 3112 | ] 3113 | }, 3114 | "execution_count": 134, 3115 | "metadata": {}, 3116 | "output_type": "execute_result" 3117 | } 3118 | ], 3119 | "source": [ 3120 | "#Add\n", 3121 | "s.add(100)\n", 3122 | "s" 3123 | ] 3124 | }, 3125 | { 3126 | "cell_type": "code", 3127 | "execution_count": 135, 3128 | "id": "8c391c81", 3129 | "metadata": { 3130 | "ExecuteTime": { 3131 | "end_time": "2023-02-01T11:50:50.129777Z", 3132 | "start_time": "2023-02-01T11:50:50.112600Z" 3133 | } 3134 | }, 3135 | "outputs": [], 3136 | "source": [ 3137 | "a = {'apple','mango','cherry'}\n", 3138 | "b = {'microsoft','google','cherry'}" 3139 | ] 3140 | }, 3141 | { 3142 | "cell_type": "code", 3143 | "execution_count": null, 3144 | "id": "9ce516fe", 3145 | "metadata": { 3146 | "ExecuteTime": { 3147 | "end_time": "2023-01-30T16:28:26.580091Z", 3148 | "start_time": "2023-01-30T16:28:26.580091Z" 3149 | } 3150 | }, 3151 | "outputs": [], 3152 | "source": [ 3153 | "#Difference" 3154 | ] 3155 | }, 3156 | { 3157 | "cell_type": "code", 3158 | "execution_count": 136, 3159 | "id": "49bae41c", 3160 | "metadata": { 3161 | "ExecuteTime": { 3162 | "end_time": "2023-02-01T11:51:04.538201Z", 3163 | "start_time": "2023-02-01T11:51:04.520635Z" 3164 | } 3165 | }, 3166 | "outputs": [ 3167 | { 3168 | "data": { 3169 | "text/plain": [ 3170 | "{'apple', 'mango'}" 3171 | ] 3172 | }, 3173 | "execution_count": 136, 3174 | "metadata": {}, 3175 | "output_type": "execute_result" 3176 | } 3177 | ], 3178 | "source": [ 3179 | "a.difference(b)" 3180 | ] 3181 | }, 3182 | { 3183 | "cell_type": "code", 3184 | "execution_count": 137, 3185 | "id": "33654d08", 3186 | "metadata": { 3187 | "ExecuteTime": { 3188 | "end_time": "2023-02-01T11:51:34.183706Z", 3189 | "start_time": "2023-02-01T11:51:34.161811Z" 3190 | } 3191 | }, 3192 | "outputs": [ 3193 | { 3194 | "data": { 3195 | "text/plain": [ 3196 | "{'google', 'microsoft'}" 3197 | ] 3198 | }, 3199 | "execution_count": 137, 3200 | "metadata": {}, 3201 | "output_type": "execute_result" 3202 | } 3203 | ], 3204 | "source": [ 3205 | "b.difference(a)" 3206 | ] 3207 | }, 3208 | { 3209 | "cell_type": "code", 3210 | "execution_count": null, 3211 | "id": "44760b14", 3212 | "metadata": { 3213 | "ExecuteTime": { 3214 | "end_time": "2023-01-30T16:28:26.582437Z", 3215 | "start_time": "2023-01-30T16:28:26.582437Z" 3216 | } 3217 | }, 3218 | "outputs": [], 3219 | "source": [ 3220 | "#intersection" 3221 | ] 3222 | }, 3223 | { 3224 | "cell_type": "code", 3225 | "execution_count": 138, 3226 | "id": "f6bf3700", 3227 | "metadata": { 3228 | "ExecuteTime": { 3229 | "end_time": "2023-02-01T11:52:04.619648Z", 3230 | "start_time": "2023-02-01T11:52:04.603767Z" 3231 | } 3232 | }, 3233 | "outputs": [ 3234 | { 3235 | "data": { 3236 | "text/plain": [ 3237 | "{'cherry'}" 3238 | ] 3239 | }, 3240 | "execution_count": 138, 3241 | "metadata": {}, 3242 | "output_type": "execute_result" 3243 | } 3244 | ], 3245 | "source": [ 3246 | "a.intersection(b)" 3247 | ] 3248 | }, 3249 | { 3250 | "cell_type": "code", 3251 | "execution_count": null, 3252 | "id": "124bfbb4", 3253 | "metadata": { 3254 | "ExecuteTime": { 3255 | "end_time": "2023-01-30T16:28:26.584680Z", 3256 | "start_time": "2023-01-30T16:28:26.584680Z" 3257 | } 3258 | }, 3259 | "outputs": [], 3260 | "source": [ 3261 | "#union" 3262 | ] 3263 | }, 3264 | { 3265 | "cell_type": "code", 3266 | "execution_count": 139, 3267 | "id": "23441104", 3268 | "metadata": { 3269 | "ExecuteTime": { 3270 | "end_time": "2023-02-01T11:52:32.386241Z", 3271 | "start_time": "2023-02-01T11:52:32.369575Z" 3272 | } 3273 | }, 3274 | "outputs": [ 3275 | { 3276 | "data": { 3277 | "text/plain": [ 3278 | "{'apple', 'cherry', 'google', 'mango', 'microsoft'}" 3279 | ] 3280 | }, 3281 | "execution_count": 139, 3282 | "metadata": {}, 3283 | "output_type": "execute_result" 3284 | } 3285 | ], 3286 | "source": [ 3287 | "a.union(b)" 3288 | ] 3289 | }, 3290 | { 3291 | "cell_type": "code", 3292 | "execution_count": null, 3293 | "id": "de5eded3", 3294 | "metadata": { 3295 | "ExecuteTime": { 3296 | "end_time": "2023-01-30T16:28:26.585680Z", 3297 | "start_time": "2023-01-30T16:28:26.585680Z" 3298 | } 3299 | }, 3300 | "outputs": [], 3301 | "source": [ 3302 | "#pop" 3303 | ] 3304 | }, 3305 | { 3306 | "cell_type": "code", 3307 | "execution_count": 140, 3308 | "id": "a7c2f0aa", 3309 | "metadata": { 3310 | "ExecuteTime": { 3311 | "end_time": "2023-02-01T11:52:50.018753Z", 3312 | "start_time": "2023-02-01T11:52:50.005204Z" 3313 | } 3314 | }, 3315 | "outputs": [ 3316 | { 3317 | "data": { 3318 | "text/plain": [ 3319 | "1" 3320 | ] 3321 | }, 3322 | "execution_count": 140, 3323 | "metadata": {}, 3324 | "output_type": "execute_result" 3325 | } 3326 | ], 3327 | "source": [ 3328 | "s.pop()" 3329 | ] 3330 | }, 3331 | { 3332 | "cell_type": "code", 3333 | "execution_count": null, 3334 | "id": "7560c068", 3335 | "metadata": {}, 3336 | "outputs": [], 3337 | "source": [] 3338 | } 3339 | ], 3340 | "metadata": { 3341 | "_draft": { 3342 | "nbviewer_url": "https://gist.github.com/c7e48d2b0f85e662ce272c77589a4f43" 3343 | }, 3344 | "gist": { 3345 | "data": { 3346 | "description": "ExcelR/Python_Basics.ipynb", 3347 | "public": true 3348 | }, 3349 | "id": "c7e48d2b0f85e662ce272c77589a4f43" 3350 | }, 3351 | "kernelspec": { 3352 | "display_name": "Python 3 (ipykernel)", 3353 | "language": "python", 3354 | "name": "python3" 3355 | }, 3356 | "language_info": { 3357 | "codemirror_mode": { 3358 | "name": "ipython", 3359 | "version": 3 3360 | }, 3361 | "file_extension": ".py", 3362 | "mimetype": "text/x-python", 3363 | "name": "python", 3364 | "nbconvert_exporter": "python", 3365 | "pygments_lexer": "ipython3", 3366 | "version": "3.9.13" 3367 | } 3368 | }, 3369 | "nbformat": 4, 3370 | "nbformat_minor": 5 3371 | } 3372 | -------------------------------------------------------------------------------- /Statistics/ANOVA and Chi2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "d240c5bf", 6 | "metadata": {}, 7 | "source": [ 8 | "# Anova Test" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "3e23740b", 15 | "metadata": { 16 | "ExecuteTime": { 17 | "end_time": "2023-10-26T04:04:56.726743Z", 18 | "start_time": "2023-10-26T04:04:52.018100Z" 19 | } 20 | }, 21 | "outputs": [], 22 | "source": [ 23 | "#Import scipy.stats\n", 24 | "from scipy import stats\n", 25 | "import pandas as pd" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 18, 31 | "id": "c34fc108", 32 | "metadata": { 33 | "ExecuteTime": { 34 | "end_time": "2023-10-26T04:22:12.358466Z", 35 | "start_time": "2023-10-26T04:22:12.213493Z" 36 | } 37 | }, 38 | "outputs": [ 39 | { 40 | "data": { 41 | "text/html": [ 42 | "
\n", 43 | "\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 | "
SepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
Id
15.13.51.40.2Iris-setosa
24.93.01.40.2Iris-setosa
34.73.21.30.2Iris-setosa
44.63.11.50.2Iris-setosa
55.03.61.40.2Iris-setosa
..................
1466.73.05.22.3Iris-virginica
1476.32.55.01.9Iris-virginica
1486.53.05.22.0Iris-virginica
1496.23.45.42.3Iris-virginica
1505.93.05.11.8Iris-virginica
\n", 166 | "

150 rows × 5 columns

\n", 167 | "
" 168 | ], 169 | "text/plain": [ 170 | " SepalLengthCm SepalWidthCm PetalLengthCm PetalWidthCm Species\n", 171 | "Id \n", 172 | "1 5.1 3.5 1.4 0.2 Iris-setosa\n", 173 | "2 4.9 3.0 1.4 0.2 Iris-setosa\n", 174 | "3 4.7 3.2 1.3 0.2 Iris-setosa\n", 175 | "4 4.6 3.1 1.5 0.2 Iris-setosa\n", 176 | "5 5.0 3.6 1.4 0.2 Iris-setosa\n", 177 | ".. ... ... ... ... ...\n", 178 | "146 6.7 3.0 5.2 2.3 Iris-virginica\n", 179 | "147 6.3 2.5 5.0 1.9 Iris-virginica\n", 180 | "148 6.5 3.0 5.2 2.0 Iris-virginica\n", 181 | "149 6.2 3.4 5.4 2.3 Iris-virginica\n", 182 | "150 5.9 3.0 5.1 1.8 Iris-virginica\n", 183 | "\n", 184 | "[150 rows x 5 columns]" 185 | ] 186 | }, 187 | "execution_count": 18, 188 | "metadata": {}, 189 | "output_type": "execute_result" 190 | } 191 | ], 192 | "source": [ 193 | "df = pd.read_csv('https://raw.githubusercontent.com/aishwaryamate/Datasets/main/Iris.csv',\n", 194 | " index_col=0)\n", 195 | "df" 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "execution_count": 7, 201 | "id": "c47815f3", 202 | "metadata": { 203 | "ExecuteTime": { 204 | "end_time": "2023-10-26T04:09:22.168974Z", 205 | "start_time": "2023-10-26T04:09:22.142645Z" 206 | } 207 | }, 208 | "outputs": [ 209 | { 210 | "data": { 211 | "text/plain": [ 212 | "Id\n", 213 | "1 5.1\n", 214 | "2 4.9\n", 215 | "3 4.7\n", 216 | "4 4.6\n", 217 | "5 5.0\n", 218 | " ... \n", 219 | "146 6.7\n", 220 | "147 6.3\n", 221 | "148 6.5\n", 222 | "149 6.2\n", 223 | "150 5.9\n", 224 | "Name: SepalLengthCm, Length: 150, dtype: float64" 225 | ] 226 | }, 227 | "execution_count": 7, 228 | "metadata": {}, 229 | "output_type": "execute_result" 230 | } 231 | ], 232 | "source": [ 233 | "df['SepalLengthCm']" 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": 9, 239 | "id": "b9b92ebb", 240 | "metadata": { 241 | "ExecuteTime": { 242 | "end_time": "2023-10-26T04:15:29.581459Z", 243 | "start_time": "2023-10-26T04:15:29.573063Z" 244 | } 245 | }, 246 | "outputs": [], 247 | "source": [ 248 | "f ,p = stats.f_oneway(df['SepalWidthCm'],df['SepalLengthCm'],df['PetalLengthCm'],\n", 249 | " df['PetalWidthCm'])" 250 | ] 251 | }, 252 | { 253 | "cell_type": "code", 254 | "execution_count": 10, 255 | "id": "72aa2cdc", 256 | "metadata": { 257 | "ExecuteTime": { 258 | "end_time": "2023-10-26T04:15:53.282712Z", 259 | "start_time": "2023-10-26T04:15:53.253096Z" 260 | } 261 | }, 262 | "outputs": [ 263 | { 264 | "name": "stdout", 265 | "output_type": "stream", 266 | "text": [ 267 | "Reject Null Hypothesis. At least one sample is different.\n" 268 | ] 269 | } 270 | ], 271 | "source": [ 272 | "if p < 0.05:\n", 273 | " print('Reject Null Hypothesis. At least one sample is different.')\n", 274 | "else:\n", 275 | " print('Fail to reject Null Hypothesis.')" 276 | ] 277 | }, 278 | { 279 | "cell_type": "markdown", 280 | "id": "ca2ae8e2", 281 | "metadata": { 282 | "ExecuteTime": { 283 | "end_time": "2023-03-23T09:28:24.236578Z", 284 | "start_time": "2023-03-23T09:28:24.229722Z" 285 | } 286 | }, 287 | "source": [ 288 | "# Chi-Square test" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": 19, 294 | "id": "4257de88", 295 | "metadata": { 296 | "ExecuteTime": { 297 | "end_time": "2023-10-26T04:52:02.874045Z", 298 | "start_time": "2023-10-26T04:52:02.854947Z" 299 | } 300 | }, 301 | "outputs": [], 302 | "source": [ 303 | "from scipy.stats import chi2_contingency" 304 | ] 305 | }, 306 | { 307 | "cell_type": "code", 308 | "execution_count": 21, 309 | "id": "547616f6", 310 | "metadata": { 311 | "ExecuteTime": { 312 | "end_time": "2023-10-26T04:52:34.563817Z", 313 | "start_time": "2023-10-26T04:52:34.515576Z" 314 | }, 315 | "collapsed": true 316 | }, 317 | "outputs": [ 318 | { 319 | "data": { 320 | "text/html": [ 321 | "
\n", 322 | "\n", 335 | "\n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \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 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \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 | "
AthleteSmoker
0Yyes
1Yyes
2Yno
3Yno
4Yyes
5Yno
6Yyes
7Yno
8Yno
9Yno
10Yno
11Yno
12Yno
13Yno
14Yno
15Yno
16Yno
17Yno
18Nyes
19Nyes
20Nyes
21Nyes
22Nyes
23Nyes
24Nyes
25Nyes
26Nyes
27Nyes
\n", 486 | "
" 487 | ], 488 | "text/plain": [ 489 | " Athlete Smoker\n", 490 | "0 Y yes\n", 491 | "1 Y yes\n", 492 | "2 Y no\n", 493 | "3 Y no\n", 494 | "4 Y yes\n", 495 | "5 Y no\n", 496 | "6 Y yes\n", 497 | "7 Y no\n", 498 | "8 Y no\n", 499 | "9 Y no\n", 500 | "10 Y no\n", 501 | "11 Y no\n", 502 | "12 Y no\n", 503 | "13 Y no\n", 504 | "14 Y no\n", 505 | "15 Y no\n", 506 | "16 Y no\n", 507 | "17 Y no\n", 508 | "18 N yes\n", 509 | "19 N yes\n", 510 | "20 N yes\n", 511 | "21 N yes\n", 512 | "22 N yes\n", 513 | "23 N yes\n", 514 | "24 N yes\n", 515 | "25 N yes\n", 516 | "26 N yes\n", 517 | "27 N yes" 518 | ] 519 | }, 520 | "execution_count": 21, 521 | "metadata": {}, 522 | "output_type": "execute_result" 523 | } 524 | ], 525 | "source": [ 526 | "df = pd.read_csv('chi2.csv', index_col=0)\n", 527 | "df" 528 | ] 529 | }, 530 | { 531 | "cell_type": "code", 532 | "execution_count": 22, 533 | "id": "0f9c6743", 534 | "metadata": { 535 | "ExecuteTime": { 536 | "end_time": "2023-10-26T04:54:39.107434Z", 537 | "start_time": "2023-10-26T04:54:38.949678Z" 538 | } 539 | }, 540 | "outputs": [ 541 | { 542 | "data": { 543 | "text/html": [ 544 | "
\n", 545 | "\n", 558 | "\n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | "
Smokernoyes
Athlete
N010
Y144
\n", 584 | "
" 585 | ], 586 | "text/plain": [ 587 | "Smoker no yes\n", 588 | "Athlete \n", 589 | "N 0 10\n", 590 | "Y 14 4" 591 | ] 592 | }, 593 | "execution_count": 22, 594 | "metadata": {}, 595 | "output_type": "execute_result" 596 | } 597 | ], 598 | "source": [ 599 | "obs = pd.crosstab(index=df['Athlete'],columns=df['Smoker'])\n", 600 | "obs" 601 | ] 602 | }, 603 | { 604 | "cell_type": "code", 605 | "execution_count": 24, 606 | "id": "f36dc153", 607 | "metadata": { 608 | "ExecuteTime": { 609 | "end_time": "2023-10-26T04:56:24.412521Z", 610 | "start_time": "2023-10-26T04:56:24.392131Z" 611 | } 612 | }, 613 | "outputs": [], 614 | "source": [ 615 | "chi2,p,df,exp = chi2_contingency(obs)" 616 | ] 617 | }, 618 | { 619 | "cell_type": "code", 620 | "execution_count": 25, 621 | "id": "31440c24", 622 | "metadata": { 623 | "ExecuteTime": { 624 | "end_time": "2023-10-26T04:56:26.384481Z", 625 | "start_time": "2023-10-26T04:56:26.363595Z" 626 | } 627 | }, 628 | "outputs": [ 629 | { 630 | "data": { 631 | "text/plain": [ 632 | "(12.6, 1)" 633 | ] 634 | }, 635 | "execution_count": 25, 636 | "metadata": {}, 637 | "output_type": "execute_result" 638 | } 639 | ], 640 | "source": [ 641 | "chi2, df" 642 | ] 643 | }, 644 | { 645 | "cell_type": "code", 646 | "execution_count": 26, 647 | "id": "7300ed85", 648 | "metadata": { 649 | "ExecuteTime": { 650 | "end_time": "2023-10-26T04:56:30.504314Z", 651 | "start_time": "2023-10-26T04:56:30.484077Z" 652 | } 653 | }, 654 | "outputs": [ 655 | { 656 | "data": { 657 | "text/plain": [ 658 | "0.00038574675568200776" 659 | ] 660 | }, 661 | "execution_count": 26, 662 | "metadata": {}, 663 | "output_type": "execute_result" 664 | } 665 | ], 666 | "source": [ 667 | "p" 668 | ] 669 | }, 670 | { 671 | "cell_type": "code", 672 | "execution_count": 27, 673 | "id": "7e13f003", 674 | "metadata": { 675 | "ExecuteTime": { 676 | "end_time": "2023-10-26T04:56:58.550979Z", 677 | "start_time": "2023-10-26T04:56:58.529819Z" 678 | } 679 | }, 680 | "outputs": [ 681 | { 682 | "name": "stdout", 683 | "output_type": "stream", 684 | "text": [ 685 | "Reject Null Hypothesis.Columns are dependent on each other.\n" 686 | ] 687 | } 688 | ], 689 | "source": [ 690 | "if p < 0.05:\n", 691 | " print('Reject Null Hypothesis.Columns are dependent on each other.')\n", 692 | "else:\n", 693 | " print('Fail to reject null hypothesis.')" 694 | ] 695 | }, 696 | { 697 | "cell_type": "code", 698 | "execution_count": 29, 699 | "id": "7ff2d0f9", 700 | "metadata": { 701 | "ExecuteTime": { 702 | "end_time": "2023-10-26T04:57:56.970119Z", 703 | "start_time": "2023-10-26T04:57:56.952611Z" 704 | } 705 | }, 706 | "outputs": [ 707 | { 708 | "data": { 709 | "text/plain": [ 710 | "0.0003857467556820371" 711 | ] 712 | }, 713 | "execution_count": 29, 714 | "metadata": {}, 715 | "output_type": "execute_result" 716 | } 717 | ], 718 | "source": [ 719 | "1 - stats.chi2.cdf(12.6,1)" 720 | ] 721 | }, 722 | { 723 | "cell_type": "code", 724 | "execution_count": null, 725 | "id": "05f9b5ef", 726 | "metadata": {}, 727 | "outputs": [], 728 | "source": [] 729 | } 730 | ], 731 | "metadata": { 732 | "kernelspec": { 733 | "display_name": "Python 3 (ipykernel)", 734 | "language": "python", 735 | "name": "python3" 736 | }, 737 | "language_info": { 738 | "codemirror_mode": { 739 | "name": "ipython", 740 | "version": 3 741 | }, 742 | "file_extension": ".py", 743 | "mimetype": "text/x-python", 744 | "name": "python", 745 | "nbconvert_exporter": "python", 746 | "pygments_lexer": "ipython3", 747 | "version": "3.9.13" 748 | } 749 | }, 750 | "nbformat": 4, 751 | "nbformat_minor": 5 752 | } 753 | -------------------------------------------------------------------------------- /Statistics/CDF.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "attachments": { 5 | "CDF.png": { 6 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAvAAAAEpCAYAAAD1fxYAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAGOXSURBVHhe7d0LXBTl/j/wT8eKjnXw1yntBqWBWWCWa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/Sxej4RERERNX8tJ4A/tT38zcniXXX3xKwqLkKengpFgFlpxltU7Mo3p9wgpSFvS9OVZXyCxuKpd/Lw5c6d+DIvC2vT5yDhjhGIuNgPVZXltvWJiIiIqNlrOQG8TzCCzPKMObkf11HdpQpb3s+0TbYNQuezbJPeoQI7d5iTbqjMz0bWPpkKwrQ50xEV0B4+LirRlJbUPvIrERERETUvLSiFpj2uuXGILbd93Rws2Og6hJdBnBKX2tJQAicORYjL0orHQnv4n29Orst3Wd6yanMaFpuVdtxRVfW7OaXOb2p7n2WZmP08h2AlIiIi8hYtKgfed9BUzOonIXwZUmMjMH5RIUp1C7RSVYHtqxIw3EwpQcBYPHar4+iqx1qP8FG2E5CyuZg8IxPbrc6ldtte2tb97rftQ/oiRE8VIWnGXOR9ezh/vqqyDAXLEzA4MgE51j4iIiIiomavZXVibeOHkU9nYda1UgW+Etkp0biqqznw00VhGHyvCopVsCr54Etemo4Qa5TWZsKn9wQ8daOtNmaxCtgH93Dc9uKOE/DS02YNe3ecNwL33x2kTwqqNi9ETETX6kGwLrw0AsMfVPvDZyBmpSciUj8gHyVsjCciIiJq1lpWAC/aBiB2wRZsWpmEuEFBaG8F6W3bI3jQKBWs5uCzrOmIONZjLLnUHpGPZ2NT+nRE9Q4wB6PyQfuggYhTJyabsqYgpJ2e6SYfhEzJwocqQI91tS9Ss/HZpmcQ2zscod1lQRWy84v0KkRERETUPB1nKOY0ERERERE1cy2vBZ6IiIiIqAVjAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5EQbwRERERERehAE8EREREZEXYQBPRERERORFGMATEREREXkRBvBERERERF6EATwRERERkRdhAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5EQbwRERERERehAE8EREREZEXYQBPRERERORFGMATEREREXkRBvBERERERF6EATwRERERkRdhAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5EQbwRERERERehAE8EREREZEXYQBPRERERORFGMATEREREXkRBvBERERERF6EATwRERERkRdhAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5EQbwRERERERehAE8EREREZEXYQBPRERERORFGMATEREREXkRBvBERERERF6EATwRERERkRdhAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5EQbwRERERERehAE8EREREZEXYQBPROSh9PR0DBs2DGvXrjXnHB1//PEHoqKicOONN6KkpMScS95m/fr1GD58ON544w1zDrVEmzdvxg033IAXXnjBnEPUdBjAExF54LnnnsMDDzyAjz/+GLt27TLnHh1//vknzj77bLz66qsYPHgwtm3bZi4hb7F48WJMmDAB+fn5KC0tNedSS3TcccehoKAAY8aMwf3334+//vrLXELUeG1mKuY0EVGDyB8m+WPV0i1fvhwrVqzA1q1bMXnyZNx3333mkqPj73//O0JCQvDBBx/g888/R1lZGS688EKcddZZ5hpUm99//x2HDh3SJ0Gubnv27NHryfTBgwf1utb/cjtw4ABOOOEEvU5DyfHz0ksv4bPPPsM999yD6dOnm0vqJ1df9u3bh7/97W/6u2YYhr7Jtsn3zwoOq6qqsH//frRp00ava0/eozyP3E488US9jjN5/03xXgn6ZHvv3r3IycnBhx9+iNNOOw2XX365uZSocY5TPwCGOU1E5DEJGJKSknRLU1OToETaGC677DJzzrEjQXN8fLwO3keNGoXnn38ebdu2NZceXe+//z5uueUW/PDDD5g0aRJuvfVWdO/e3VxKzv7f//t/en/Vx/nPof19CZrPPPNMDBgwAD169EDHjh3NJe6RAE5a3uWqSUxMDBYuXAhfX19zaf2eeOIJ5Obm4vjjj9dBu0UCbfmeWPPkvgTgN998sz5OLVu2bMFDDz1UHZhbQb+Pj49e3yLvU04S2bbXNOQkUD4HOfGXgD4xMRF33HGHuZSoESSAJyJqKBWQGBdccIFEOkfk9u9//9t8pWNn06ZNRt++ffX2qJMJ45133jGXHDuPPPJI9T66//77DXUiZS4hZ5s3b27SY1QF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2CjH63/WM8d4u+1JeVlmyYmPb8xOM/iG29YZNXWZssS+HdrDc+GietTzQ6NZ/tPFQRoFRXi7lCwONYRlm+TezFNlHpeuNh0aEGl30No9T78G+zJvnZSQNeb5hIfq1u8yxm2+WypPybR+5VaFsv3qf44zLpNyf2mdvlDtvi6Xm/PK8Z4y7+tu2oWPIIOOWB9Q++rHceOsedd+upNp3b840hun9FGw8ab+pllJbqcQ6S0bqkoG216+rrKSUZ5Ptuc6+bOfBPLP03TJjpzlLa6oykk24r2yKjaVD1Xwpd2nOcbC32Hgj+fCx1yV0qHHXvDyjvI79IjzbBhfMsqT2ZTkt+79aWX18dwwONa6T71XxHmPbwnC7Y9FFKUCH75Ht+/hReanefzXWe36KMSxUyiFa27/S2Oa8IQ6cv0c2+7+y/w0INi67boIx/0PHT9DYlaPWGWp+L1z/znz3brJx13Xme5bnGTHTeGV7nRukPjv12zXOfMy41WoLXXy3Naf5Hv3e1Pztq22+M3d/H2tuby3cPFbtjx/5fZyfV1Dzs3PnWPHwd7muMpI1Pyub+veRk73q96eW8pP6t7qP+vtgX0KUqJk7Tv7RkXwLdeDAASxcuBDHH3+8nKzoeSeeeCJU0K7n/f3vf8ett96q55ObZOTM6DTdCY3D39dGRmoNQ+IFK/Hl9Lo7iRERNU+237Hp6nfsG/6OETUrLT6ApyOAAXz9SjIwfEAaIrJyEF9XShERUbPFAJ6ouWp1ZSSJjqTKzRmYPXcWYqJnoSB8QtOV7yMiIiIyMYAnakp7ipA+PwPbOo7FksdG1F5Ok4iIiKiBmEJDRERERORF2AJPRERERORFGMATEREREXkRBvBERERERF6EATwRERERkRdhAE9ERERE5EUYwBMREREReREG8EREREREXoQBPBERERGRF2EAT0RERETkRRjAExERERF5DeD/A3g9WX8o88pyAAAAAElFTkSuQmCC" 7 | } 8 | }, 9 | "cell_type": "markdown", 10 | "id": "de21afb0", 11 | "metadata": {}, 12 | "source": [ 13 | "# Cumulative Distribution Function(CDF)\n", 14 | "\n", 15 | "- The CDF of a random variable 'X' may be defined as the probability that the random variable 'X' takes a value \"less than or equal to x\".\n", 16 | "\n", 17 | "![CDF.png](attachment:CDF.png)" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 1, 23 | "id": "42ff1d25", 24 | "metadata": { 25 | "ExecuteTime": { 26 | "end_time": "2023-10-19T04:19:30.579919Z", 27 | "start_time": "2023-10-19T04:19:28.030066Z" 28 | } 29 | }, 30 | "outputs": [], 31 | "source": [ 32 | "from scipy import stats" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 2, 38 | "id": "4ce37452", 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "0.8413447460685429" 45 | ] 46 | }, 47 | "execution_count": 2, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "stats.norm.cdf(70,60,10)" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": 3, 59 | "id": "9c794733", 60 | "metadata": {}, 61 | "outputs": [ 62 | { 63 | "data": { 64 | "text/plain": [ 65 | "0.15865525393145707" 66 | ] 67 | }, 68 | "execution_count": 3, 69 | "metadata": {}, 70 | "output_type": "execute_result" 71 | } 72 | ], 73 | "source": [ 74 | "1 - stats.norm.cdf(70,60,10)" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": 4, 80 | "id": "4ec1f3ed", 81 | "metadata": {}, 82 | "outputs": [ 83 | { 84 | "data": { 85 | "text/plain": [ 86 | "0.14254260383881612" 87 | ] 88 | }, 89 | "execution_count": 4, 90 | "metadata": {}, 91 | "output_type": "execute_result" 92 | } 93 | ], 94 | "source": [ 95 | "stats.norm.cdf(680,711,29)" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": 5, 101 | "id": "2bc3b479", 102 | "metadata": {}, 103 | "outputs": [ 104 | { 105 | "data": { 106 | "text/plain": [ 107 | "0.8413447460685429" 108 | ] 109 | }, 110 | "execution_count": 5, 111 | "metadata": {}, 112 | "output_type": "execute_result" 113 | } 114 | ], 115 | "source": [ 116 | "stats.norm.cdf(740,711,29)" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 6, 122 | "id": "d3f39cad", 123 | "metadata": {}, 124 | "outputs": [ 125 | { 126 | "data": { 127 | "text/plain": [ 128 | "0.31463356742704107" 129 | ] 130 | }, 131 | "execution_count": 6, 132 | "metadata": {}, 133 | "output_type": "execute_result" 134 | } 135 | ], 136 | "source": [ 137 | "stats.norm.cdf(697,711,29)" 138 | ] 139 | }, 140 | { 141 | "cell_type": "code", 142 | "execution_count": 8, 143 | "id": "ac782f2d", 144 | "metadata": {}, 145 | "outputs": [ 146 | { 147 | "data": { 148 | "text/plain": [ 149 | "0.5267111786415019" 150 | ] 151 | }, 152 | "execution_count": 8, 153 | "metadata": {}, 154 | "output_type": "execute_result" 155 | } 156 | ], 157 | "source": [ 158 | "stats.norm.cdf(740,711,29) - stats.norm.cdf(697,711,29)" 159 | ] 160 | }, 161 | { 162 | "cell_type": "markdown", 163 | "id": "1709d3eb", 164 | "metadata": {}, 165 | "source": [ 166 | "# Point percentage function" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 2, 172 | "id": "feebc704", 173 | "metadata": { 174 | "ExecuteTime": { 175 | "end_time": "2023-08-10T06:38:30.663330Z", 176 | "start_time": "2023-08-10T06:38:30.647612Z" 177 | } 178 | }, 179 | "outputs": [], 180 | "source": [ 181 | "#Probability = 0.85, mean = 700, SD = 25" 182 | ] 183 | }, 184 | { 185 | "cell_type": "code", 186 | "execution_count": 9, 187 | "id": "f7877147", 188 | "metadata": { 189 | "ExecuteTime": { 190 | "end_time": "2023-10-19T04:35:22.028927Z", 191 | "start_time": "2023-10-19T04:35:22.007844Z" 192 | } 193 | }, 194 | "outputs": [ 195 | { 196 | "data": { 197 | "text/plain": [ 198 | "725.9108347373448" 199 | ] 200 | }, 201 | "execution_count": 9, 202 | "metadata": {}, 203 | "output_type": "execute_result" 204 | } 205 | ], 206 | "source": [ 207 | "stats.norm.ppf(0.85,700,25)" 208 | ] 209 | }, 210 | { 211 | "cell_type": "markdown", 212 | "id": "111436a4", 213 | "metadata": {}, 214 | "source": [ 215 | "# Probability Questions:\n", 216 | "\n", 217 | "1. According to the survey, the average weight of child is 70 pounds in US with Std 10 pounds.\n", 218 | " - What is the probability that the weight is less than 50?\n", 219 | " - What is the probabilty that the weight is in range of 50 to 90?\n", 220 | " - What is the probabilty that the weight is greater than 100 pounds?\n", 221 | " - What is the probability that the weight is between 55 and 70?\n", 222 | " - What is the probability that the weight is equal to 75 pounds?\n", 223 | " " 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": null, 229 | "id": "c1df4f15", 230 | "metadata": {}, 231 | "outputs": [], 232 | "source": [] 233 | } 234 | ], 235 | "metadata": { 236 | "kernelspec": { 237 | "display_name": "Python 3 (ipykernel)", 238 | "language": "python", 239 | "name": "python3" 240 | }, 241 | "language_info": { 242 | "codemirror_mode": { 243 | "name": "ipython", 244 | "version": 3 245 | }, 246 | "file_extension": ".py", 247 | "mimetype": "text/x-python", 248 | "name": "python", 249 | "nbconvert_exporter": "python", 250 | "pygments_lexer": "ipython3", 251 | "version": "3.11.5" 252 | } 253 | }, 254 | "nbformat": 4, 255 | "nbformat_minor": 5 256 | } 257 | -------------------------------------------------------------------------------- /Statistics/Confidence Interval Code.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "5c2f8cf2", 7 | "metadata": { 8 | "ExecuteTime": { 9 | "end_time": "2023-10-23T04:49:27.186004Z", 10 | "start_time": "2023-10-23T04:49:24.728274Z" 11 | } 12 | }, 13 | "outputs": [], 14 | "source": [ 15 | "from scipy import stats\n", 16 | "import numpy as np" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": 2, 22 | "id": "09b6befb", 23 | "metadata": { 24 | "ExecuteTime": { 25 | "end_time": "2023-10-23T04:49:35.977589Z", 26 | "start_time": "2023-10-23T04:49:35.910087Z" 27 | } 28 | }, 29 | "outputs": [ 30 | { 31 | "data": { 32 | "text/plain": [ 33 | "1.959963984540054" 34 | ] 35 | }, 36 | "execution_count": 2, 37 | "metadata": {}, 38 | "output_type": "execute_result" 39 | } 40 | ], 41 | "source": [ 42 | "stats.norm.ppf(0.975)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 3, 48 | "id": "09d6152b", 49 | "metadata": { 50 | "ExecuteTime": { 51 | "end_time": "2023-10-23T04:49:44.835968Z", 52 | "start_time": "2023-10-23T04:49:44.788061Z" 53 | } 54 | }, 55 | "outputs": [ 56 | { 57 | "data": { 58 | "text/plain": [ 59 | "1.977177724476122" 60 | ] 61 | }, 62 | "execution_count": 3, 63 | "metadata": {}, 64 | "output_type": "execute_result" 65 | } 66 | ], 67 | "source": [ 68 | "stats.t.ppf(0.975,139)" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": 4, 74 | "id": "68b7c231", 75 | "metadata": { 76 | "ExecuteTime": { 77 | "end_time": "2023-10-23T04:51:32.822867Z", 78 | "start_time": "2023-10-23T04:51:32.812384Z" 79 | } 80 | }, 81 | "outputs": [ 82 | { 83 | "data": { 84 | "text/plain": [ 85 | "(1575.8820248378292, 2404.1179751621708)" 86 | ] 87 | }, 88 | "execution_count": 4, 89 | "metadata": {}, 90 | "output_type": "execute_result" 91 | } 92 | ], 93 | "source": [ 94 | "#Z method\n", 95 | "\n", 96 | "stats.norm.interval(0.95,1990,2500/np.sqrt(140))" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": 5, 102 | "id": "b96cc147", 103 | "metadata": { 104 | "ExecuteTime": { 105 | "end_time": "2023-10-23T04:52:52.266163Z", 106 | "start_time": "2023-10-23T04:52:52.249112Z" 107 | } 108 | }, 109 | "outputs": [ 110 | { 111 | "data": { 112 | "text/plain": [ 113 | "(1516.5999869168315, 2463.4000130831682)" 114 | ] 115 | }, 116 | "execution_count": 5, 117 | "metadata": {}, 118 | "output_type": "execute_result" 119 | } 120 | ], 121 | "source": [ 122 | "# T method\n", 123 | "stats.t.interval(0.95,df = 139, loc = 1990,scale = 2833/np.sqrt(140))" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "id": "d964ae1f", 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [] 133 | } 134 | ], 135 | "metadata": { 136 | "kernelspec": { 137 | "display_name": "Python 3 (ipykernel)", 138 | "language": "python", 139 | "name": "python3" 140 | }, 141 | "language_info": { 142 | "codemirror_mode": { 143 | "name": "ipython", 144 | "version": 3 145 | }, 146 | "file_extension": ".py", 147 | "mimetype": "text/x-python", 148 | "name": "python", 149 | "nbconvert_exporter": "python", 150 | "pygments_lexer": "ipython3", 151 | "version": "3.9.13" 152 | } 153 | }, 154 | "nbformat": 4, 155 | "nbformat_minor": 5 156 | } 157 | -------------------------------------------------------------------------------- /Statistics/chi2.csv: -------------------------------------------------------------------------------- 1 | ,Athlete,Smoker 2 | 0,Y,yes 3 | 1,Y,yes 4 | 2,Y,no 5 | 3,Y,no 6 | 4,Y,yes 7 | 5,Y,no 8 | 6,Y,yes 9 | 7,Y,no 10 | 8,Y,no 11 | 9,Y,no 12 | 10,Y,no 13 | 11,Y,no 14 | 12,Y,no 15 | 13,Y,no 16 | 14,Y,no 17 | 15,Y,no 18 | 16,Y,no 19 | 17,Y,no 20 | 18,N,yes 21 | 19,N,yes 22 | 20,N,yes 23 | 21,N,yes 24 | 22,N,yes 25 | 23,N,yes 26 | 24,N,yes 27 | 25,N,yes 28 | 26,N,yes 29 | 27,N,yes 30 | --------------------------------------------------------------------------------