├── .gitattributes ├── LICENSE ├── Week01 └── DataVisualizationSyllabus.pdf ├── Week02 ├── DataStructures.ipynb └── IntroductoryPythonDataStructures.pdf ├── Week03 ├── Introduction2Numpy.ipynb ├── mutability.log ├── mutability.py ├── mutability_barangokcekli.py ├── mutability_efecan_erdem1.py ├── mutability_mertozgenn.py ├── mutability_onur_yasar.py └── mutability_sinem_gencer.py ├── Week04 ├── IntroductoryPythonDataStructures.pdf ├── fetchdata.py ├── fetchdata_Ata_Ceyhun_ALACA.py ├── fetchdata_ErenErsoyluoglu.py ├── fetchdata_Furkan_ERYILMAZ.py ├── fetchdata_HuseyinCan.py ├── fetchdata_atakan_karakoc.py ├── fetchdata_barangokcekli.py ├── fetchdata_mertozgenn.py ├── fetchdata_onur_yasar.py ├── fetchdata_umut_azazi.py └── week4_sinem_gencer.py ├── Week05 ├── alfaromeo.csv ├── alfaromeo.py ├── app.py └── templates │ └── index.html ├── Week06 ├── alfaromeo.csv ├── alfaromeo.py ├── alfaromeo_Onur_YASAR.py ├── app.py ├── app_Onur_YASAR.py ├── static │ ├── style.css │ └── style_Onur_YASAR.css └── templates │ ├── index.html │ └── index_Onur_YASAR.html ├── Week07 ├── alfa_romeo.csv ├── alfaromeosoup.py ├── app.py ├── static │ └── style.css └── templates │ └── index.html ├── Week08 ├── app.py └── templates │ └── index.html └── Week13 ├── app.py └── templates └── index.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Bora Canbula 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Week01/DataVisualizationSyllabus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canbula/DataVisualization/b5f2f92eb520f29ac983f4b90b8f76b3dd9ecb7e/Week01/DataVisualizationSyllabus.pdf -------------------------------------------------------------------------------- /Week02/DataStructures.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "87aabf34", 6 | "metadata": {}, 7 | "source": [ 8 | "# Data Structures for Data Visualization Course" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "id": "1aff034a", 15 | "metadata": {}, 16 | "outputs": [ 17 | { 18 | "name": "stdout", 19 | "output_type": "stream", 20 | "text": [ 21 | "Data Visualization\n" 22 | ] 23 | } 24 | ], 25 | "source": [ 26 | "print(\"Data Visualization\")" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "id": "2f26c2b1", 32 | "metadata": {}, 33 | "source": [ 34 | "## 1) Variables" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 5, 40 | "id": "f783450e", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "name": "stdout", 45 | "output_type": "stream", 46 | "text": [ 47 | "1\n", 48 | "2\n" 49 | ] 50 | } 51 | ], 52 | "source": [ 53 | "# Variable names are case sensitive: uppercase / lowercase letters\n", 54 | "var = 1\n", 55 | "Var = 2\n", 56 | "print(var)\n", 57 | "print(Var)" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 8, 63 | "id": "6d65b6ff", 64 | "metadata": {}, 65 | "outputs": [ 66 | { 67 | "name": "stdout", 68 | "output_type": "stream", 69 | "text": [ 70 | "3\n", 71 | "4\n", 72 | "5\n" 73 | ] 74 | } 75 | ], 76 | "source": [ 77 | "# Names can be a combination of letters, digits, and underscore\n", 78 | "var1 = 3\n", 79 | "print(var1)\n", 80 | "var_1 = 4\n", 81 | "print(var_1)\n", 82 | "_var1 = 5\n", 83 | "print(_var1)" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 9, 89 | "id": "a49f5eda", 90 | "metadata": {}, 91 | "outputs": [ 92 | { 93 | "ename": "SyntaxError", 94 | "evalue": "invalid decimal literal (4102537848.py, line 2)", 95 | "output_type": "error", 96 | "traceback": [ 97 | "\u001b[0;36m Cell \u001b[0;32mIn [9], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m 1_var = 6\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid decimal literal\n" 98 | ] 99 | } 100 | ], 101 | "source": [ 102 | "# Names can not start with a number\n", 103 | "1_var = 6\n", 104 | "print(1_var)" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 11, 110 | "id": "ee162060", 111 | "metadata": {}, 112 | "outputs": [ 113 | { 114 | "name": "stdout", 115 | "output_type": "stream", 116 | "text": [ 117 | "1000000\n", 118 | "1000000\n", 119 | "1000000\n" 120 | ] 121 | } 122 | ], 123 | "source": [ 124 | "my_variable_1 = 1_000_000\n", 125 | "my_variable_2 = 1000000\n", 126 | "my_variable_3 = 1_0_0_0_00_0\n", 127 | "print(my_variable_1)\n", 128 | "print(my_variable_2)\n", 129 | "print(my_variable_3)" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": 12, 135 | "id": "83e9a036", 136 | "metadata": {}, 137 | "outputs": [ 138 | { 139 | "ename": "SyntaxError", 140 | "evalue": "invalid syntax (135169702.py, line 2)", 141 | "output_type": "error", 142 | "traceback": [ 143 | "\u001b[0;36m Cell \u001b[0;32mIn [12], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m if = 4\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" 144 | ] 145 | } 146 | ], 147 | "source": [ 148 | "# Keywords can not be used as variable names\n", 149 | "if = 4" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": 13, 155 | "id": "4ef5805b", 156 | "metadata": {}, 157 | "outputs": [], 158 | "source": [ 159 | "import keyword" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": 14, 165 | "id": "a617882f", 166 | "metadata": {}, 167 | "outputs": [ 168 | { 169 | "data": { 170 | "text/plain": [ 171 | "['__all__',\n", 172 | " '__builtins__',\n", 173 | " '__cached__',\n", 174 | " '__doc__',\n", 175 | " '__file__',\n", 176 | " '__loader__',\n", 177 | " '__name__',\n", 178 | " '__package__',\n", 179 | " '__spec__',\n", 180 | " 'iskeyword',\n", 181 | " 'issoftkeyword',\n", 182 | " 'kwlist',\n", 183 | " 'softkwlist']" 184 | ] 185 | }, 186 | "execution_count": 14, 187 | "metadata": {}, 188 | "output_type": "execute_result" 189 | } 190 | ], 191 | "source": [ 192 | "dir(keyword)" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": 15, 198 | "id": "75e2a31a", 199 | "metadata": {}, 200 | "outputs": [ 201 | { 202 | "data": { 203 | "text/plain": [ 204 | "['False',\n", 205 | " 'None',\n", 206 | " 'True',\n", 207 | " '__peg_parser__',\n", 208 | " 'and',\n", 209 | " 'as',\n", 210 | " 'assert',\n", 211 | " 'async',\n", 212 | " 'await',\n", 213 | " 'break',\n", 214 | " 'class',\n", 215 | " 'continue',\n", 216 | " 'def',\n", 217 | " 'del',\n", 218 | " 'elif',\n", 219 | " 'else',\n", 220 | " 'except',\n", 221 | " 'finally',\n", 222 | " 'for',\n", 223 | " 'from',\n", 224 | " 'global',\n", 225 | " 'if',\n", 226 | " 'import',\n", 227 | " 'in',\n", 228 | " 'is',\n", 229 | " 'lambda',\n", 230 | " 'nonlocal',\n", 231 | " 'not',\n", 232 | " 'or',\n", 233 | " 'pass',\n", 234 | " 'raise',\n", 235 | " 'return',\n", 236 | " 'try',\n", 237 | " 'while',\n", 238 | " 'with',\n", 239 | " 'yield']" 240 | ] 241 | }, 242 | "execution_count": 15, 243 | "metadata": {}, 244 | "output_type": "execute_result" 245 | } 246 | ], 247 | "source": [ 248 | "keyword.kwlist" 249 | ] 250 | }, 251 | { 252 | "cell_type": "code", 253 | "execution_count": 16, 254 | "id": "c0699e79", 255 | "metadata": {}, 256 | "outputs": [ 257 | { 258 | "name": "stdout", 259 | "output_type": "stream", 260 | "text": [ 261 | "Help on built-in function __contains__:\n", 262 | "\n", 263 | "__contains__(...) method of builtins.frozenset instance\n", 264 | " x.__contains__(y) <==> y in x.\n", 265 | "\n" 266 | ] 267 | } 268 | ], 269 | "source": [ 270 | "help(keyword.iskeyword)" 271 | ] 272 | }, 273 | { 274 | "cell_type": "code", 275 | "execution_count": 17, 276 | "id": "e4868ef1", 277 | "metadata": {}, 278 | "outputs": [ 279 | { 280 | "data": { 281 | "text/plain": [ 282 | "True" 283 | ] 284 | }, 285 | "execution_count": 17, 286 | "metadata": {}, 287 | "output_type": "execute_result" 288 | } 289 | ], 290 | "source": [ 291 | "keyword.iskeyword(\"if\")" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": 18, 297 | "id": "86477763", 298 | "metadata": {}, 299 | "outputs": [ 300 | { 301 | "data": { 302 | "text/plain": [ 303 | "False" 304 | ] 305 | }, 306 | "execution_count": 18, 307 | "metadata": {}, 308 | "output_type": "execute_result" 309 | } 310 | ], 311 | "source": [ 312 | "keyword.iskeyword(\"Bora\")" 313 | ] 314 | }, 315 | { 316 | "cell_type": "code", 317 | "execution_count": 20, 318 | "id": "151e8282", 319 | "metadata": {}, 320 | "outputs": [ 321 | { 322 | "name": "stdout", 323 | "output_type": "stream", 324 | "text": [ 325 | "5\n" 326 | ] 327 | } 328 | ], 329 | "source": [ 330 | "\"\"\"\n", 331 | "if you are worried about the name, or intentionally \n", 332 | "want to use a keyword as a variable name, \n", 333 | "then use an underscore at the end\n", 334 | "\"\"\"\n", 335 | "if_ = 5\n", 336 | "print(if_)" 337 | ] 338 | }, 339 | { 340 | "cell_type": "code", 341 | "execution_count": 23, 342 | "id": "d42ea3a1", 343 | "metadata": {}, 344 | "outputs": [ 345 | { 346 | "name": "stdout", 347 | "output_type": "stream", 348 | "text": [ 349 | "\n", 350 | "\n", 351 | "\n", 352 | "\n", 353 | "\n" 354 | ] 355 | } 356 | ], 357 | "source": [ 358 | "# Primitive Variable Types\n", 359 | "a = 5\n", 360 | "b = 7.34\n", 361 | "c = \"Bora\"\n", 362 | "d = True\n", 363 | "e = 2j\n", 364 | "print(type(a))\n", 365 | "print(type(b))\n", 366 | "print(type(c))\n", 367 | "print(type(d))\n", 368 | "print(type(e))" 369 | ] 370 | }, 371 | { 372 | "cell_type": "code", 373 | "execution_count": 24, 374 | "id": "1a89134e", 375 | "metadata": {}, 376 | "outputs": [ 377 | { 378 | "name": "stdout", 379 | "output_type": "stream", 380 | "text": [ 381 | "5 7.34 Bora True 2j\n" 382 | ] 383 | } 384 | ], 385 | "source": [ 386 | "# Multiple assignments\n", 387 | "v1, v2, v3, v4, v5 = 5, 7.34, \"Bora\", True, 2j\n", 388 | "print(v1, v2, v3, v4, v5)" 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": 26, 394 | "id": "cc02c9ef", 395 | "metadata": {}, 396 | "outputs": [ 397 | { 398 | "name": "stdout", 399 | "output_type": "stream", 400 | "text": [ 401 | "7.34 5\n", 402 | "5 7.34\n" 403 | ] 404 | } 405 | ], 406 | "source": [ 407 | "# swapping the variables\n", 408 | "v1, v2 = v2, v1\n", 409 | "print(v1, v2)\n", 410 | "v1, v2 = v2, v1\n", 411 | "print(v1, v2)" 412 | ] 413 | }, 414 | { 415 | "cell_type": "code", 416 | "execution_count": 47, 417 | "id": "5332ad64", 418 | "metadata": {}, 419 | "outputs": [ 420 | { 421 | "name": "stdout", 422 | "output_type": "stream", 423 | "text": [ 424 | "v1 = 5 | v2 = 7.34 | v3 = Bora | v4 = True | v5 = 2j\n", 425 | "v1 = 5 | v2 = 7.340000e+00 | v3 = Bora | v4 = True | v5 = 2j \n", 426 | "v1 = 5 | v2 = 7.34 | v3 = Bora | v4 = True | v5 = 2j\n", 427 | "v1 = 5 | v2 = 7.34 | v3 = Bora | v4 = True | v5 = 2j\n", 428 | "v1 = 00005 | v2 = 7.3400\n" 429 | ] 430 | } 431 | ], 432 | "source": [ 433 | "# Formatted Output\n", 434 | "print(\"v1 = \", v1, \" | v2 = \", v2, \" | v3 = \", v3, \" | v4 = \", v4, \" | v5 = \", v5)\n", 435 | "print(\"v1 = %d | v2 = %e | v3 = %s | v4 = %s | v5 = %s \" % (v1, v2, v3, v4, v5))\n", 436 | "print(\"v1 = {0} | v2 = {1} | v3 = {2} | v4 = {3} | v5 = {4}\".format(v1, v2, v3, v4, v5))\n", 437 | "print(f\"v1 = {v1} | v2 = {v2} | v3 = {v3} | v4 = {v4} | v5 = {v5}\")\n", 438 | "print(f\"v1 = {v1:05d} | v2 = {v2:16.4f}\")" 439 | ] 440 | }, 441 | { 442 | "cell_type": "code", 443 | "execution_count": 57, 444 | "id": "1c748e50", 445 | "metadata": {}, 446 | "outputs": [ 447 | { 448 | "name": "stdout", 449 | "output_type": "stream", 450 | "text": [ 451 | "12.0\n", 452 | "4\n", 453 | "False\n", 454 | "7.62\n" 455 | ] 456 | } 457 | ], 458 | "source": [ 459 | "# Typecasting\n", 460 | "print(float(12))\n", 461 | "print(int(4.6))\n", 462 | "print(bool(0))\n", 463 | "print(str(7.62))" 464 | ] 465 | }, 466 | { 467 | "cell_type": "code", 468 | "execution_count": 78, 469 | "id": "320f3c2a", 470 | "metadata": {}, 471 | "outputs": [ 472 | { 473 | "name": "stdout", 474 | "output_type": "stream", 475 | "text": [ 476 | "D\n", 477 | "s\n", 478 | "18\n", 479 | "n\n", 480 | "n\n", 481 | "i\n", 482 | "D\n", 483 | "Data\n", 484 | "Data\n", 485 | "Visualization\n", 486 | "Data Visualization\n", 487 | "Dt\n", 488 | "ata\n", 489 | "noitazilausiV ataD\n" 490 | ] 491 | } 492 | ], 493 | "source": [ 494 | "# Strings are sequences. Sequences are an object type in Python that allows user to store multiple values.\n", 495 | "# If they are sequences, then we can use indexing and slicing.\n", 496 | "name = \"Data Visualization\"\n", 497 | "print(name[0])\n", 498 | "print(name[7])\n", 499 | "print(len(name))\n", 500 | "print(name[len(name)-1])\n", 501 | "print(name[-1])\n", 502 | "print(name[-3])\n", 503 | "print(name[-len(name)])\n", 504 | "print(name[0:4])\n", 505 | "print(name[:4])\n", 506 | "print(name[5:])\n", 507 | "print(name[:])\n", 508 | "print(name[0:4:2])\n", 509 | "print(name[3:0:-1])\n", 510 | "print(name[::-1])" 511 | ] 512 | }, 513 | { 514 | "cell_type": "code", 515 | "execution_count": 85, 516 | "id": "6f1c2f6d", 517 | "metadata": {}, 518 | "outputs": [ 519 | { 520 | "name": "stdout", 521 | "output_type": "stream", 522 | "text": [ 523 | "Data Visualization\n", 524 | "ta Visua\n", 525 | "t iu\n", 526 | "lui \n", 527 | "Data Visualization" 528 | ] 529 | } 530 | ], 531 | "source": [ 532 | "# Loops and Range\n", 533 | "for i in range(len(name)):\n", 534 | " print(name[i], end='') # help(print)\n", 535 | "print('')\n", 536 | "for i in range(2, 10):\n", 537 | " print(name[i], end='')\n", 538 | "print('')\n", 539 | "for i in range(2, 10, 2):\n", 540 | " print(name[i], end='')\n", 541 | "print('')\n", 542 | "for i in range(10, 2, -2):\n", 543 | " print(name[i], end='')\n", 544 | "print('')\n", 545 | "for c in name:\n", 546 | " print(c, end='')" 547 | ] 548 | }, 549 | { 550 | "cell_type": "markdown", 551 | "id": "c1d77cc3", 552 | "metadata": {}, 553 | "source": [ 554 | "## 2) Sequences in Python" 555 | ] 556 | }, 557 | { 558 | "cell_type": "markdown", 559 | "id": "af210d21", 560 | "metadata": {}, 561 | "source": [ 562 | "### Lists\n", 563 | "Ordered and mutable sequence of values indexed by integer numbers." 564 | ] 565 | }, 566 | { 567 | "cell_type": "code", 568 | "execution_count": 101, 569 | "id": "9bc0f17b", 570 | "metadata": {}, 571 | "outputs": [ 572 | { 573 | "name": "stdout", 574 | "output_type": "stream", 575 | "text": [ 576 | "initialize: [] \n", 577 | "append: [7, 9, 3]\n", 578 | "access: 3\n", 579 | "insert: [7, 5, 9, 3]\n", 580 | "update: [7, 5, 4, 3]\n", 581 | "remove: [7, 4, 3]\n", 582 | "3\n" 583 | ] 584 | } 585 | ], 586 | "source": [ 587 | "# initialize\n", 588 | "a_list = []\n", 589 | "print(f\"initialize: {a_list} {type(a_list)}\")\n", 590 | "# append (adding an item to the end)\n", 591 | "a_list.append(7)\n", 592 | "a_list.append(9)\n", 593 | "a_list.append(3)\n", 594 | "print(f\"append: {a_list}\")\n", 595 | "# access an item\n", 596 | "print(f\"access: {a_list[2]}\")\n", 597 | "# insert an item with an index\n", 598 | "a_list.insert(1, 5)\n", 599 | "print(f\"insert: {a_list}\")\n", 600 | "# update an item\n", 601 | "a_list[2] = 4\n", 602 | "print(f\"update: {a_list}\")\n", 603 | "# remove an item\n", 604 | "del a_list[1]\n", 605 | "print(f\"remove: {a_list}\")\n", 606 | "print(a_list.pop())" 607 | ] 608 | }, 609 | { 610 | "cell_type": "code", 611 | "execution_count": 102, 612 | "id": "ee2096d9", 613 | "metadata": {}, 614 | "outputs": [ 615 | { 616 | "data": { 617 | "text/plain": [ 618 | "['__add__',\n", 619 | " '__class__',\n", 620 | " '__class_getitem__',\n", 621 | " '__contains__',\n", 622 | " '__delattr__',\n", 623 | " '__delitem__',\n", 624 | " '__dir__',\n", 625 | " '__doc__',\n", 626 | " '__eq__',\n", 627 | " '__format__',\n", 628 | " '__ge__',\n", 629 | " '__getattribute__',\n", 630 | " '__getitem__',\n", 631 | " '__gt__',\n", 632 | " '__hash__',\n", 633 | " '__iadd__',\n", 634 | " '__imul__',\n", 635 | " '__init__',\n", 636 | " '__init_subclass__',\n", 637 | " '__iter__',\n", 638 | " '__le__',\n", 639 | " '__len__',\n", 640 | " '__lt__',\n", 641 | " '__mul__',\n", 642 | " '__ne__',\n", 643 | " '__new__',\n", 644 | " '__reduce__',\n", 645 | " '__reduce_ex__',\n", 646 | " '__repr__',\n", 647 | " '__reversed__',\n", 648 | " '__rmul__',\n", 649 | " '__setattr__',\n", 650 | " '__setitem__',\n", 651 | " '__sizeof__',\n", 652 | " '__str__',\n", 653 | " '__subclasshook__',\n", 654 | " 'append',\n", 655 | " 'clear',\n", 656 | " 'copy',\n", 657 | " 'count',\n", 658 | " 'extend',\n", 659 | " 'index',\n", 660 | " 'insert',\n", 661 | " 'pop',\n", 662 | " 'remove',\n", 663 | " 'reverse',\n", 664 | " 'sort']" 665 | ] 666 | }, 667 | "execution_count": 102, 668 | "metadata": {}, 669 | "output_type": "execute_result" 670 | } 671 | ], 672 | "source": [ 673 | "dir(a_list)" 674 | ] 675 | }, 676 | { 677 | "cell_type": "code", 678 | "execution_count": 105, 679 | "id": "d5d1f3de", 680 | "metadata": {}, 681 | "outputs": [ 682 | { 683 | "name": "stdout", 684 | "output_type": "stream", 685 | "text": [ 686 | "[4, 7]\n", 687 | "[7, 4]\n" 688 | ] 689 | } 690 | ], 691 | "source": [ 692 | "a_list.sort()\n", 693 | "print(a_list)\n", 694 | "a_list.reverse()\n", 695 | "print(a_list)" 696 | ] 697 | }, 698 | { 699 | "cell_type": "markdown", 700 | "id": "5fa65b35", 701 | "metadata": {}, 702 | "source": [ 703 | "### Tuples\n", 704 | "Ordered and immutable sequence of values indexed by integer numbers." 705 | ] 706 | }, 707 | { 708 | "cell_type": "code", 709 | "execution_count": 108, 710 | "id": "69c663be", 711 | "metadata": {}, 712 | "outputs": [ 713 | { 714 | "name": "stdout", 715 | "output_type": "stream", 716 | "text": [ 717 | "initialize: (3, 5, 7, 9) \n", 718 | "access: 7\n" 719 | ] 720 | }, 721 | { 722 | "ename": "NameError", 723 | "evalue": "name 'a_tuple' is not defined", 724 | "output_type": "error", 725 | "traceback": [ 726 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 727 | "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", 728 | "Cell \u001b[0;32mIn [108], line 9\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# remove the whole tuple\u001b[39;00m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mdel\u001b[39;00m a_tuple\n\u001b[0;32m----> 9\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[43ma_tuple\u001b[49m)\n", 729 | "\u001b[0;31mNameError\u001b[0m: name 'a_tuple' is not defined" 730 | ] 731 | } 732 | ], 733 | "source": [ 734 | "# initialize\n", 735 | "a_tuple = (3, 5, 7, 9)\n", 736 | "print(f\"initialize: {a_tuple} {type(a_tuple)}\")\n", 737 | "# immutable: no append, no update, no remove\n", 738 | "# access an item\n", 739 | "print(f\"access: {a_tuple[2]}\")\n", 740 | "# remove the whole tuple\n", 741 | "del a_tuple\n", 742 | "print(a_tuple)" 743 | ] 744 | }, 745 | { 746 | "cell_type": "markdown", 747 | "id": "653c949d", 748 | "metadata": {}, 749 | "source": [ 750 | "### Sets\n", 751 | "Unordered and mutable collection of values with no duplicate items. They support mathematical operations like union, intersection, difference, and symmetric difference." 752 | ] 753 | }, 754 | { 755 | "cell_type": "code", 756 | "execution_count": 121, 757 | "id": "c68a3d7b", 758 | "metadata": {}, 759 | "outputs": [ 760 | { 761 | "name": "stdout", 762 | "output_type": "stream", 763 | "text": [ 764 | "initialize: {9, 3, 5, 7} \n", 765 | "add: {1, 3, 5, 7, 9}\n", 766 | "remove: {1, 3, 5}\n", 767 | "fill again: {3, 5, 7}\n", 768 | "empty set: set()\n", 769 | "union of two sets: {1, 2, 3, 4, 5, 6, 7, 8}\n", 770 | "difference of two sets: {3, 5, 7} {8, 4, 6}\n", 771 | "symmetrical difference of two sets: {3, 4, 5, 6, 7, 8}\n" 772 | ] 773 | } 774 | ], 775 | "source": [ 776 | "# initialize\n", 777 | "a_set = {3, 5, 5, 5, 5, 7, 7, 7, 7, 9, 3, 5, 7, 9}\n", 778 | "print(f\"initialize: {a_set} {type(a_set)}\")\n", 779 | "# add\n", 780 | "a_set.add(7)\n", 781 | "a_set.add(9)\n", 782 | "a_set.add(1)\n", 783 | "print(f\"add: {a_set}\")\n", 784 | "# unordered: no access, no insert, no update\n", 785 | "# remove an item (with the value)\n", 786 | "a_set.remove(9)\n", 787 | "a_set.discard(8) # a_set.remove(8) raises a key error\n", 788 | "a_set.discard(7)\n", 789 | "print(f\"remove: {a_set}\")\n", 790 | "# delete\n", 791 | "del a_set\n", 792 | "# remove all items rather than deleting the set\n", 793 | "a_set = set([3, 5, 7])\n", 794 | "print(f\"fill again: {a_set}\")\n", 795 | "a_set.clear()\n", 796 | "print(f\"empty set: {a_set}\")\n", 797 | "# union of two sets\n", 798 | "a_set_1 = {1, 2, 3, 5, 7}\n", 799 | "a_set_2 = {1, 2, 4, 6, 8}\n", 800 | "print(f\"union of two sets: {a_set_1 | a_set_2}\")\n", 801 | "# difference of two sets\n", 802 | "print(f\"difference of two sets: {a_set_1 - a_set_2} {a_set_2 - a_set_1}\")\n", 803 | "# symmetrical difference of two sets\n", 804 | "print(f\"symmetrical difference of two sets: {a_set_1 ^ a_set_2}\")" 805 | ] 806 | }, 807 | { 808 | "cell_type": "markdown", 809 | "id": "a3c5d192", 810 | "metadata": {}, 811 | "source": [ 812 | "### Dictionaries\n", 813 | "Unordered and mutable set of key-value pairs" 814 | ] 815 | }, 816 | { 817 | "cell_type": "code", 818 | "execution_count": 129, 819 | "id": "108dda22", 820 | "metadata": {}, 821 | "outputs": [ 822 | { 823 | "name": "stdout", 824 | "output_type": "stream", 825 | "text": [ 826 | "initialize: {} \n", 827 | "add: {'first_name': 'Bora', 'last_name': 'Canbula', 'age': 38}\n", 828 | "access: Canbula\n", 829 | "keys: dict_keys(['first_name', 'last_name', 'age'])\n", 830 | "values: dict_values(['Bora', 'Canbula', 38])\n", 831 | "update: 39\n", 832 | "remove: {'first_name': 'Bora', 'age': 39}\n", 833 | "clear: {}\n" 834 | ] 835 | } 836 | ], 837 | "source": [ 838 | "# initialize\n", 839 | "a_dict = {}\n", 840 | "print(f\"initialize: {a_dict} {type(a_dict)}\")\n", 841 | "# add an item with a key\n", 842 | "a_dict[\"first_name\"] = \"Bora\"\n", 843 | "a_dict[\"last_name\"] = \"Canbula\"\n", 844 | "a_dict[\"age\"] = 38\n", 845 | "print(f\"add: {a_dict}\")\n", 846 | "# access an item\n", 847 | "print(f\"access: {a_dict['last_name']}\")\n", 848 | "# list the keys and values\n", 849 | "print(f\"keys: {a_dict.keys()}\")\n", 850 | "print(f\"values: {a_dict.values()}\")\n", 851 | "# update an item\n", 852 | "a_dict[\"age\"] = 39\n", 853 | "print(f\"update: {a_dict['age']}\")\n", 854 | "# remove an item\n", 855 | "del a_dict[\"last_name\"]\n", 856 | "print(f\"remove: {a_dict}\")\n", 857 | "# remove all items\n", 858 | "a_dict.clear()\n", 859 | "print(f\"clear: {a_dict}\")" 860 | ] 861 | }, 862 | { 863 | "cell_type": "code", 864 | "execution_count": 134, 865 | "id": "e7865c82", 866 | "metadata": {}, 867 | "outputs": [ 868 | { 869 | "name": "stdout", 870 | "output_type": "stream", 871 | "text": [ 872 | "first_name\n", 873 | "last_name\n", 874 | "age\n", 875 | "Bora\n", 876 | "Canbula\n", 877 | "38\n", 878 | "first_name Bora\n", 879 | "last_name Canbula\n", 880 | "age 38\n", 881 | "first_name Bora\n", 882 | "last_name Canbula\n", 883 | "age 38\n" 884 | ] 885 | } 886 | ], 887 | "source": [ 888 | "a_dict = {'first_name': 'Bora', 'last_name': 'Canbula', 'age': 38}\n", 889 | "for k in a_dict.keys():\n", 890 | " print(k)\n", 891 | "for v in a_dict.values():\n", 892 | " print(v)\n", 893 | "for k, v in zip(a_dict.keys(), a_dict.values()):\n", 894 | " print(k, v)\n", 895 | "for k, v in a_dict.items():\n", 896 | " print(k, v)" 897 | ] 898 | }, 899 | { 900 | "cell_type": "code", 901 | "execution_count": null, 902 | "id": "e1f5103f", 903 | "metadata": {}, 904 | "outputs": [], 905 | "source": [] 906 | } 907 | ], 908 | "metadata": { 909 | "kernelspec": { 910 | "display_name": "Python 3 (ipykernel)", 911 | "language": "python", 912 | "name": "python3" 913 | }, 914 | "language_info": { 915 | "codemirror_mode": { 916 | "name": "ipython", 917 | "version": 3 918 | }, 919 | "file_extension": ".py", 920 | "mimetype": "text/x-python", 921 | "name": "python", 922 | "nbconvert_exporter": "python", 923 | "pygments_lexer": "ipython3", 924 | "version": "3.9.15" 925 | } 926 | }, 927 | "nbformat": 4, 928 | "nbformat_minor": 5 929 | } 930 | -------------------------------------------------------------------------------- /Week02/IntroductoryPythonDataStructures.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canbula/DataVisualization/b5f2f92eb520f29ac983f4b90b8f76b3dd9ecb7e/Week02/IntroductoryPythonDataStructures.pdf -------------------------------------------------------------------------------- /Week03/Introduction2Numpy.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "89221e8a", 6 | "metadata": {}, 7 | "source": [ 8 | "# Introduction to Numpy\n", 9 | "Numeric Python (numpy.org)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": 1, 15 | "id": "9ddc6c9c", 16 | "metadata": {}, 17 | "outputs": [ 18 | { 19 | "name": "stdout", 20 | "output_type": "stream", 21 | "text": [ 22 | "Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.9/site-packages (1.21.5)\r\n" 23 | ] 24 | } 25 | ], 26 | "source": [ 27 | "!pip install numpy" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 2, 33 | "id": "051692a5", 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [ 37 | "import numpy as np" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 3, 43 | "id": "bf55e961", 44 | "metadata": {}, 45 | "outputs": [ 46 | { 47 | "data": { 48 | "text/plain": [ 49 | "['ALLOW_THREADS',\n", 50 | " 'AxisError',\n", 51 | " 'BUFSIZE',\n", 52 | " 'Bytes0',\n", 53 | " 'CLIP',\n", 54 | " 'ComplexWarning',\n", 55 | " 'DataSource',\n", 56 | " 'Datetime64',\n", 57 | " 'ERR_CALL',\n", 58 | " 'ERR_DEFAULT',\n", 59 | " 'ERR_IGNORE',\n", 60 | " 'ERR_LOG',\n", 61 | " 'ERR_PRINT',\n", 62 | " 'ERR_RAISE',\n", 63 | " 'ERR_WARN',\n", 64 | " 'FLOATING_POINT_SUPPORT',\n", 65 | " 'FPE_DIVIDEBYZERO',\n", 66 | " 'FPE_INVALID',\n", 67 | " 'FPE_OVERFLOW',\n", 68 | " 'FPE_UNDERFLOW',\n", 69 | " 'False_',\n", 70 | " 'Inf',\n", 71 | " 'Infinity',\n", 72 | " 'MAXDIMS',\n", 73 | " 'MAY_SHARE_BOUNDS',\n", 74 | " 'MAY_SHARE_EXACT',\n", 75 | " 'MachAr',\n", 76 | " 'ModuleDeprecationWarning',\n", 77 | " 'NAN',\n", 78 | " 'NINF',\n", 79 | " 'NZERO',\n", 80 | " 'NaN',\n", 81 | " 'PINF',\n", 82 | " 'PZERO',\n", 83 | " 'RAISE',\n", 84 | " 'RankWarning',\n", 85 | " 'SHIFT_DIVIDEBYZERO',\n", 86 | " 'SHIFT_INVALID',\n", 87 | " 'SHIFT_OVERFLOW',\n", 88 | " 'SHIFT_UNDERFLOW',\n", 89 | " 'ScalarType',\n", 90 | " 'Str0',\n", 91 | " 'Tester',\n", 92 | " 'TooHardError',\n", 93 | " 'True_',\n", 94 | " 'UFUNC_BUFSIZE_DEFAULT',\n", 95 | " 'UFUNC_PYVALS_NAME',\n", 96 | " 'Uint64',\n", 97 | " 'VisibleDeprecationWarning',\n", 98 | " 'WRAP',\n", 99 | " '_NoValue',\n", 100 | " '_UFUNC_API',\n", 101 | " '__NUMPY_SETUP__',\n", 102 | " '__all__',\n", 103 | " '__builtins__',\n", 104 | " '__cached__',\n", 105 | " '__config__',\n", 106 | " '__deprecated_attrs__',\n", 107 | " '__dir__',\n", 108 | " '__doc__',\n", 109 | " '__expired_functions__',\n", 110 | " '__file__',\n", 111 | " '__getattr__',\n", 112 | " '__git_version__',\n", 113 | " '__loader__',\n", 114 | " '__name__',\n", 115 | " '__package__',\n", 116 | " '__path__',\n", 117 | " '__spec__',\n", 118 | " '__version__',\n", 119 | " '_add_newdoc_ufunc',\n", 120 | " '_distributor_init',\n", 121 | " '_financial_names',\n", 122 | " '_globals',\n", 123 | " '_mat',\n", 124 | " '_pytesttester',\n", 125 | " '_version',\n", 126 | " 'abs',\n", 127 | " 'absolute',\n", 128 | " 'add',\n", 129 | " 'add_docstring',\n", 130 | " 'add_newdoc',\n", 131 | " 'add_newdoc_ufunc',\n", 132 | " 'alen',\n", 133 | " 'all',\n", 134 | " 'allclose',\n", 135 | " 'alltrue',\n", 136 | " 'amax',\n", 137 | " 'amin',\n", 138 | " 'angle',\n", 139 | " 'any',\n", 140 | " 'append',\n", 141 | " 'apply_along_axis',\n", 142 | " 'apply_over_axes',\n", 143 | " 'arange',\n", 144 | " 'arccos',\n", 145 | " 'arccosh',\n", 146 | " 'arcsin',\n", 147 | " 'arcsinh',\n", 148 | " 'arctan',\n", 149 | " 'arctan2',\n", 150 | " 'arctanh',\n", 151 | " 'argmax',\n", 152 | " 'argmin',\n", 153 | " 'argpartition',\n", 154 | " 'argsort',\n", 155 | " 'argwhere',\n", 156 | " 'around',\n", 157 | " 'array',\n", 158 | " 'array2string',\n", 159 | " 'array_equal',\n", 160 | " 'array_equiv',\n", 161 | " 'array_repr',\n", 162 | " 'array_split',\n", 163 | " 'array_str',\n", 164 | " 'asanyarray',\n", 165 | " 'asarray',\n", 166 | " 'asarray_chkfinite',\n", 167 | " 'ascontiguousarray',\n", 168 | " 'asfarray',\n", 169 | " 'asfortranarray',\n", 170 | " 'asmatrix',\n", 171 | " 'asscalar',\n", 172 | " 'atleast_1d',\n", 173 | " 'atleast_2d',\n", 174 | " 'atleast_3d',\n", 175 | " 'average',\n", 176 | " 'bartlett',\n", 177 | " 'base_repr',\n", 178 | " 'binary_repr',\n", 179 | " 'bincount',\n", 180 | " 'bitwise_and',\n", 181 | " 'bitwise_not',\n", 182 | " 'bitwise_or',\n", 183 | " 'bitwise_xor',\n", 184 | " 'blackman',\n", 185 | " 'block',\n", 186 | " 'bmat',\n", 187 | " 'bool8',\n", 188 | " 'bool_',\n", 189 | " 'broadcast',\n", 190 | " 'broadcast_arrays',\n", 191 | " 'broadcast_shapes',\n", 192 | " 'broadcast_to',\n", 193 | " 'busday_count',\n", 194 | " 'busday_offset',\n", 195 | " 'busdaycalendar',\n", 196 | " 'byte',\n", 197 | " 'byte_bounds',\n", 198 | " 'bytes0',\n", 199 | " 'bytes_',\n", 200 | " 'c_',\n", 201 | " 'can_cast',\n", 202 | " 'cast',\n", 203 | " 'cbrt',\n", 204 | " 'cdouble',\n", 205 | " 'ceil',\n", 206 | " 'cfloat',\n", 207 | " 'char',\n", 208 | " 'character',\n", 209 | " 'chararray',\n", 210 | " 'choose',\n", 211 | " 'clip',\n", 212 | " 'clongdouble',\n", 213 | " 'clongfloat',\n", 214 | " 'column_stack',\n", 215 | " 'common_type',\n", 216 | " 'compare_chararrays',\n", 217 | " 'compat',\n", 218 | " 'complex128',\n", 219 | " 'complex64',\n", 220 | " 'complex_',\n", 221 | " 'complexfloating',\n", 222 | " 'compress',\n", 223 | " 'concatenate',\n", 224 | " 'conj',\n", 225 | " 'conjugate',\n", 226 | " 'convolve',\n", 227 | " 'copy',\n", 228 | " 'copysign',\n", 229 | " 'copyto',\n", 230 | " 'core',\n", 231 | " 'corrcoef',\n", 232 | " 'correlate',\n", 233 | " 'cos',\n", 234 | " 'cosh',\n", 235 | " 'count_nonzero',\n", 236 | " 'cov',\n", 237 | " 'cross',\n", 238 | " 'csingle',\n", 239 | " 'ctypeslib',\n", 240 | " 'cumprod',\n", 241 | " 'cumproduct',\n", 242 | " 'cumsum',\n", 243 | " 'datetime64',\n", 244 | " 'datetime_as_string',\n", 245 | " 'datetime_data',\n", 246 | " 'deg2rad',\n", 247 | " 'degrees',\n", 248 | " 'delete',\n", 249 | " 'deprecate',\n", 250 | " 'deprecate_with_doc',\n", 251 | " 'diag',\n", 252 | " 'diag_indices',\n", 253 | " 'diag_indices_from',\n", 254 | " 'diagflat',\n", 255 | " 'diagonal',\n", 256 | " 'diff',\n", 257 | " 'digitize',\n", 258 | " 'disp',\n", 259 | " 'divide',\n", 260 | " 'divmod',\n", 261 | " 'dot',\n", 262 | " 'double',\n", 263 | " 'dsplit',\n", 264 | " 'dstack',\n", 265 | " 'dtype',\n", 266 | " 'e',\n", 267 | " 'ediff1d',\n", 268 | " 'einsum',\n", 269 | " 'einsum_path',\n", 270 | " 'emath',\n", 271 | " 'empty',\n", 272 | " 'empty_like',\n", 273 | " 'equal',\n", 274 | " 'error_message',\n", 275 | " 'errstate',\n", 276 | " 'euler_gamma',\n", 277 | " 'exp',\n", 278 | " 'exp2',\n", 279 | " 'expand_dims',\n", 280 | " 'expm1',\n", 281 | " 'extract',\n", 282 | " 'eye',\n", 283 | " 'fabs',\n", 284 | " 'fastCopyAndTranspose',\n", 285 | " 'fft',\n", 286 | " 'fill_diagonal',\n", 287 | " 'find_common_type',\n", 288 | " 'finfo',\n", 289 | " 'fix',\n", 290 | " 'flatiter',\n", 291 | " 'flatnonzero',\n", 292 | " 'flexible',\n", 293 | " 'flip',\n", 294 | " 'fliplr',\n", 295 | " 'flipud',\n", 296 | " 'float16',\n", 297 | " 'float32',\n", 298 | " 'float64',\n", 299 | " 'float_',\n", 300 | " 'float_power',\n", 301 | " 'floating',\n", 302 | " 'floor',\n", 303 | " 'floor_divide',\n", 304 | " 'fmax',\n", 305 | " 'fmin',\n", 306 | " 'fmod',\n", 307 | " 'format_float_positional',\n", 308 | " 'format_float_scientific',\n", 309 | " 'format_parser',\n", 310 | " 'frexp',\n", 311 | " 'frombuffer',\n", 312 | " 'fromfile',\n", 313 | " 'fromfunction',\n", 314 | " 'fromiter',\n", 315 | " 'frompyfunc',\n", 316 | " 'fromregex',\n", 317 | " 'fromstring',\n", 318 | " 'full',\n", 319 | " 'full_like',\n", 320 | " 'gcd',\n", 321 | " 'generic',\n", 322 | " 'genfromtxt',\n", 323 | " 'geomspace',\n", 324 | " 'get_array_wrap',\n", 325 | " 'get_include',\n", 326 | " 'get_printoptions',\n", 327 | " 'getbufsize',\n", 328 | " 'geterr',\n", 329 | " 'geterrcall',\n", 330 | " 'geterrobj',\n", 331 | " 'gradient',\n", 332 | " 'greater',\n", 333 | " 'greater_equal',\n", 334 | " 'half',\n", 335 | " 'hamming',\n", 336 | " 'hanning',\n", 337 | " 'heaviside',\n", 338 | " 'histogram',\n", 339 | " 'histogram2d',\n", 340 | " 'histogram_bin_edges',\n", 341 | " 'histogramdd',\n", 342 | " 'hsplit',\n", 343 | " 'hstack',\n", 344 | " 'hypot',\n", 345 | " 'i0',\n", 346 | " 'identity',\n", 347 | " 'iinfo',\n", 348 | " 'imag',\n", 349 | " 'in1d',\n", 350 | " 'index_exp',\n", 351 | " 'indices',\n", 352 | " 'inexact',\n", 353 | " 'inf',\n", 354 | " 'info',\n", 355 | " 'infty',\n", 356 | " 'inner',\n", 357 | " 'insert',\n", 358 | " 'int0',\n", 359 | " 'int16',\n", 360 | " 'int32',\n", 361 | " 'int64',\n", 362 | " 'int8',\n", 363 | " 'int_',\n", 364 | " 'intc',\n", 365 | " 'integer',\n", 366 | " 'interp',\n", 367 | " 'intersect1d',\n", 368 | " 'intp',\n", 369 | " 'invert',\n", 370 | " 'is_busday',\n", 371 | " 'isclose',\n", 372 | " 'iscomplex',\n", 373 | " 'iscomplexobj',\n", 374 | " 'isfinite',\n", 375 | " 'isfortran',\n", 376 | " 'isin',\n", 377 | " 'isinf',\n", 378 | " 'isnan',\n", 379 | " 'isnat',\n", 380 | " 'isneginf',\n", 381 | " 'isposinf',\n", 382 | " 'isreal',\n", 383 | " 'isrealobj',\n", 384 | " 'isscalar',\n", 385 | " 'issctype',\n", 386 | " 'issubclass_',\n", 387 | " 'issubdtype',\n", 388 | " 'issubsctype',\n", 389 | " 'iterable',\n", 390 | " 'ix_',\n", 391 | " 'kaiser',\n", 392 | " 'kron',\n", 393 | " 'lcm',\n", 394 | " 'ldexp',\n", 395 | " 'left_shift',\n", 396 | " 'less',\n", 397 | " 'less_equal',\n", 398 | " 'lexsort',\n", 399 | " 'lib',\n", 400 | " 'linalg',\n", 401 | " 'linspace',\n", 402 | " 'little_endian',\n", 403 | " 'load',\n", 404 | " 'loads',\n", 405 | " 'loadtxt',\n", 406 | " 'log',\n", 407 | " 'log10',\n", 408 | " 'log1p',\n", 409 | " 'log2',\n", 410 | " 'logaddexp',\n", 411 | " 'logaddexp2',\n", 412 | " 'logical_and',\n", 413 | " 'logical_not',\n", 414 | " 'logical_or',\n", 415 | " 'logical_xor',\n", 416 | " 'logspace',\n", 417 | " 'longcomplex',\n", 418 | " 'longdouble',\n", 419 | " 'longfloat',\n", 420 | " 'longlong',\n", 421 | " 'lookfor',\n", 422 | " 'ma',\n", 423 | " 'mafromtxt',\n", 424 | " 'mask_indices',\n", 425 | " 'mat',\n", 426 | " 'math',\n", 427 | " 'matmul',\n", 428 | " 'matrix',\n", 429 | " 'matrixlib',\n", 430 | " 'max',\n", 431 | " 'maximum',\n", 432 | " 'maximum_sctype',\n", 433 | " 'may_share_memory',\n", 434 | " 'mean',\n", 435 | " 'median',\n", 436 | " 'memmap',\n", 437 | " 'meshgrid',\n", 438 | " 'mgrid',\n", 439 | " 'min',\n", 440 | " 'min_scalar_type',\n", 441 | " 'minimum',\n", 442 | " 'mintypecode',\n", 443 | " 'mod',\n", 444 | " 'modf',\n", 445 | " 'moveaxis',\n", 446 | " 'msort',\n", 447 | " 'multiply',\n", 448 | " 'nan',\n", 449 | " 'nan_to_num',\n", 450 | " 'nanargmax',\n", 451 | " 'nanargmin',\n", 452 | " 'nancumprod',\n", 453 | " 'nancumsum',\n", 454 | " 'nanmax',\n", 455 | " 'nanmean',\n", 456 | " 'nanmedian',\n", 457 | " 'nanmin',\n", 458 | " 'nanpercentile',\n", 459 | " 'nanprod',\n", 460 | " 'nanquantile',\n", 461 | " 'nanstd',\n", 462 | " 'nansum',\n", 463 | " 'nanvar',\n", 464 | " 'nbytes',\n", 465 | " 'ndarray',\n", 466 | " 'ndenumerate',\n", 467 | " 'ndfromtxt',\n", 468 | " 'ndim',\n", 469 | " 'ndindex',\n", 470 | " 'nditer',\n", 471 | " 'negative',\n", 472 | " 'nested_iters',\n", 473 | " 'newaxis',\n", 474 | " 'nextafter',\n", 475 | " 'nonzero',\n", 476 | " 'not_equal',\n", 477 | " 'numarray',\n", 478 | " 'number',\n", 479 | " 'obj2sctype',\n", 480 | " 'object0',\n", 481 | " 'object_',\n", 482 | " 'ogrid',\n", 483 | " 'oldnumeric',\n", 484 | " 'ones',\n", 485 | " 'ones_like',\n", 486 | " 'os',\n", 487 | " 'outer',\n", 488 | " 'packbits',\n", 489 | " 'pad',\n", 490 | " 'partition',\n", 491 | " 'percentile',\n", 492 | " 'pi',\n", 493 | " 'piecewise',\n", 494 | " 'place',\n", 495 | " 'poly',\n", 496 | " 'poly1d',\n", 497 | " 'polyadd',\n", 498 | " 'polyder',\n", 499 | " 'polydiv',\n", 500 | " 'polyfit',\n", 501 | " 'polyint',\n", 502 | " 'polymul',\n", 503 | " 'polynomial',\n", 504 | " 'polysub',\n", 505 | " 'polyval',\n", 506 | " 'positive',\n", 507 | " 'power',\n", 508 | " 'printoptions',\n", 509 | " 'prod',\n", 510 | " 'product',\n", 511 | " 'promote_types',\n", 512 | " 'ptp',\n", 513 | " 'put',\n", 514 | " 'put_along_axis',\n", 515 | " 'putmask',\n", 516 | " 'quantile',\n", 517 | " 'r_',\n", 518 | " 'rad2deg',\n", 519 | " 'radians',\n", 520 | " 'random',\n", 521 | " 'ravel',\n", 522 | " 'ravel_multi_index',\n", 523 | " 'real',\n", 524 | " 'real_if_close',\n", 525 | " 'rec',\n", 526 | " 'recarray',\n", 527 | " 'recfromcsv',\n", 528 | " 'recfromtxt',\n", 529 | " 'reciprocal',\n", 530 | " 'record',\n", 531 | " 'remainder',\n", 532 | " 'repeat',\n", 533 | " 'require',\n", 534 | " 'reshape',\n", 535 | " 'resize',\n", 536 | " 'result_type',\n", 537 | " 'right_shift',\n", 538 | " 'rint',\n", 539 | " 'roll',\n", 540 | " 'rollaxis',\n", 541 | " 'roots',\n", 542 | " 'rot90',\n", 543 | " 'round',\n", 544 | " 'round_',\n", 545 | " 'row_stack',\n", 546 | " 's_',\n", 547 | " 'safe_eval',\n", 548 | " 'save',\n", 549 | " 'savetxt',\n", 550 | " 'savez',\n", 551 | " 'savez_compressed',\n", 552 | " 'sctype2char',\n", 553 | " 'sctypeDict',\n", 554 | " 'sctypes',\n", 555 | " 'searchsorted',\n", 556 | " 'select',\n", 557 | " 'set_numeric_ops',\n", 558 | " 'set_printoptions',\n", 559 | " 'set_string_function',\n", 560 | " 'setbufsize',\n", 561 | " 'setdiff1d',\n", 562 | " 'seterr',\n", 563 | " 'seterrcall',\n", 564 | " 'seterrobj',\n", 565 | " 'setxor1d',\n", 566 | " 'shape',\n", 567 | " 'shares_memory',\n", 568 | " 'short',\n", 569 | " 'show_config',\n", 570 | " 'sign',\n", 571 | " 'signbit',\n", 572 | " 'signedinteger',\n", 573 | " 'sin',\n", 574 | " 'sinc',\n", 575 | " 'single',\n", 576 | " 'singlecomplex',\n", 577 | " 'sinh',\n", 578 | " 'size',\n", 579 | " 'sometrue',\n", 580 | " 'sort',\n", 581 | " 'sort_complex',\n", 582 | " 'source',\n", 583 | " 'spacing',\n", 584 | " 'split',\n", 585 | " 'sqrt',\n", 586 | " 'square',\n", 587 | " 'squeeze',\n", 588 | " 'stack',\n", 589 | " 'std',\n", 590 | " 'str0',\n", 591 | " 'str_',\n", 592 | " 'string_',\n", 593 | " 'subtract',\n", 594 | " 'sum',\n", 595 | " 'swapaxes',\n", 596 | " 'sys',\n", 597 | " 'take',\n", 598 | " 'take_along_axis',\n", 599 | " 'tan',\n", 600 | " 'tanh',\n", 601 | " 'tensordot',\n", 602 | " 'test',\n", 603 | " 'testing',\n", 604 | " 'tile',\n", 605 | " 'timedelta64',\n", 606 | " 'trace',\n", 607 | " 'tracemalloc_domain',\n", 608 | " 'transpose',\n", 609 | " 'trapz',\n", 610 | " 'tri',\n", 611 | " 'tril',\n", 612 | " 'tril_indices',\n", 613 | " 'tril_indices_from',\n", 614 | " 'trim_zeros',\n", 615 | " 'triu',\n", 616 | " 'triu_indices',\n", 617 | " 'triu_indices_from',\n", 618 | " 'true_divide',\n", 619 | " 'trunc',\n", 620 | " 'typecodes',\n", 621 | " 'typename',\n", 622 | " 'ubyte',\n", 623 | " 'ufunc',\n", 624 | " 'uint',\n", 625 | " 'uint0',\n", 626 | " 'uint16',\n", 627 | " 'uint32',\n", 628 | " 'uint64',\n", 629 | " 'uint8',\n", 630 | " 'uintc',\n", 631 | " 'uintp',\n", 632 | " 'ulonglong',\n", 633 | " 'unicode_',\n", 634 | " 'union1d',\n", 635 | " 'unique',\n", 636 | " 'unpackbits',\n", 637 | " 'unravel_index',\n", 638 | " 'unsignedinteger',\n", 639 | " 'unwrap',\n", 640 | " 'use_hugepage',\n", 641 | " 'ushort',\n", 642 | " 'vander',\n", 643 | " 'var',\n", 644 | " 'vdot',\n", 645 | " 'vectorize',\n", 646 | " 'version',\n", 647 | " 'void',\n", 648 | " 'void0',\n", 649 | " 'vsplit',\n", 650 | " 'vstack',\n", 651 | " 'w',\n", 652 | " 'warnings',\n", 653 | " 'where',\n", 654 | " 'who',\n", 655 | " 'zeros',\n", 656 | " 'zeros_like']" 657 | ] 658 | }, 659 | "execution_count": 3, 660 | "metadata": {}, 661 | "output_type": "execute_result" 662 | } 663 | ], 664 | "source": [ 665 | "dir(np)" 666 | ] 667 | }, 668 | { 669 | "cell_type": "code", 670 | "execution_count": 4, 671 | "id": "640f7b5a", 672 | "metadata": {}, 673 | "outputs": [ 674 | { 675 | "name": "stdout", 676 | "output_type": "stream", 677 | "text": [ 678 | "Help on built-in function arange in module numpy:\n", 679 | "\n", 680 | "arange(...)\n", 681 | " arange([start,] stop[, step,], dtype=None, *, like=None)\n", 682 | " \n", 683 | " Return evenly spaced values within a given interval.\n", 684 | " \n", 685 | " Values are generated within the half-open interval ``[start, stop)``\n", 686 | " (in other words, the interval including `start` but excluding `stop`).\n", 687 | " For integer arguments the function is equivalent to the Python built-in\n", 688 | " `range` function, but returns an ndarray rather than a list.\n", 689 | " \n", 690 | " When using a non-integer step, such as 0.1, the results will often not\n", 691 | " be consistent. It is better to use `numpy.linspace` for these cases.\n", 692 | " \n", 693 | " Parameters\n", 694 | " ----------\n", 695 | " start : integer or real, optional\n", 696 | " Start of interval. The interval includes this value. The default\n", 697 | " start value is 0.\n", 698 | " stop : integer or real\n", 699 | " End of interval. The interval does not include this value, except\n", 700 | " in some cases where `step` is not an integer and floating point\n", 701 | " round-off affects the length of `out`.\n", 702 | " step : integer or real, optional\n", 703 | " Spacing between values. For any output `out`, this is the distance\n", 704 | " between two adjacent values, ``out[i+1] - out[i]``. The default\n", 705 | " step size is 1. If `step` is specified as a position argument,\n", 706 | " `start` must also be given.\n", 707 | " dtype : dtype\n", 708 | " The type of the output array. If `dtype` is not given, infer the data\n", 709 | " type from the other input arguments.\n", 710 | " like : array_like\n", 711 | " Reference object to allow the creation of arrays which are not\n", 712 | " NumPy arrays. If an array-like passed in as ``like`` supports\n", 713 | " the ``__array_function__`` protocol, the result will be defined\n", 714 | " by it. In this case, it ensures the creation of an array object\n", 715 | " compatible with that passed in via this argument.\n", 716 | " \n", 717 | " .. versionadded:: 1.20.0\n", 718 | " \n", 719 | " Returns\n", 720 | " -------\n", 721 | " arange : ndarray\n", 722 | " Array of evenly spaced values.\n", 723 | " \n", 724 | " For floating point arguments, the length of the result is\n", 725 | " ``ceil((stop - start)/step)``. Because of floating point overflow,\n", 726 | " this rule may result in the last element of `out` being greater\n", 727 | " than `stop`.\n", 728 | " \n", 729 | " See Also\n", 730 | " --------\n", 731 | " numpy.linspace : Evenly spaced numbers with careful handling of endpoints.\n", 732 | " numpy.ogrid: Arrays of evenly spaced numbers in N-dimensions.\n", 733 | " numpy.mgrid: Grid-shaped arrays of evenly spaced numbers in N-dimensions.\n", 734 | " \n", 735 | " Examples\n", 736 | " --------\n", 737 | " >>> np.arange(3)\n", 738 | " array([0, 1, 2])\n", 739 | " >>> np.arange(3.0)\n", 740 | " array([ 0., 1., 2.])\n", 741 | " >>> np.arange(3,7)\n", 742 | " array([3, 4, 5, 6])\n", 743 | " >>> np.arange(3,7,2)\n", 744 | " array([3, 5])\n", 745 | "\n" 746 | ] 747 | } 748 | ], 749 | "source": [ 750 | "help(np.arange)" 751 | ] 752 | }, 753 | { 754 | "cell_type": "code", 755 | "execution_count": 5, 756 | "id": "37fdf39b", 757 | "metadata": {}, 758 | "outputs": [ 759 | { 760 | "name": "stdout", 761 | "output_type": "stream", 762 | "text": [ 763 | "[0 1 2 3 4 5 6 7 8 9]\n", 764 | "\n" 765 | ] 766 | } 767 | ], 768 | "source": [ 769 | "an_array = np.arange(10) # [)\n", 770 | "print(an_array)\n", 771 | "print(type(an_array))" 772 | ] 773 | }, 774 | { 775 | "cell_type": "code", 776 | "execution_count": 6, 777 | "id": "d9690399", 778 | "metadata": {}, 779 | "outputs": [], 780 | "source": [ 781 | "python_list = [i for i in range(10000)]\n", 782 | "numpy_array = np.arange(10000)" 783 | ] 784 | }, 785 | { 786 | "cell_type": "code", 787 | "execution_count": 15, 788 | "id": "bcd71b9a", 789 | "metadata": {}, 790 | "outputs": [ 791 | { 792 | "data": { 793 | "text/plain": [ 794 | "49995000" 795 | ] 796 | }, 797 | "execution_count": 15, 798 | "metadata": {}, 799 | "output_type": "execute_result" 800 | } 801 | ], 802 | "source": [ 803 | "sum(python_list)" 804 | ] 805 | }, 806 | { 807 | "cell_type": "code", 808 | "execution_count": 16, 809 | "id": "d256186e", 810 | "metadata": {}, 811 | "outputs": [ 812 | { 813 | "data": { 814 | "text/plain": [ 815 | "49995000" 816 | ] 817 | }, 818 | "execution_count": 16, 819 | "metadata": {}, 820 | "output_type": "execute_result" 821 | } 822 | ], 823 | "source": [ 824 | "np.sum(numpy_array)" 825 | ] 826 | }, 827 | { 828 | "cell_type": "code", 829 | "execution_count": 17, 830 | "id": "155fbf97", 831 | "metadata": {}, 832 | "outputs": [], 833 | "source": [ 834 | "import timeit" 835 | ] 836 | }, 837 | { 838 | "cell_type": "code", 839 | "execution_count": 18, 840 | "id": "2eca47b1", 841 | "metadata": {}, 842 | "outputs": [ 843 | { 844 | "data": { 845 | "text/plain": [ 846 | "['Timer',\n", 847 | " '__all__',\n", 848 | " '__builtins__',\n", 849 | " '__cached__',\n", 850 | " '__doc__',\n", 851 | " '__file__',\n", 852 | " '__loader__',\n", 853 | " '__name__',\n", 854 | " '__package__',\n", 855 | " '__spec__',\n", 856 | " '_globals',\n", 857 | " 'default_number',\n", 858 | " 'default_repeat',\n", 859 | " 'default_timer',\n", 860 | " 'dummy_src_name',\n", 861 | " 'gc',\n", 862 | " 'itertools',\n", 863 | " 'main',\n", 864 | " 'reindent',\n", 865 | " 'repeat',\n", 866 | " 'sys',\n", 867 | " 'template',\n", 868 | " 'time',\n", 869 | " 'timeit']" 870 | ] 871 | }, 872 | "execution_count": 18, 873 | "metadata": {}, 874 | "output_type": "execute_result" 875 | } 876 | ], 877 | "source": [ 878 | "dir(timeit)" 879 | ] 880 | }, 881 | { 882 | "cell_type": "code", 883 | "execution_count": 19, 884 | "id": "fe49f2d8", 885 | "metadata": {}, 886 | "outputs": [ 887 | { 888 | "name": "stdout", 889 | "output_type": "stream", 890 | "text": [ 891 | "Help on function timeit in module timeit:\n", 892 | "\n", 893 | "timeit(stmt='pass', setup='pass', timer=, number=1000000, globals=None)\n", 894 | " Convenience function to create Timer object and call timeit method.\n", 895 | "\n" 896 | ] 897 | } 898 | ], 899 | "source": [ 900 | "help(timeit.timeit)" 901 | ] 902 | }, 903 | { 904 | "cell_type": "code", 905 | "execution_count": 20, 906 | "id": "975097b8", 907 | "metadata": {}, 908 | "outputs": [], 909 | "source": [ 910 | "# standard Python\n", 911 | "standard_statement = \\\n", 912 | "'''\n", 913 | "s = 0\n", 914 | "for i in range(10000):\n", 915 | " s += i\n", 916 | "'''\n", 917 | "# standard Python but with list comprehension\n", 918 | "standard_list_comprehension = \\\n", 919 | "'''\n", 920 | "n = [i for i in range(10000)]\n", 921 | "s = sum(n)\n", 922 | "'''\n", 923 | "# Numpy array\n", 924 | "numpy_statement = \\\n", 925 | "'''\n", 926 | "import numpy as np\n", 927 | "n = np.arange(10000)\n", 928 | "s = np.sum(n)\n", 929 | "'''" 930 | ] 931 | }, 932 | { 933 | "cell_type": "code", 934 | "execution_count": 21, 935 | "id": "98655a4f", 936 | "metadata": {}, 937 | "outputs": [ 938 | { 939 | "data": { 940 | "text/plain": [ 941 | "0.25951783300001807" 942 | ] 943 | }, 944 | "execution_count": 21, 945 | "metadata": {}, 946 | "output_type": "execute_result" 947 | } 948 | ], 949 | "source": [ 950 | "timeit.timeit(standard_statement, number=1000)" 951 | ] 952 | }, 953 | { 954 | "cell_type": "code", 955 | "execution_count": 22, 956 | "id": "b2842bf2", 957 | "metadata": {}, 958 | "outputs": [ 959 | { 960 | "data": { 961 | "text/plain": [ 962 | "0.19481304200007798" 963 | ] 964 | }, 965 | "execution_count": 22, 966 | "metadata": {}, 967 | "output_type": "execute_result" 968 | } 969 | ], 970 | "source": [ 971 | "timeit.timeit(standard_list_comprehension, number=1000)" 972 | ] 973 | }, 974 | { 975 | "cell_type": "code", 976 | "execution_count": 23, 977 | "id": "5bc09907", 978 | "metadata": {}, 979 | "outputs": [ 980 | { 981 | "data": { 982 | "text/plain": [ 983 | "0.020677583000178856" 984 | ] 985 | }, 986 | "execution_count": 23, 987 | "metadata": {}, 988 | "output_type": "execute_result" 989 | } 990 | ], 991 | "source": [ 992 | "timeit.timeit(numpy_statement, number=1000)" 993 | ] 994 | }, 995 | { 996 | "cell_type": "code", 997 | "execution_count": 24, 998 | "id": "d5b7030f", 999 | "metadata": {}, 1000 | "outputs": [ 1001 | { 1002 | "name": "stdout", 1003 | "output_type": "stream", 1004 | "text": [ 1005 | "0x1171a6980 << Initial Memory Location\n", 1006 | "0x1171a6980:['0x10533e910']\n", 1007 | "0x1171a6980:['0x10533e910', '0x10533e930']\n", 1008 | "0x1171a6980:['0x10533e910', '0x10533e930', '0x10533e950']\n", 1009 | "0x1171a6980:['0x10533e910', '0x10533e930', '0x10533e950', '0x10533e970']\n", 1010 | "0x1171a6980:['0x10533e910', '0x10533e930', '0x10533e950', '0x10533e970', '0x10533e990']\n" 1011 | ] 1012 | } 1013 | ], 1014 | "source": [ 1015 | "n_standard = []\n", 1016 | "print(f\"{hex(id(n_standard))} << Initial Memory Location\")\n", 1017 | "for i in range(5):\n", 1018 | " n_standard.append(i)\n", 1019 | " print(f\"{hex(id(n_standard))}\", end=':')\n", 1020 | " print(f\"{[hex(id(x)) for x in n_standard]}\")" 1021 | ] 1022 | }, 1023 | { 1024 | "cell_type": "code", 1025 | "execution_count": 27, 1026 | "id": "8f3ad345", 1027 | "metadata": {}, 1028 | "outputs": [ 1029 | { 1030 | "name": "stdout", 1031 | "output_type": "stream", 1032 | "text": [ 1033 | "0x114007810 << Initial Memory Location\n", 1034 | "0x1258f9030:['0x1258d35d0']\n", 1035 | "0x1258e1f90:['0x1258d3450', '0x1258d35d0']\n", 1036 | "0x1258f9090:['0x1258d36b0', '0x1258d3450', '0x1258d36b0']\n", 1037 | "0x1258f9030:['0x1258d35d0', '0x1258d3450', '0x1258d35d0', '0x1258d3450']\n", 1038 | "0x1258f9090:['0x1258d36b0', '0x1258d35d0', '0x1258d36b0', '0x1258d35d0', '0x1258d36b0']\n" 1039 | ] 1040 | } 1041 | ], 1042 | "source": [ 1043 | "n_numpy = np.array([])\n", 1044 | "print(f\"{hex(id(n_numpy))} << Initial Memory Location\")\n", 1045 | "for i in range(5):\n", 1046 | " n_numpy = np.append(n_numpy, np.array(i))\n", 1047 | " print(f\"{hex(id(n_numpy))}\", end=':')\n", 1048 | " print(f\"{[hex(id(x)) for x in n_numpy]}\")" 1049 | ] 1050 | }, 1051 | { 1052 | "cell_type": "code", 1053 | "execution_count": 28, 1054 | "id": "19c280cd", 1055 | "metadata": {}, 1056 | "outputs": [], 1057 | "source": [ 1058 | "standard_append = \\\n", 1059 | "'''\n", 1060 | "n = []\n", 1061 | "for i in range(10000):\n", 1062 | " n.append(i)\n", 1063 | "'''\n", 1064 | "numpy_append = \\\n", 1065 | "'''\n", 1066 | "import numpy as np\n", 1067 | "n = np.array([])\n", 1068 | "for i in range(10000):\n", 1069 | " n = np.append(n, np.array(i))\n", 1070 | "'''" 1071 | ] 1072 | }, 1073 | { 1074 | "cell_type": "code", 1075 | "execution_count": 29, 1076 | "id": "ce02afe8", 1077 | "metadata": {}, 1078 | "outputs": [ 1079 | { 1080 | "data": { 1081 | "text/plain": [ 1082 | "0.04374708399996052" 1083 | ] 1084 | }, 1085 | "execution_count": 29, 1086 | "metadata": {}, 1087 | "output_type": "execute_result" 1088 | } 1089 | ], 1090 | "source": [ 1091 | "timeit.timeit(standard_append, number=100)" 1092 | ] 1093 | }, 1094 | { 1095 | "cell_type": "code", 1096 | "execution_count": 30, 1097 | "id": "f55f1808", 1098 | "metadata": {}, 1099 | "outputs": [ 1100 | { 1101 | "data": { 1102 | "text/plain": [ 1103 | "3.061996166999961" 1104 | ] 1105 | }, 1106 | "execution_count": 30, 1107 | "metadata": {}, 1108 | "output_type": "execute_result" 1109 | } 1110 | ], 1111 | "source": [ 1112 | "timeit.timeit(numpy_append, number=100)" 1113 | ] 1114 | }, 1115 | { 1116 | "cell_type": "code", 1117 | "execution_count": null, 1118 | "id": "95d1ad48", 1119 | "metadata": {}, 1120 | "outputs": [], 1121 | "source": [] 1122 | } 1123 | ], 1124 | "metadata": { 1125 | "kernelspec": { 1126 | "display_name": "Python 3 (ipykernel)", 1127 | "language": "python", 1128 | "name": "python3" 1129 | }, 1130 | "language_info": { 1131 | "codemirror_mode": { 1132 | "name": "ipython", 1133 | "version": 3 1134 | }, 1135 | "file_extension": ".py", 1136 | "mimetype": "text/x-python", 1137 | "name": "python", 1138 | "nbconvert_exporter": "python", 1139 | "pygments_lexer": "ipython3", 1140 | "version": "3.9.15" 1141 | } 1142 | }, 1143 | "nbformat": 4, 1144 | "nbformat_minor": 5 1145 | } 1146 | -------------------------------------------------------------------------------- /Week03/mutability.log: -------------------------------------------------------------------------------- 1 | INFO @ 12.03.2023 16:29:14 : [START] 2 | INFO @ 12.03.2023 16:29:14 : [TEST] 1 / 16 Integer test : succeeded 3 | INFO @ 12.03.2023 16:29:14 : [TEST] 2 / 16 Float test : succeeded 4 | INFO @ 12.03.2023 16:29:14 : [TEST] 3 / 16 String test : succeeded 5 | INFO @ 12.03.2023 16:29:14 : [TEST] 4 / 16 Boolean test : succeeded 6 | INFO @ 12.03.2023 16:29:14 : [TEST] 5 / 16 Complex test : succeeded 7 | INFO @ 12.03.2023 16:29:14 : [TEST] 6 / 16 List test : succeeded 8 | INFO @ 12.03.2023 16:29:14 : [TEST] 7 / 16 Tuple test : succeeded 9 | INFO @ 12.03.2023 16:29:14 : [TEST] 8 / 16 Set test : succeeded 10 | INFO @ 12.03.2023 16:29:14 : [TEST] 9 / 16 Dict test : succeeded 11 | ERROR @ 12.03.2023 16:29:14 : [TEST] 10 / 16 Another Integer test : failed 12 | ERROR @ 12.03.2023 16:29:14 : [TEST] 11 / 16 Another Float test : Expected value not supported 13 | ERROR @ 12.03.2023 16:29:14 : [TEST] 12 / 16 Another String test : Expected value not supported 14 | ERROR @ 12.03.2023 16:29:14 : [TEST] 13 / 16 True : Test name not supported 15 | INFO @ 12.03.2023 16:29:14 : [TEST] 14 / 16 Numpy test : succeeded 16 | INFO @ 12.03.2023 16:29:14 : [TEST] 15 / 16 Pandas series test : succeeded 17 | INFO @ 12.03.2023 16:29:14 : [TEST] 16 / 16 Pandas dataframe test : succeeded 18 | INFO @ 12.03.2023 16:29:14 : [END] 19 | -------------------------------------------------------------------------------- /Week03/mutability.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | 4 | 5 | def is_mutable(x) -> bool: 6 | """ 7 | Check if the input is mutable or not 8 | :param x: any 9 | :return: bool 10 | """ 11 | mutables = (list, set, dict) 12 | immutables = (int, float, bool, complex, str, tuple) 13 | if isinstance(x, immutables): 14 | return False 15 | elif isinstance(x, mutables): 16 | return True 17 | else: 18 | raise TypeError("Type not supported") 19 | 20 | 21 | class MutabilityTest: 22 | def __init__(self, start_message="[START]", end_message="[END]"): 23 | self.start_message = start_message 24 | self.end_message = end_message 25 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict) 26 | self._tests = [ 27 | {"input": 1, "expected": False, "test_name": "Integer test"}, 28 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 29 | {"input": "1", "expected": False, "test_name": "String test"}, 30 | {"input": True, "expected": False, "test_name": "Boolean test"}, 31 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 32 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 33 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 34 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 35 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 36 | ] 37 | 38 | def __enter__(self): 39 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 40 | datefmt='%d.%m.%Y %H:%M:%S', 41 | level=logging.INFO, 42 | force=True, 43 | handlers=[logging.FileHandler("Week03/mutability.log", mode='w'), logging.StreamHandler()]) 44 | logging.info(self.start_message) 45 | return self 46 | 47 | def __exit__(self, exc_type, exc_val, exc_tb): 48 | logging.info(self.end_message) 49 | return True 50 | 51 | def __call__(self, *args, **kwargs): 52 | for test in self._tests: 53 | test_str = f"[TEST] {self._tests.index(test)+1:2d} / {len(self._tests):2d} {test['test_name']} :" 54 | if not isinstance(test["input"], self.__types): 55 | logging.error(f"{test_str} Type not supported") 56 | continue 57 | if not isinstance(test["expected"], bool): 58 | logging.error(f"{test_str} Expected value not supported") 59 | continue 60 | if not isinstance(test["test_name"], str): 61 | logging.error(f"{test_str} Test name not supported") 62 | continue 63 | try: 64 | assert is_mutable(test["input"]) is test["expected"] 65 | except Exception as e: 66 | logging.error(f"{test_str} failed {e}") 67 | else: 68 | logging.info(f"{test_str} succeeded") 69 | 70 | 71 | def main(): 72 | with MutabilityTest() as mutability_test: 73 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 74 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 75 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 76 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 77 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 78 | mutability_test() 79 | 80 | # TODO 81 | # add Numpy Array, Pandas Series, Pandas DataFrame support 82 | 83 | if __name__ == "__main__": 84 | main() 85 | -------------------------------------------------------------------------------- /Week03/mutability_barangokcekli.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | import pandas as pd 4 | 5 | 6 | def is_mutable(x) -> bool: 7 | """ 8 | Check if the input is mutable or not 9 | :param x: any 10 | :return: bool 11 | """ 12 | mutables = (list, set, dict, np.ndarray, pd.Series, pd.DataFrame) 13 | immutables = (int, float, bool, complex, str, tuple) 14 | if isinstance(x, immutables): 15 | return False 16 | elif isinstance(x, mutables): 17 | return True 18 | else: 19 | raise TypeError("Type not supported") 20 | 21 | 22 | class MutabilityTest: 23 | def __init__(self, start_message="[START]", end_message="[END]"): 24 | self.start_message = start_message 25 | self.end_message = end_message 26 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict, np.ndarray, pd.Series, pd.DataFrame) 27 | self._tests = [ 28 | {"input": 1, "expected": False, "test_name": "Integer test"}, 29 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 30 | {"input": "1", "expected": False, "test_name": "String test"}, 31 | {"input": True, "expected": False, "test_name": "Boolean test"}, 32 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 33 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 34 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 35 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 36 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 37 | ] 38 | 39 | def __enter__(self): 40 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 41 | datefmt='%d.%m.%Y %H:%M:%S', 42 | level=logging.INFO, 43 | force=True, 44 | handlers=[logging.FileHandler("Week03/mutability.log", mode='w'), logging.StreamHandler()]) 45 | logging.info(self.start_message) 46 | return self 47 | 48 | def __exit__(self, exc_type, exc_val, exc_tb): 49 | logging.info(self.end_message) 50 | return True 51 | 52 | def __call__(self, *args, **kwargs): 53 | 54 | for i in range(len(self._tests)): 55 | test_str = f"[TEST] {i+1:2d} / {len(self._tests):2d} {self._tests[i]['test_name']} :" 56 | if not isinstance(self._tests[i]["input"], self.__types): 57 | logging.error(f"{test_str} Type not supported") 58 | continue 59 | if not isinstance(self._tests[i]["expected"], bool): 60 | logging.error(f"{test_str} Expected value not supported") 61 | continue 62 | if not isinstance(self._tests[i]["test_name"], str): 63 | logging.error(f"{test_str} Test name not supported") 64 | continue 65 | try: 66 | assert is_mutable(self._tests[i]["input"]) is self._tests[i]["expected"] 67 | except Exception as e: 68 | logging.error(f"{test_str} failed {e}") 69 | else: 70 | logging.info(f"{test_str} succeeded") 71 | 72 | 73 | 74 | def main(): 75 | with MutabilityTest() as mutability_test: 76 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 77 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 78 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 79 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 80 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 81 | mutability_test._tests.append({"input": pd.Series([1, 2, 3]), "expected": True, "test_name": "Pandas Series test"}) 82 | mutability_test._tests.append({"input": pd.DataFrame(data= {'col1': [1, 2], 'col2': [3, 4]}), "expected": True, "test_name": "Pandas DataFrame test"}) 83 | mutability_test() 84 | 85 | 86 | if __name__ == "__main__": 87 | main() 88 | -------------------------------------------------------------------------------- /Week03/mutability_efecan_erdem1.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | import pandas as pd 4 | 5 | 6 | def is_mutable(x) -> bool: 7 | """ 8 | Check if the input is mutable or not 9 | :param x: any 10 | :return: bool 11 | """ 12 | mutables = (list, set, dict, np.ndarray, pd.Series, pd.DataFrame) 13 | immutables = (int, float, bool, complex, str, tuple) 14 | if isinstance(x, immutables): 15 | return False 16 | elif isinstance(x, mutables): 17 | return True 18 | else: 19 | raise TypeError("Type not supported") 20 | 21 | 22 | class MutabilityTest: 23 | def __init__(self, start_message="[START]", end_message="[END]"): 24 | self.start_message = start_message 25 | self.end_message = end_message 26 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict, np.ndarray, pd.Series, pd.DataFrame) 27 | self._tests = [ 28 | {"input": 1, "expected": False, "test_name": "Integer test"}, 29 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 30 | {"input": "1", "expected": False, "test_name": "String test"}, 31 | {"input": True, "expected": False, "test_name": "Boolean test"}, 32 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 33 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 34 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 35 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 36 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 37 | ] 38 | 39 | def __enter__(self): 40 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 41 | datefmt='%d.%m.%Y %H:%M:%S', 42 | level=logging.INFO, 43 | force=True, 44 | handlers=[logging.FileHandler("./mutability.log", mode='w'), logging.StreamHandler()]) 45 | logging.info(self.start_message) 46 | return self 47 | 48 | def __exit__(self, exc_type, exc_val, exc_tb): 49 | logging.info(self.end_message) 50 | return True 51 | 52 | def __call__(self, *args, **kwargs): 53 | for testIndex in range(len(self._tests)): 54 | test_str = f"[TEST] {testIndex+1:2d} / {len(self._tests):2d} {self._tests[testIndex]['test_name']} :" 55 | if not isinstance(self._tests[testIndex]["input"], self.__types): 56 | logging.error(f"{test_str} Type not supported") 57 | continue 58 | if not isinstance(self._tests[testIndex]["expected"], bool): 59 | logging.error(f"{test_str} Expected value not supported") 60 | continue 61 | if not isinstance(self._tests[testIndex]["test_name"], str): 62 | logging.error(f"{test_str} Test name not supported") 63 | continue 64 | try: 65 | assert is_mutable(self._tests[testIndex]["input"]) is self._tests[testIndex]["expected"] 66 | except Exception as e: 67 | logging.error(f"{test_str} failed {e}") 68 | else: 69 | logging.info(f"{test_str} succeeded") 70 | 71 | def main(): 72 | with MutabilityTest() as mutability_test: 73 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 74 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 75 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 76 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 77 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 78 | mutability_test._tests.append({"input": pd.Series([5, 2, 11, 45, 66]), "expected": False, "test_name": "Pandas Series test"}) 79 | mutability_test._tests.append({"input": pd.DataFrame({"calories": [420, 380, 390],"duration": [50, 40, 45]}), "expected": False, "test_name": "Pandas DataFrame test"}) 80 | mutability_test() 81 | 82 | # TODO 83 | # add Numpy Array, Pandas Series, Pandas DataFrame support 84 | 85 | if __name__ == "__main__": 86 | main() -------------------------------------------------------------------------------- /Week03/mutability_mertozgenn.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | import pandas as pd 4 | 5 | 6 | def is_mutable(x) -> bool: 7 | """ 8 | Check if the input is mutable or not 9 | :param x: any 10 | :return: bool 11 | """ 12 | mutables = (list, set, dict, np.ndarray, pd.Series, pd.DataFrame) 13 | immutables = (int, float, bool, complex, str, tuple) 14 | if isinstance(x, immutables): 15 | return False 16 | elif isinstance(x, mutables): 17 | return True 18 | else: 19 | raise TypeError("Type not supported") 20 | 21 | 22 | class MutabilityTest: 23 | def __init__(self, start_message="[START]", end_message="[END]"): 24 | self.start_message = start_message 25 | self.end_message = end_message 26 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict, np.ndarray, pd.Series, pd.DataFrame) 27 | self._tests = [ 28 | {"input": 1, "expected": False, "test_name": "Integer test"}, 29 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 30 | {"input": "1", "expected": False, "test_name": "String test"}, 31 | {"input": True, "expected": False, "test_name": "Boolean test"}, 32 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 33 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 34 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 35 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 36 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 37 | ] 38 | 39 | def __enter__(self): 40 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 41 | datefmt='%d.%m.%Y %H:%M:%S', 42 | level=logging.INFO, 43 | force=True, 44 | handlers=[logging.FileHandler("mutability.log", mode='w'), logging.StreamHandler()]) 45 | logging.info(self.start_message) 46 | return self 47 | 48 | def __exit__(self, exc_type, exc_val, exc_tb): 49 | logging.info(self.end_message) 50 | return True 51 | 52 | def __call__(self, *args, **kwargs): 53 | for index, test in enumerate(self._tests): 54 | test_str = f"[TEST] {index + 1:2d} / {len(self._tests):2d} {test['test_name']} :" 55 | if not isinstance(test["input"], self.__types): 56 | logging.error(f"{test_str} Type not supported") 57 | continue 58 | if not isinstance(test["expected"], bool): 59 | logging.error(f"{test_str} Expected value not supported") 60 | continue 61 | if not isinstance(test["test_name"], str): 62 | logging.error(f"{test_str} Test name not supported") 63 | continue 64 | try: 65 | assert is_mutable(test["input"]) is test["expected"] 66 | except Exception as e: 67 | logging.error(f"{test_str} failed {e}") 68 | else: 69 | logging.info(f"{test_str} succeeded") 70 | 71 | 72 | def main(): 73 | with MutabilityTest() as mutability_test: 74 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 75 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 76 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 77 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 78 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 79 | mutability_test._tests.append({"input": pd.Series([1, 2, 3]), "expected": True, "test_name": "Pandas Series test"}) 80 | mutability_test._tests.append({"input": pd.DataFrame(data={"col1": [1, 2, 3]}), "expected": True, "test_name": "Pandas DataFrame test"}) 81 | mutability_test() 82 | 83 | 84 | if __name__ == "__main__": 85 | main() 86 | -------------------------------------------------------------------------------- /Week03/mutability_onur_yasar.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | import pandas as pd 4 | 5 | def is_mutable(x) -> bool: 6 | """ 7 | Check if the input is mutable or not 8 | :param x: any 9 | :return: bool 10 | """ 11 | mutables = (list, set, dict, pd.DataFrame, pd.Series, np.ndarray) 12 | immutables = (int, float, bool, complex, str, tuple) 13 | if isinstance(x, immutables): 14 | return False 15 | elif isinstance(x, mutables): 16 | return True 17 | else: 18 | raise TypeError("Type not supported") 19 | 20 | 21 | class MutabilityTest: 22 | def __init__(self, start_message="[START]", end_message="[END]"): 23 | self.start_message = start_message 24 | self.end_message = end_message 25 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict, pd.DataFrame, pd.Series, np.ndarray) 26 | self._tests = [ 27 | {"input": 1, "expected": False, "test_name": "Integer test"}, 28 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 29 | {"input": "1", "expected": False, "test_name": "String test"}, 30 | {"input": True, "expected": False, "test_name": "Boolean test"}, 31 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 32 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 33 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 34 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 35 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 36 | ] 37 | 38 | def __enter__(self): 39 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 40 | datefmt='%d.%m.%Y %H:%M:%S', 41 | level=logging.INFO, 42 | handlers=[logging.FileHandler("Week03/mutability.log", mode='w'), logging.StreamHandler()]) 43 | logging.info(self.start_message) 44 | return self 45 | 46 | def __exit__(self, exc_type, exc_val, exc_tb): 47 | logging.info(self.end_message) 48 | return True 49 | 50 | def __call__(self, *args, **kwargs): 51 | for index, test in enumerate(self._tests): 52 | test_str = f"[TEST] {index+1:2d} / {len(self._tests):2d} {test['test_name']} :" 53 | if not isinstance(test["input"], self.__types): 54 | logging.error(f"{test_str} Type not supported") 55 | continue 56 | if not isinstance(test["expected"], bool): 57 | logging.error(f"{test_str} Expected value not supported") 58 | continue 59 | if not isinstance(test["test_name"], str): 60 | logging.error(f"{test_str} Test name not supported") 61 | continue 62 | try: 63 | assert is_mutable(test["input"]) is test["expected"] 64 | except Exception as e: 65 | logging.error(f"{test_str} failed {e}") 66 | else: 67 | logging.info(f"{test_str} succeeded") 68 | 69 | 70 | def main(): 71 | with MutabilityTest() as mutability_test: 72 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 73 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 74 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 75 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 76 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 77 | mutability_test._tests.append({"input": pd.Series([1,2,3]), "expected": True, "test_name": "Pandas series test"}) 78 | mutability_test._tests.append({"input": pd.DataFrame({"example": "test", "test": [1,2,3]}), "expected": True, "test_name": "Pandas dataframe test"}) 79 | mutability_test() 80 | 81 | 82 | if __name__ == "__main__": 83 | main() 84 | -------------------------------------------------------------------------------- /Week03/mutability_sinem_gencer.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import numpy as np 3 | import pandas as pd 4 | 5 | def is_mutable(x) -> bool: 6 | """ 7 | Check if the input is mutable or not 8 | :param x: any 9 | :return: bool 10 | """ 11 | mutables = (list, set, dict, np.array, pd.Series, pd.DataFrame) 12 | immutables = (int, float, bool, complex, str, tuple) 13 | if isinstance(x, immutables): 14 | return False 15 | elif isinstance(x, mutables): 16 | return True 17 | else: 18 | raise TypeError("Type not supported") 19 | 20 | 21 | class MutabilityTest: 22 | def __init__(self, start_message="[START]", end_message="[END]"): 23 | self.start_message = start_message 24 | self.end_message = end_message 25 | self.__types = (int, float, str, bool, complex, list, tuple, set, dict, np.array, pd.Series, pd.DataFrame) 26 | self._tests = [ 27 | {"input": 1, "expected": False, "test_name": "Integer test"}, 28 | {"input": 1.0, "expected": False, "test_name": "Float test"}, 29 | {"input": "1", "expected": False, "test_name": "String test"}, 30 | {"input": True, "expected": False, "test_name": "Boolean test"}, 31 | {"input": 1j, "expected": False, "test_name": "Complex test"}, 32 | {"input": [1, 2, 3], "expected": True, "test_name": "List test"}, 33 | {"input": (1, 2, 3), "expected": False, "test_name": "Tuple test"}, 34 | {"input": {1, 2, 3}, "expected": True, "test_name": "Set test"}, 35 | {"input": {1: 1, 2: 2, 3: 3}, "expected": True, "test_name": "Dict test"}, 36 | ] 37 | 38 | def __enter__(self): 39 | logging.basicConfig(format='%(levelname)s @ %(asctime)s : %(message)s', 40 | datefmt='%d.%m.%Y %H:%M:%S', 41 | level=logging.INFO, 42 | force=True, 43 | handlers=[logging.FileHandler("mutability.log", mode='w'), logging.StreamHandler()]) 44 | logging.info(self.start_message) 45 | return self 46 | 47 | def __exit__(self, exc_type, exc_val, exc_tb): 48 | logging.info(self.end_message) 49 | return True 50 | 51 | def __call__(self, *args, **kwargs): 52 | for test in self._tests: 53 | test_str = f"[TEST] {self._tests.index(test)+1:2d} / {len(self._tests):2d} {test['test_name']} :" 54 | if not isinstance(test["input"], self.__types): 55 | logging.i(f"{test_str} Type not supported") 56 | continue 57 | if not isinstance(test["expected"], bool): 58 | logging.info(f"{test_str} Expected value not supported") 59 | continue 60 | if not isinstance(test["test_name"], str): 61 | logging.info(f"{test_str} Test name not supported") 62 | continue 63 | try: 64 | assert is_mutable(test["input"]) is test["expected"] 65 | except Exception as e: 66 | logging.info(f"{test_str} failed {e}") 67 | else: 68 | logging.info(f"{test_str} succeeded") 69 | 70 | 71 | def main(): 72 | with MutabilityTest() as mutability_test: 73 | mutability_test._tests.append({"input": 1, "expected": True, "test_name": "Another Integer test"}) 74 | mutability_test._tests.append({"input": 1.0, "expected": 1, "test_name": "Another Float test"}) 75 | mutability_test._tests.append({"input": "1", "expected": "1", "test_name": "Another String test"}) 76 | mutability_test._tests.append({"input": True, "expected": True, "test_name": True}) 77 | mutability_test._tests.append({"input": np.array([1, 2, 3]), "expected": True, "test_name": "Numpy test"}) 78 | mutability_test._tests.append({"input": pd.Series([1,2,3]), "expected": True, "test_name": "Pandas Series test"}) 79 | mutability_test._tests.append({"input": pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}), "expected": True, "test_name": "Pandas DataFrame test"}) 80 | mutability_test() 81 | 82 | # TODO 83 | # add Numpy Array, Pandas Series, Pandas DataFrame support 84 | 85 | if __name__ == "__main__": 86 | main() 87 | -------------------------------------------------------------------------------- /Week04/IntroductoryPythonDataStructures.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canbula/DataVisualization/b5f2f92eb520f29ac983f4b90b8f76b3dd9ecb7e/Week04/IntroductoryPythonDataStructures.pdf -------------------------------------------------------------------------------- /Week04/fetchdata.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.options import Options 6 | from selenium.webdriver.common.by import By 7 | 8 | 9 | # TODO 10 | # 1. Do not get the table rows, which include the advertisement. 11 | # 2. Get the data from the next pages. 12 | 13 | 14 | chrome_options = Options() 15 | # chrome_options.add_argument("--headless") 16 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 17 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 18 | browser = webdriver.Chrome(f"{os.getcwd()}/Week04/chromedriver", options=chrome_options) 19 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 20 | browser.get(link) 21 | time.sleep(2) 22 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem') 23 | car_list = [] 24 | for c in cars: 25 | time.sleep(random.random()) 26 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 27 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 28 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 29 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 30 | try: 31 | car_list.append( 32 | { 33 | 'model': model[0].text, 34 | 'version': model[1].text, 35 | 'year': int(infos[0].text), 36 | 'km': int(infos[1].text.replace('.', '')), 37 | 'color': infos[2].text, 38 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 39 | 'location': location[0].text.replace('\n', ' ') 40 | } 41 | ) 42 | finally: 43 | continue 44 | print(car_list) 45 | time.sleep(5) 46 | browser.close() -------------------------------------------------------------------------------- /Week04/fetchdata_Ata_Ceyhun_ALACA.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | from selenium import webdriver 5 | from selenium.common.exceptions import NoSuchElementException 6 | from selenium.webdriver.chrome.options import Options 7 | from selenium.webdriver.common.by import By 8 | 9 | # TODO 10 | # 1. Skip the rows that include the ads. 11 | # 2. Continuously fetch data from all of the pages. 12 | 13 | chrome_options = Options() 14 | chrome_options.add_argument("Mozilla/5.0 (Windows NT 10.0; Win64; x64) " 15 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36") 16 | 17 | browser = webdriver.Chrome(f"{os.getcwd()}/chromedriver.exe", options=chrome_options) 18 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" # Opening the data source page 19 | browser.get(link) 20 | time.sleep(2) 21 | cars = browser.find_elements(by=By.CSS_SELECTOR, 22 | value='.searchResultsItem') # Selecting elements by CSS Class names using "find_elements" 23 | 24 | # Making a list of dictionaries to store car data 25 | car_list = [] 26 | # Iterating over the web page to fetch individual relevant car information 27 | 28 | while True: 29 | cars = browser.find_elements(by=By.CSS_SELECTOR, value="tr[class*=searchResultsItem]:not([class*=nativeAd])") 30 | for c in cars: 31 | time.sleep(random.random()) 32 | model = c.find_elements(by=By.CSS_SELECTOR, 33 | value='.searchResultsTagAttributeValue') # Fetching Series and model as an object 34 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 35 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 36 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 37 | try: # It will make the code block try and continue executing 38 | car_list.append( 39 | { 40 | 'Model': model[0].text, 41 | 'Version': model[1].text, 42 | 'Year': int(infos[0].text), 43 | 'Km': int(infos[1].text.replace('.', '')), 44 | 'Color': infos[2].text, 45 | 'Price': int(price[0].text.replace('.', '').replace('TL', '')), 46 | 'Location': location[0].text.replace('\n', ' ') 47 | } 48 | ) 49 | finally: 50 | continue 51 | try: 52 | next_button = browser.find_element(by=By.CSS_SELECTOR, value='a[class=prevNextBut][title=Sonraki]') 53 | browser.get(next_button.get_attribute('href')) 54 | time.sleep((random.random() * 9) + 1) 55 | except NoSuchElementException: 56 | break 57 | 58 | 59 | print(car_list) 60 | time.sleep(3) 61 | browser.close() 62 | -------------------------------------------------------------------------------- /Week04/fetchdata_ErenErsoyluoglu.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | import time 4 | from selenium import webdriver 5 | from selenium.webdriver.common.by import By 6 | from selenium.webdriver.firefox.options import Options 7 | 8 | 9 | 10 | 11 | # TODO 12 | # 1. Do not get the table rows, which include the advertisement. 13 | # 2. Get the data from the next pages. 14 | 15 | firefox_options = Options() 16 | firefox_options.profile = "C:/Users/Keofla/AppData/Roaming/Mozilla/Firefox/Profiles/pj3dzwe2.default" 17 | browser = webdriver.Firefox(options=firefox_options) 18 | 19 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 20 | 21 | time.sleep(2) 22 | car_list = [] 23 | while True: 24 | browser.get(link) 25 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd)') 26 | for c in cars: 27 | time.sleep(random.random()) 28 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 29 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 30 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 31 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 32 | try: 33 | car_list.append( 34 | { 35 | 'model': model[0].text, 36 | 'version': model[1].text, 37 | 'year': int(infos[0].text), 38 | 'km': int(infos[1].text.replace('.', '')), 39 | 'color': infos[2].text, 40 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 41 | 'location': location[0].text.replace('\n', ' ') 42 | } 43 | ) 44 | finally: 45 | continue 46 | 47 | try: 48 | next_page = browser.find_element(by = By.CSS_SELECTOR, value='.prevNextBut[title="Sonraki"]') 49 | link = next_page.get_attribute("href") 50 | except: 51 | break 52 | 53 | print(car_list) 54 | time.sleep(5) 55 | browser.close() 56 | -------------------------------------------------------------------------------- /Week04/fetchdata_Furkan_ERYILMAZ.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.chrome.options import Options 3 | from selenium.webdriver.common.by import By 4 | 5 | # Set up the browser and sample data link 6 | chrome_options = Options() 7 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 8 | browser = webdriver.Chrome(options=chrome_options) 9 | link = "https://www.sahibinden.com/jaguar?pagingSize=50" 10 | browser.get(link) 11 | 12 | # Detect the number of pieces of data 13 | search_result = browser.find_element(by=By.CSS_SELECTOR, value=".result-text-sub-group").text 14 | max_count = int(''.join(x for x in search_result if x.isdigit())) 15 | 16 | # Variable for changing the page 17 | paging_offset = 0 18 | 19 | car_list = [] 20 | # Iterate through all available pages, compartmentalise the data, and append to an array 21 | while paging_offset <= max_count: 22 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd)') 23 | for c in cars: 24 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 25 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 26 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 27 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 28 | try: 29 | car_list.append( 30 | { 31 | 'model': model[0].text, 32 | 'version': model[1].text, 33 | 'year': int(infos[0].text), 34 | 'km': int(infos[1].text.replace('.', '')), 35 | 'color': infos[2].text, 36 | 'price': { 37 | 'amount': int(price[0].text.split(" ")[0].replace(".", "")), 38 | 'currency': price[0].text.split(" ")[1] 39 | }, 40 | 'location': location[0].text.replace('\n', ' ') 41 | } 42 | ) 43 | finally: 44 | continue 45 | paging_offset += 50 46 | link = f"https://www.sahibinden.com/jaguar?pagingOffset={paging_offset}&pagingSize=50" 47 | browser.get(link) 48 | 49 | print(car_list) 50 | browser.close() -------------------------------------------------------------------------------- /Week04/fetchdata_HuseyinCan.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | 5 | import selenium 6 | from selenium import webdriver 7 | from selenium.common.exceptions import NoSuchElementException 8 | from selenium.webdriver.chrome.options import Options 9 | from selenium.webdriver.common.by import By 10 | from selenium.webdriver.support.ui import WebDriverWait 11 | from selenium.webdriver.support import expected_conditions as EC 12 | import asyncio 13 | 14 | class Car: 15 | 16 | def __init__(self,model,version,year,km,color,price,location): 17 | self.model=model 18 | self.version=version 19 | self.year=year 20 | self.km=km 21 | self.color=color 22 | self.price=price 23 | self.location=location 24 | 25 | 26 | def __str__(self): 27 | 28 | return f"model: {self.model} year: {self.year} version:{self.version} km:{self.km} color:{self.color} price:{self.price} location:{self.location}" 29 | 30 | # decorator for exception handler 31 | def exception(func): 32 | 33 | 34 | 35 | def excpt(*args,**kwargs): 36 | cardec_list=[] 37 | try: 38 | cardec_list=func(*args, **kwargs) 39 | except NoSuchElementException: 40 | print(" process finished") 41 | 42 | finally: 43 | 44 | return cardec_list 45 | return excpt 46 | 47 | 48 | # TODO 49 | # 1. Do not get the table rows, which include the advertisement. 50 | # 2. Get the data from the next pages. 51 | 52 | 53 | chrome_options = Options() 54 | # chrome_options.add_argument("--headless") 55 | chrome_options.add_argument("user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)" 56 | " Chrome/111.0.0.0 Safari/537.36'" 57 | ) 58 | 59 | browser = webdriver.Chrome(f"{os.getcwd()}/chromedriver", options=chrome_options) 60 | 61 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 62 | browser.maximize_window() 63 | 64 | browser.get(link) 65 | time.sleep(5) 66 | 67 | 68 | 69 | 70 | @exception 71 | def fetchDataaFromOnePage(car,cars_array): 72 | 73 | car_list = [] 74 | for i,c in enumerate(car): 75 | 76 | classOfElement=c.get_attribute("class").split(' ') 77 | 78 | if 'nativeAd' not in classOfElement: 79 | 80 | 81 | time.sleep(random.random()) 82 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 83 | 84 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 85 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 86 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 87 | 88 | 89 | modelcar = model[0].text, 90 | versioncar =model[1].text, 91 | yearcar = int(infos[0].text.lstrip()), 92 | kmcar = int(infos[1].text.replace('.', '')), 93 | colorcar = infos[2].text, 94 | pricecar = int(price[0].text.replace('.', '').replace('TL', '')), 95 | locationcar = location[0].text.replace('\n', ' ') 96 | 97 | car=Car(modelcar, versioncar, yearcar, kmcar, colorcar, pricecar, locationcar) 98 | print(str(car)) 99 | 100 | cars_array.append(car) 101 | car_list.append(car) 102 | 103 | ''' 104 | car_list.append( 105 | { 106 | 'model': model[0].text, 107 | 'version': model[1].text, 108 | 'year': int(float(infos[0].text.lstrip())), 109 | 'km': int(infos[1].text.replace('.', '')), 110 | 'color': infos[2].text, 111 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 112 | 'location': location[0].text.replace('\n', ' ') 113 | } 114 | ) 115 | ''' 116 | return car_list 117 | 118 | 119 | @exception 120 | def fetchDataAllOfThem(cars_array,cars_in_page): 121 | page_num=1 122 | i=1 123 | 124 | while True: 125 | print(f"******************************PAGE NUMBER: {page_num}************************************************") 126 | time.sleep(5) 127 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem') 128 | cars_onepage=fetchDataaFromOnePage(cars,cars_array) 129 | # indexs of this list holds cars in per page 130 | cars_in_page.append(cars_onepage) 131 | xpath = f"//*[@id='searchResultsSearchForm']/div/div[4]/div[3]/div[1]/ul/li[1{i}]" 132 | prev_next_button=browser.find_element_by_xpath(xpath).find_element_by_css_selector("a") 133 | 134 | browser.execute_script("arguments[0].click();",prev_next_button) 135 | page_num+=1 136 | 137 | if i==1 or page_num==6: 138 | i+=1 139 | 140 | carss=[] 141 | cars_in_page=[] 142 | fetchDataAllOfThem(carss,cars_in_page) 143 | 144 | print(f"araba sayısı:{len(carss)} ") 145 | print(f"cars:{cars_in_page}") 146 | time.sleep(5) 147 | browser.close() -------------------------------------------------------------------------------- /Week04/fetchdata_atakan_karakoc.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | import csv 5 | from selenium import webdriver 6 | from selenium.common import NoSuchElementException 7 | from selenium.webdriver.chrome.options import Options 8 | from selenium.webdriver.common.by import By 9 | 10 | 11 | chrome_options = Options() 12 | # chrome_options.add_argument("--headless") 13 | chrome_options.add_argument("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " 14 | "(KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 15 | browser = webdriver.Chrome(f"{os.getcwd()}/chromedriver", options=chrome_options) 16 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 17 | car_list = [] 18 | isNextPage = True 19 | 20 | #A loop for the next pages 21 | while isNextPage: 22 | browser.get(link) 23 | time.sleep(2) 24 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem') 25 | for c in cars: 26 | #To skip advertisement lines 27 | if c.get_attribute('data-id') is None: 28 | continue 29 | else: 30 | time.sleep(random.random()) 31 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 32 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 33 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 34 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 35 | try: 36 | car_list.append( 37 | { 38 | 'model': model[0].text, 39 | 'version': model[1].text, 40 | 'year': int(infos[0].text), 41 | 'km': int(infos[1].text.replace('.', '')), 42 | 'color': infos[2].text, 43 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 44 | 'location': location[0].text.replace('\n', ' ') 45 | } 46 | ) 47 | finally: 48 | continue 49 | #Getting the link to the next page 50 | try: 51 | isNextPage = browser.find_element(By.CSS_SELECTOR, value='.prevNextBut[title="Sonraki"]') 52 | link = isNextPage.get_attribute("href") 53 | isNextPage = True 54 | except NoSuchElementException: 55 | isNextPage = False 56 | 57 | print(car_list) 58 | time.sleep(5) 59 | browser.close() 60 | print(len(car_list)) 61 | 62 | # with open('cars.csv', 'w', newline='') as f: 63 | # writer = csv.writer(f) 64 | # writer.writerow(['model', 'version', 'year', 'km', 'color', 'price', 'location']) 65 | # for car in car_list: 66 | # writer.writerow([car['model'], car['version'], car['year'], car['km'], car['color'], car['price'], car['location']]) -------------------------------------------------------------------------------- /Week04/fetchdata_barangokcekli.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.options import Options 6 | from selenium.webdriver.common.by import By 7 | from selenium.common.exceptions import NoSuchElementException 8 | chrome_options = Options() 9 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 10 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 11 | browser = webdriver.Chrome(f"{os.getcwd()}/Week04/chromedriver", options=chrome_options) 12 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 13 | browser.get(link) 14 | time.sleep(2) 15 | 16 | car_list = [] 17 | while True: 18 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd):not(.classicNativeAd)') # ADS REMOVED 19 | for c in cars: 20 | time.sleep(random.random()) 21 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 22 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 23 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 24 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 25 | try: 26 | car_list.append( 27 | { 28 | 'model': model[0].text, 29 | 'version': model[1].text, 30 | 'year': int(infos[0].text), 31 | 'km': int(infos[1].text.replace('.', '')), 32 | 'color': infos[2].text, 33 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 34 | 'location': location[0].text.replace('\n', ' ') 35 | } 36 | ) 37 | finally: 38 | continue 39 | try: 40 | button = browser.find_element(By.CSS_SELECTOR, value=".prevNextBut[title='Sonraki']") 41 | next_page = button.get_attribute("href") 42 | browser.get(next_page) 43 | time.sleep(1) 44 | except NoSuchElementException: 45 | print("END OF PAGES") 46 | break 47 | print(car_list) 48 | time.sleep(5) 49 | browser.close() -------------------------------------------------------------------------------- /Week04/fetchdata_mertozgenn.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.options import Options 6 | from selenium.webdriver.common.by import By 7 | from selenium.common.exceptions import NoSuchElementException 8 | 9 | 10 | chrome_options = Options() 11 | # chrome_options.add_argument("--headless") 12 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 13 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 14 | browser = webdriver.Chrome(f"{os.getcwd()}/chromedriver", options=chrome_options) 15 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 16 | browser.get(link) 17 | time.sleep(2) 18 | car_list = [] 19 | while True: 20 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='tr[class*=searchResultsItem]:not([class*=nativeAd])') 21 | for c in cars: 22 | try: 23 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 24 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 25 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 26 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 27 | car_list.append( 28 | { 29 | 'model': model[0].text, 30 | 'version': model[1].text, 31 | 'year': int(infos[0].text), 32 | 'km': int(infos[1].text.replace('.', '')), 33 | 'color': infos[2].text, 34 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 35 | 'location': location[0].text.replace('\n', ' ') 36 | } 37 | ) 38 | finally: 39 | continue 40 | try: 41 | next_button = browser.find_element(by=By.CSS_SELECTOR, value='a[class=prevNextBut][title=Sonraki]') 42 | browser.get(next_button.get_attribute('href')) 43 | time.sleep(random.random() + 1) 44 | except NoSuchElementException: 45 | break 46 | 47 | print(car_list) 48 | time.sleep(5) 49 | browser.close() 50 | -------------------------------------------------------------------------------- /Week04/fetchdata_onur_yasar.py: -------------------------------------------------------------------------------- 1 | import time 2 | import random 3 | from selenium import webdriver 4 | from selenium.webdriver.chrome.options import Options 5 | from selenium.webdriver.common.by import By 6 | from selenium.common.exceptions import NoSuchElementException 7 | 8 | 9 | chrome_options = Options() 10 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 11 | 12 | browser = webdriver.Chrome(options=chrome_options) 13 | isThereNextPage = True 14 | pageNumber = 1 15 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 16 | car_list = [] 17 | while isThereNextPage: 18 | browser.get(link) 19 | time.sleep(1) 20 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem') 21 | for c in cars: 22 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 23 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 24 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 25 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 26 | #time.sleep(1) 27 | try: 28 | car_list.append( 29 | { 30 | 'model': model[0].text, 31 | 'version': model[1].text, 32 | 'year': int(infos[0].text), 33 | 'km': int(infos[1].text.replace('.', '')), 34 | 'color': infos[2].text, 35 | 'price': { 36 | 'amount': int(price[0].text.split(" ")[0].replace(".", "")), 37 | 'currency': price[0].text.split(" ")[1] 38 | }, 39 | 'location': location[0].text.replace('\n', ' ') 40 | } 41 | ) 42 | finally: 43 | continue 44 | 45 | try: 46 | nextPage = browser.find_element(by=By.CSS_SELECTOR, value='.prevNextBut[title="Sonraki"]') 47 | pageNumber = pageNumber + 1 48 | link = nextPage.get_attribute("href") 49 | isThereNextPage = True 50 | print(f"Fetching page number: {pageNumber} \t Url: {link}") 51 | 52 | except NoSuchElementException: 53 | isThereNextPage = False 54 | 55 | print(len(car_list)) 56 | print(car_list) 57 | time.sleep(2) 58 | browser.close() -------------------------------------------------------------------------------- /Week04/fetchdata_umut_azazi.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.options import Options 6 | from selenium.webdriver.common.by import By 7 | 8 | 9 | 10 | 11 | 12 | chrome_options = Options() 13 | # chrome_options.add_argument("--headless") 14 | chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 15 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 16 | browser = webdriver.Chrome(f"{os.getcwd()}/chromedriver", options=chrome_options) 17 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 18 | browser.get(link) 19 | time.sleep(2) 20 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd)') 21 | car_list = [] 22 | while True: 23 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd)') 24 | for c in cars: 25 | time.sleep(random.random()) 26 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 27 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 28 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 29 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 30 | try: 31 | car_list.append( 32 | { 33 | 'model': model[0].text, 34 | 'version': model[1].text, 35 | 'year': int(infos[0].text), 36 | 'km': int(infos[1].text.replace('.', '')), 37 | 'color': infos[2].text, 38 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 39 | 'location': location[0].text.replace('\n', ' ') 40 | } 41 | ) 42 | finally: 43 | continue 44 | try: 45 | next_page = browser.find_element(by=By.CSS_SELECTOR, value='.prevNextBut[title="Sonraki"]') 46 | next_page.click() 47 | time.sleep(2) # wait for the next page to load 48 | 49 | except: 50 | break # exit the loop if there is no more pages 51 | 52 | 53 | print(car_list) 54 | time.sleep(5) 55 | browser.close() -------------------------------------------------------------------------------- /Week04/week4_sinem_gencer.py: -------------------------------------------------------------------------------- 1 | import os, time 2 | from selenium import webdriver 3 | from selenium.webdriver.chrome.options import Options 4 | from selenium.webdriver.common.by import By 5 | import random 6 | from selenium.common.exceptions import NoSuchElementException 7 | 8 | humanface = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36' 9 | link = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 10 | path = "E:\6. Dönem\Data Vis\Codes\chromedriver.exe" 11 | 12 | chrome_options = Options() 13 | chrome_options.add_argument("user-agent={0}".format(humanface)) 14 | #chrome_options.add_argument("--headless") 15 | 16 | browser = webdriver.Chrome(path, options=chrome_options) 17 | browser.get(link) 18 | time.sleep(2) 19 | car_list=[] 20 | 21 | existsNextPage = True 22 | 23 | while existsNextPage: 24 | cars = browser.find_elements(by=By.CSS_SELECTOR, value='.searchResultsItem:not(.nativeAd)') 25 | for c in cars: 26 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 27 | infos = c.find_elements(by=By.CSS_SELECTOR, value ='.searchResultsAttributeValue') 28 | price = c.find_elements(by=By.CSS_SELECTOR, value ='.searchResultsPriceValue') 29 | location = c.find_elements(by=By.CSS_SELECTOR, value ='.searchResultsLocationValue') 30 | try: 31 | car_list.append( 32 | { 33 | 'model':model[0].text, 34 | 'version':model[1].text, 35 | 'year':int(infos[0].text), 36 | 'km':int(infos[1].text.replace('.', '')), 37 | 'color':infos[2].text, 38 | 'price':int(price[0].text.replace('.','').replace('TL','')), 39 | 'location':location[0].text.replace('\n',' ') 40 | } 41 | ) 42 | finally: 43 | continue 44 | try: 45 | next_button= browser.find_element(by=By.CSS_SELECTOR, value='.prevNextBut[title="Sonraki"]') 46 | next_button.click() 47 | except NoSuchElementException: 48 | existsNextPage = False 49 | 50 | print(car_list) 51 | time.sleep(5) 52 | browser.close() 53 | -------------------------------------------------------------------------------- /Week05/alfaromeo.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | import csv 5 | from selenium import webdriver 6 | from selenium.webdriver.chrome.options import Options 7 | from selenium.webdriver.chrome.service import Service 8 | from webdriver_manager.chrome import ChromeDriverManager # pip install webdriver-manager 9 | from selenium.webdriver.common.by import By 10 | 11 | 12 | class AlfaRomeo: 13 | def __init__(self, link, csv_file="./alfaromeo.csv", update_interval=1200, headless=True): 14 | self.chrome_options = Options() 15 | if headless: 16 | self.chrome_options.add_argument("--headless") 17 | self.chrome_options.add_argument("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 18 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 19 | self.browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=self.chrome_options) 20 | self.link = link 21 | self.csv_file = csv_file 22 | self.update_interval = update_interval 23 | self.__car_list = [] 24 | 25 | def update_cars(self): 26 | car_list = [] 27 | next_page = True 28 | link = self.link 29 | while next_page: 30 | self.browser.get(link) 31 | time.sleep(1+random.random()) 32 | cars = self.browser.find_elements(by=By.CSS_SELECTOR, value=".searchResultsItem") 33 | for c in cars: 34 | if c.get_attribute("data-id") is None: 35 | continue 36 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 37 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 38 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 39 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 40 | try: 41 | car_list.append( 42 | { 43 | 'model': model[0].text, 44 | 'version': model[1].text, 45 | 'year': int(infos[0].text), 46 | 'km': int(infos[1].text.replace('.', '')), 47 | 'color': infos[2].text, 48 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 49 | 'location': location[0].text.replace('\n', ' ') 50 | } 51 | ) 52 | except: 53 | continue 54 | time.sleep(1+random.random()) 55 | next_link = self.browser.find_elements(by=By.CSS_SELECTOR, value=".prevNextBut") 56 | next_page = False if len(next_link) == 0 else True 57 | for n in next_link: 58 | if n.get_attribute("title") == "Sonraki": 59 | link = n.get_attribute("href") 60 | next_page = True 61 | else: 62 | next_page = False 63 | self.browser.close() 64 | return car_list 65 | 66 | def save_cars(self): 67 | with open(self.csv_file, "w", newline="") as f: 68 | writer = csv.writer(f) 69 | for c in self.__car_list: 70 | writer.writerow([ 71 | c['model'], c['version'], c['year'], c['km'], c['color'], c['price'], c['location'] 72 | ]) 73 | 74 | def load_cars(self): 75 | with open(self.csv_file, "r") as f: 76 | reader = csv.reader(f) 77 | for row in reader: 78 | try: 79 | self.__car_list.append(row) 80 | except: 81 | continue 82 | 83 | def delete_cars(self): 84 | try: 85 | os.remove(self.csv_file) 86 | except: 87 | pass 88 | 89 | def cars(self): 90 | if not os.path.exists(self.csv_file) or (time.time() - os.path.getmtime(self.csv_file)) > self.update_interval: 91 | self.__car_list = self.update_cars() 92 | self.save_cars() 93 | else: 94 | self.load_cars() 95 | return self.__car_list 96 | 97 | 98 | if __name__ == "__main__": 99 | alfa_romeo = AlfaRomeo( 100 | link="https://canbula.com/alfaromeo/page01.html", 101 | csv_file=f"{os.getcwd()}/Week05b/alfaromeo.csv", 102 | update_interval=3600, 103 | headless=False 104 | ) 105 | cars = alfa_romeo.cars() 106 | print(cars) 107 | -------------------------------------------------------------------------------- /Week05/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask import render_template 3 | from alfaromeo import AlfaRomeo 4 | import os 5 | 6 | 7 | app = Flask(__name__) 8 | 9 | 10 | @app.route('/') 11 | def index(): 12 | alfa_romeo = AlfaRomeo( 13 | link="https://canbula.com/alfaromeo/page01.html", 14 | csv_file=f"{os.getcwd()}/Week05b/alfaromeo.csv", 15 | update_interval=3600, 16 | headless=False 17 | ) 18 | return render_template("index.html", 19 | cars=alfa_romeo.cars(), 20 | title="Alfa Romeo Cars" 21 | ) 22 | 23 | 24 | if __name__ == "__main__": 25 | app.run(debug=True) 26 | -------------------------------------------------------------------------------- /Week05/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Web Application for Data Visualization 6 | 7 | 8 |

{{ title }}

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% for car in cars %} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {% endfor %} 31 | 32 |
ModelYearKMColorPriceLocation
{{ car[0] }} {{ car[1] }}{{ car[2] }}{{ car[3] }}{{ car[4] }}{{ car[5] }}{{ car[6] }}
33 | 34 | -------------------------------------------------------------------------------- /Week06/alfaromeo.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | import csv 5 | from selenium import webdriver 6 | from selenium.webdriver.chrome.options import Options 7 | from selenium.webdriver.chrome.service import Service 8 | from webdriver_manager.chrome import ChromeDriverManager # pip install webdriver-manager 9 | from selenium.webdriver.common.by import By 10 | 11 | 12 | class AlfaRomeo: 13 | def __init__(self, link, csv_file="./alfaromeo.csv", update_interval=1200, headless=True): 14 | self.chrome_options = Options() 15 | if headless: 16 | self.chrome_options.add_argument("--headless") 17 | self.chrome_options.add_argument("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 18 | "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 19 | self.browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=self.chrome_options) 20 | self.link = link 21 | self.csv_file = csv_file 22 | self.update_interval = update_interval 23 | self.__car_list = [] 24 | 25 | def update_cars(self): 26 | car_list = [] 27 | next_page = True 28 | link = self.link 29 | while next_page: 30 | self.browser.get(link) 31 | time.sleep(1 + random.random()) 32 | cars = self.browser.find_elements(by=By.CSS_SELECTOR, value=".searchResultsItem") 33 | for c in cars: 34 | if c.get_attribute("data-id") is None: 35 | continue 36 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 37 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 38 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 39 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 40 | try: 41 | car_list.append( 42 | { 43 | 'model': model[0].text, 44 | 'version': model[1].text, 45 | 'year': int(infos[0].text), 46 | 'km': int(infos[1].text.replace('.', '')), 47 | 'color': infos[2].text, 48 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 49 | 'location': location[0].text.replace('\n', ' ') 50 | } 51 | ) 52 | except: 53 | continue 54 | time.sleep(1 + random.random()) 55 | next_link = self.browser.find_elements(by=By.CSS_SELECTOR, value=".prevNextBut") 56 | next_page = False if len(next_link) == 0 else True 57 | for n in next_link: 58 | if n.get_attribute("title") == "Sonraki": 59 | link = n.get_attribute("href") 60 | next_page = True 61 | else: 62 | next_page = False 63 | self.browser.close() 64 | return car_list 65 | 66 | def save_cars(self): 67 | with open(self.csv_file, "w", newline="") as f: 68 | writer = csv.writer(f) 69 | for c in self.__car_list: 70 | writer.writerow([ 71 | c['model'], c['version'], c['year'], c['km'], c['color'], c['price'], c['location'] 72 | ]) 73 | 74 | def load_cars(self): 75 | with open(self.csv_file, "r") as f: 76 | reader = csv.reader(f) 77 | for row in reader: 78 | try: 79 | self.__car_list.append({ 80 | 'model': row[0], 81 | 'version': row[1], 82 | 'year': int(row[2]), 83 | 'km': int(row[3]), 84 | 'color': row[4], 85 | 'price': int(row[5]), 86 | 'location': row[6] 87 | }) 88 | except: 89 | continue 90 | 91 | def delete_cars(self): 92 | try: 93 | os.remove(self.csv_file) 94 | except: 95 | pass 96 | 97 | def cars(self): 98 | if not os.path.exists(self.csv_file) or (time.time() - os.path.getmtime(self.csv_file)) > self.update_interval: 99 | self.__car_list = self.update_cars() 100 | self.save_cars() 101 | else: 102 | self.load_cars() 103 | return self.__car_list 104 | 105 | 106 | if __name__ == "__main__": 107 | alfa_romeo = AlfaRomeo( 108 | link="https://canbula.com/alfaromeo/page01.html", 109 | csv_file=f"{os.getcwd()}/alfaromeo.csv", 110 | update_interval=3600, 111 | headless=False 112 | ) 113 | cars = alfa_romeo.cars() 114 | print(cars) 115 | -------------------------------------------------------------------------------- /Week06/alfaromeo_Onur_YASAR.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import random 4 | import csv 5 | from selenium import webdriver 6 | from selenium.webdriver.chrome.options import Options 7 | from selenium.webdriver.chrome.service import Service 8 | from webdriver_manager.chrome import ChromeDriverManager # pip install webdriver-manager 9 | from selenium.webdriver.common.by import By 10 | 11 | 12 | class AlfaRomeoOY: 13 | def __init__(self, link, csv_file="./alfaromeo.csv", update_interval=1200, headless=True): 14 | self.chrome_options = Options() 15 | if headless: 16 | self.chrome_options.add_argument("--headless") 17 | self.chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36") 18 | self.browser = webdriver.Chrome(options=self.chrome_options) 19 | self.link = link 20 | self.csv_file = csv_file 21 | self.update_interval = update_interval 22 | self.__car_list = [] 23 | 24 | def update_cars(self): 25 | car_list = [] 26 | next_page = True 27 | link = self.link 28 | while next_page: 29 | self.browser.get(link) 30 | time.sleep(1 + random.random()) 31 | cars = self.browser.find_elements(by=By.CSS_SELECTOR, value=".searchResultsItem") 32 | for c in cars: 33 | if c.get_attribute("data-id") is None: 34 | continue 35 | model = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsTagAttributeValue') 36 | infos = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsAttributeValue') 37 | price = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsPriceValue') 38 | location = c.find_elements(by=By.CSS_SELECTOR, value='.searchResultsLocationValue') 39 | try: 40 | car_list.append( 41 | { 42 | 'model': model[0].text, 43 | 'version': model[1].text, 44 | 'year': int(infos[0].text), 45 | 'km': int(infos[1].text.replace('.', '')), 46 | 'color': infos[2].text, 47 | 'price': int(price[0].text.replace('.', '').replace('TL', '')), 48 | 'location': location[0].text.replace('\n', ' ') 49 | } 50 | ) 51 | except: 52 | continue 53 | time.sleep(1 + random.random()) 54 | next_link = self.browser.find_elements(by=By.CSS_SELECTOR, value=".prevNextBut") 55 | next_page = False if len(next_link) == 0 else True 56 | for n in next_link: 57 | if n.get_attribute("title") == "Sonraki": 58 | link = n.get_attribute("href") 59 | next_page = True 60 | else: 61 | next_page = False 62 | self.browser.close() 63 | return car_list 64 | 65 | def save_cars(self): 66 | with open(self.csv_file, "w", newline="") as f: 67 | writer = csv.writer(f) 68 | for c in self.__car_list: 69 | writer.writerow([ 70 | c['model'], c['version'], c['year'], c['km'], c['color'], c['price'], c['location'] 71 | ]) 72 | 73 | def load_cars(self): 74 | with open(self.csv_file, "r", encoding="utf8") as f: 75 | reader = csv.reader(f) 76 | for row in reader: 77 | try: 78 | self.__car_list.append({ 79 | 'model': row[0], 80 | 'version': row[1], 81 | 'year': int(row[2]), 82 | 'km': int(row[3]), 83 | 'color': row[4], 84 | 'price': int(row[5]), 85 | 'location': row[6] 86 | }) 87 | except: 88 | continue 89 | 90 | def delete_cars(self): 91 | try: 92 | os.remove(self.csv_file) 93 | except: 94 | pass 95 | 96 | def cars(self): 97 | if not os.path.exists(self.csv_file) or (time.time() - os.path.getmtime(self.csv_file)) > self.update_interval: 98 | self.__car_list = self.update_cars() 99 | self.save_cars() 100 | else: 101 | self.load_cars() 102 | return self.__car_list 103 | 104 | 105 | if __name__ == "__main__": 106 | alfa_romeo = AlfaRomeoOY( 107 | link="https://canbula.com/alfaromeo/page01.html", 108 | csv_file=f"{os.getcwd()}/alfaromeo.csv", 109 | update_interval=3600, 110 | headless=False 111 | ) 112 | cars = alfa_romeo.cars() 113 | print(cars) 114 | -------------------------------------------------------------------------------- /Week06/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, url_for 2 | from alfaromeo import AlfaRomeo 3 | import os 4 | import numpy as np 5 | import pandas as pd 6 | import matplotlib 7 | import matplotlib.pyplot as plt 8 | import io 9 | import base64 10 | 11 | app = Flask(__name__) 12 | 13 | 14 | @app.route('/') 15 | def index(): 16 | alfa_romeo = AlfaRomeo( 17 | link="https://canbula.com/alfaromeo/page01.html", 18 | csv_file=f"{os.getcwd()}/alfaromeo.csv", 19 | update_interval=3600, 20 | headless=False 21 | ) 22 | cars = alfa_romeo.cars() 23 | average_price = f"{np.round(np.mean([car['price'] for car in cars])):.0f} TL" 24 | average_km = f"{np.round(np.mean([car['km'] for car in cars])):.0f}" 25 | average_year = f"{np.round(np.mean([car['year'] for car in cars])):.0f}" 26 | return render_template( 27 | 'index.html', 28 | title='Data Visualization Web Application', 29 | cars=cars, 30 | average_price=average_price, 31 | average_km=average_km, 32 | average_year=average_year, 33 | km_vs_price=km_vs_price(cars), 34 | model_histogram=model_histogram(cars), 35 | city_pie=city_pie(cars) 36 | ) 37 | 38 | def km_vs_price(cars): 39 | km = [] 40 | price = [] 41 | for car in cars: 42 | km.append(car['km']) 43 | price.append(car['price']) 44 | fig = plt.figure() 45 | plt.scatter(km, price) 46 | plt.xlabel("KM") 47 | plt.ylabel("Price [TL]") 48 | plt.title("KM vs Price") 49 | plt.xticks(rotation=0, 50 | ticks=range(0, 600000, 100000), 51 | labels=[f"{x//1000}K" for x in range(0, 600000, 100000)]) 52 | plt.semilogy() 53 | plt.yticks(rotation=0, 54 | ticks=[100000, 200000, 500000, 1e6, 2e6, 5e6], 55 | labels=["100K", "200K", "500K", "1M", "2M", "5M"]) 56 | img = io.BytesIO() 57 | fig.savefig(img, format='png') 58 | img.seek(0) 59 | return base64.b64encode(img.getvalue()).decode('utf-8') 60 | 61 | def model_histogram(cars): 62 | model = [] 63 | for car in cars: 64 | model.append(car['model']) 65 | fig = plt.figure(figsize=(12, 5)) 66 | plt.subplots_adjust(bottom=0.35) 67 | plt.hist(model, bins=range(0, len(set(model))+1), align='left', rwidth=0.8) 68 | plt.xlabel('Model') 69 | plt.ylabel('Count') 70 | plt.title('Model Histogram') 71 | plt.xticks(rotation=90) 72 | img = io.BytesIO() 73 | fig.savefig(img, format='png') 74 | img.seek(0) 75 | return base64.b64encode(img.getvalue()).decode('utf-8') 76 | 77 | def city_pie(cars): 78 | city = [] 79 | for car in cars: 80 | city.append(car['location'].split(' ')[0]) 81 | city_counts = {} 82 | for c in city: 83 | if c in city_counts: 84 | city_counts[c] += 1 85 | else: 86 | city_counts[c] = 1 87 | top_5 = sorted(city_counts.items(), key=lambda x: x[1], reverse=True)[:5] 88 | top_5_cities = [x[0] for x in top_5] 89 | other = 0 90 | for c in city_counts: 91 | if c not in top_5_cities: 92 | other += city_counts[c] 93 | fig = plt.figure(figsize=(12, 5)) 94 | plt.pie([x[1] for x in top_5] + [other], 95 | labels=[x[0] for x in top_5] + ['Other'], 96 | autopct='%1.1f%%') 97 | plt.title('City Pie Chart') 98 | img = io.BytesIO() 99 | fig.savefig(img, format='png') 100 | img.seek(0) 101 | return base64.b64encode(img.getvalue()).decode('utf-8') 102 | 103 | 104 | if __name__ == '__main__': 105 | app.run() 106 | -------------------------------------------------------------------------------- /Week06/app_Onur_YASAR.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, url_for 2 | from alfaromeo_Onur_YASAR import AlfaRomeoOY 3 | import os 4 | import numpy as np 5 | import pandas as pd 6 | import matplotlib 7 | import matplotlib.pyplot as plt 8 | import io 9 | import base64 10 | 11 | app = Flask(__name__) 12 | 13 | 14 | @app.route('/') 15 | def index(): 16 | alfa_romeo = AlfaRomeoOY( 17 | link="https://canbula.com/alfaromeo/page01.html", 18 | csv_file=f"{os.getcwd()}/alfaromeo.csv", 19 | update_interval=360000, 20 | headless=False 21 | ) 22 | cars = alfa_romeo.cars() 23 | average_price = f"{np.round(np.mean([car['price'] for car in cars])):.0f} TL" 24 | average_km = f"{np.round(np.mean([car['km'] for car in cars])):.0f}" 25 | average_year = f"{np.round(np.mean([car['year'] for car in cars])):.0f}" 26 | return render_template( 27 | 'index_Onur_YASAR.html', 28 | title='Data Visualization Web Application', 29 | cars=cars, 30 | average_price=average_price, 31 | average_km=average_km, 32 | average_year=average_year, 33 | km_vs_price=km_vs_price(cars), 34 | model_histogram=model_histogram(cars), 35 | city_pie=city_pie(cars) 36 | ) 37 | 38 | def km_vs_price(cars): 39 | km = [] 40 | price = [] 41 | for car in cars: 42 | km.append(car['km']) 43 | price.append(car['price']) 44 | fig = plt.figure() 45 | plt.scatter(km, price) 46 | plt.xlabel("KM") 47 | plt.ylabel("Price [TL]") 48 | plt.title("KM vs Price") 49 | plt.xticks(rotation=0, 50 | ticks=range(0, 600000, 100000), 51 | labels=[f"{x//1000}K" for x in range(0, 600000, 100000)]) 52 | plt.semilogy() 53 | plt.yticks(rotation=0, 54 | ticks=[100000, 200000, 500000, 1e6, 2e6, 5e6], 55 | labels=["100K", "200K", "500K", "1M", "2M", "5M"]) 56 | img = io.BytesIO() 57 | fig.savefig(img, format='png') 58 | img.seek(0) 59 | return base64.b64encode(img.getvalue()).decode('utf-8') 60 | 61 | def model_histogram(cars): 62 | model = [] 63 | for car in cars: 64 | model.append(car['model']) 65 | fig = plt.figure(figsize=(12, 5)) 66 | plt.subplots_adjust(bottom=0.35) 67 | plt.hist(model, bins=range(0, len(set(model))+1), align='left', rwidth=0.8) 68 | plt.xlabel('Model') 69 | plt.ylabel('Count') 70 | plt.title('Model Histogram') 71 | plt.xticks(rotation=90) 72 | img = io.BytesIO() 73 | fig.savefig(img, format='png') 74 | img.seek(0) 75 | return base64.b64encode(img.getvalue()).decode('utf-8') 76 | 77 | def city_pie(cars): 78 | city = [] 79 | for car in cars: 80 | city.append(car['location'].split(' ')[0]) 81 | city_counts = {} 82 | for c in city: 83 | if c in city_counts: 84 | city_counts[c] += 1 85 | else: 86 | city_counts[c] = 1 87 | top_5 = sorted(city_counts.items(), key=lambda x: x[1], reverse=True)[:5] 88 | top_5_cities = [x[0] for x in top_5] 89 | other = 0 90 | for c in city_counts: 91 | if c not in top_5_cities: 92 | other += city_counts[c] 93 | fig = plt.figure(figsize=(12, 5)) 94 | plt.pie([x[1] for x in top_5] + [other], 95 | labels=[x[0] for x in top_5] + ['Other'], 96 | autopct='%1.1f%%') 97 | plt.title('City Pie Chart') 98 | img = io.BytesIO() 99 | fig.savefig(img, format='png') 100 | img.seek(0) 101 | return base64.b64encode(img.getvalue()).decode('utf-8') 102 | 103 | 104 | if __name__ == '__main__': 105 | app.run() 106 | -------------------------------------------------------------------------------- /Week06/static/style.css: -------------------------------------------------------------------------------- 1 | .fixed_header thead tr { 2 | display: block; 3 | } 4 | 5 | .fixed_header tbody { 6 | display: block; 7 | overflow: auto; 8 | height: 650px; 9 | width: 100%; 10 | } 11 | 12 | .fixed_header thead tr th { 13 | text-align: left; 14 | } 15 | 16 | .fixed_header tbody tr td { 17 | text-align: left; 18 | } 19 | 20 | .card-body img { 21 | width: 100%; 22 | height: 100%; 23 | object-fit: cover; 24 | } -------------------------------------------------------------------------------- /Week06/static/style_Onur_YASAR.css: -------------------------------------------------------------------------------- 1 | .fixed_header tbody { 2 | display:block; 3 | overflow: auto; 4 | height: 650px; 5 | width: 100%; 6 | } 7 | 8 | .fixed_header thead, tbody tr { 9 | display: table; 10 | width: 100%; 11 | table-layout: fixed; 12 | word-wrap: break-word; 13 | } 14 | 15 | .fixed_header thead { 16 | width: calc( 100% - 1em ); 17 | } 18 | 19 | .fixed_header thead tr th { 20 | text-align: left; 21 | } 22 | 23 | .fixed_header tbody tr td { 24 | text-align: left; 25 | } 26 | 27 | .fixed_header .car-model{ 28 | width:250px; 29 | } 30 | 31 | .card{ 32 | margin-bottom:10px; 33 | } 34 | 35 | .card-body img { 36 | width: 100%; 37 | height: 100%; 38 | object-fit: cover; 39 | } 40 | 41 | #card-big{ 42 | position:absolute; 43 | left:50%; 44 | top:50%; 45 | transform: translate(-80%, -50%); 46 | } 47 | 48 | #dark-overlay{ 49 | position:fixed; 50 | width:100%; 51 | height:100%; 52 | top:0; 53 | left:0; 54 | display:none; 55 | background: rgb(0 0 0 / 50%); 56 | } -------------------------------------------------------------------------------- /Week06/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | 10 | 11 |
12 |

{{ title }}

13 |
14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% for car in cars %} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | {% endfor %} 37 | 38 |
ModelYearKMColorPriceLocation
{{ car.model }} {{ car.version }}{{ car.year }}{{ car.km }}{{ car.color }}{{ car.price }}{{ car.location }}
39 |
40 |
41 |
42 |
43 |
Statistics
44 |

Numbers of Cars: {{ cars|length }}

45 |

Average Price: {{ average_price }}

46 |

Average KM: {{ average_km }}

47 |

Average Year: {{ average_year }}

48 |
49 |
50 |
51 |
52 |
KM vs. Price
53 | KM vs. Price 54 |
55 |
56 |
57 |
58 |
Models
59 | Models 60 |
61 |
62 |
63 |
64 |
Top Cities
65 | Top Cities 66 |
67 |
68 |
69 |
70 |
71 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Week06/templates/index_Onur_YASAR.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |

{{ title }}

15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {% for car in cars %} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | {% endfor %} 39 | 40 |
ModelYearKMColorPriceLocation
{{ car.model }} {{ car.version }}{{ car.year }}{{ car.km }}{{ car.color }}{{ car.price }}{{ car.location }}
41 |
42 |
43 |
44 |
45 |
Statistics
46 |

Numbers of Cars: {{ cars|length }}

47 |

Average Price: {{ average_price }}

48 |

Average KM: {{ average_km }}

49 |

Average Year: {{ average_year }}

50 |
51 |
52 |
53 |
54 |
KM vs. Price
55 | KM vs. Price 56 |
57 |
58 |
59 |
60 |
Models
61 | Models 62 |
63 |
64 |
65 |
66 |
Top Cities
67 | Top Cities 68 |
69 |
70 |
71 |
72 |
73 | 74 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Week07/alfa_romeo.csv: -------------------------------------------------------------------------------- 1 | model,version,year,km,color,price,location 2 | Giulietta,1.6 JTD Distinctive,2014,149000,Kırmızı,489000,Antalya Muratpaşa 3 | Giulietta,1.4 TB MultiAir Distinctive,2015,89000,Beyaz,665900,Antalya Muratpaşa 4 | Giulietta,1.4 TB MultiAir Distinctive,2012,137000,Kırmızı,516000,Sivas Merkez 5 | Giulietta,1.4 TB MultiAir Distinctive,2015,259000,Siyah,559850,İstanbul Maltepe 6 | Giulietta,1.6 JTD Distinctive,2012,170000,Beyaz,422000,Çankırı Merkez 7 | Giulietta,1.4 TB MultiAir Progression Pluse,2012,83000,Beyaz,540000,İstanbul Sarıyer 8 | Giulietta,1.6 JTD Distinctive,2011,247000,Beyaz,422500,Bursa Osmangazi 9 | Giulietta,1.4 TB MultiAir Distinctive,2012,115000,Beyaz,628000,Eskişehir Tepebaşı 10 | 146,1.6 TS,1997,22000,Siyah,142000,İzmir Buca 11 | Giulietta,1.6 JTD Distinctive,2011,168000,Beyaz,520000,Ankara Etimesgut 12 | Giulietta,1.4 TB Distinctive,2011,193000,Siyah,455000,İstanbul Kartal 13 | 156,2.0 JTS Distinctive,2004,198000,Füme,285000,Bursa Mustafakemalpaşa 14 | 145,1.7,1996,182000,Gümüş Gri,115000,İstanbul Ataşehir 15 | 159,1.9 JTD Distinctive Plus,2011,311000,Siyah,375000,Antalya Konyaaltı 16 | Giulietta,1.4 TB MultiAir Distinctive,2012,94000,Beyaz,549000,Konya Karatay 17 | 147,1.6 TS Black Line,2007,320000,Siyah,195000,Kocaeli Gebze 18 | Giulietta,1.6 JTD Progression Plus,2011,230000,Beyaz,395000,İstanbul Eyüpsultan 19 | Giulietta,1.6 JTD Distinctive,2012,212000,Kırmızı,415000,Antalya Kepez 20 | 159,1.9 JTD Distinctive,2008,259000,Lacivert,400000,İstanbul Sancaktepe 21 | Giulietta,1.4 TB Distinctive,2011,144000,Kırmızı,545000,Antalya Konyaaltı 22 | Giulietta,1.4 TB MultiAir Distinctive,2012,160000,Gri,550000,İstanbul Kartal 23 | 147,1.6 TS Distinctive,2004,257000,Siyah,225750,İstanbul Bağcılar 24 | Giulietta,1.4 TB MultiAir Distinctive,2013,153000,Füme,570000,Bursa Nilüfer 25 | 156,1.6 TS,2001,317000,Lacivert,240000,İzmir Gaziemir 26 | 146,1.4 TS,1998,108000,Gri,135000,Erzurum Yakutiye 27 | 159,1.9 JTD Distinctive Plus,2007,305000,Siyah,415000,İstanbul Maltepe 28 | Giulietta,1.6 JTD Distinctive,2014,139800,Beyaz,565000,Ankara Etimesgut 29 | 159,1.9 JTD Distinctive Plus,2008,202000,Siyah,410000,Uşak Merkez 30 | 147,1.6 TS Collezione,2008,191000,Siyah,345000,İzmir Buca 31 | 159,1.9 JTD Distinctive Plus,2008,213800,Siyah,425000,Ordu Altınordu 32 | GTV,2.0 TB,1997,200000,Gümüş Gri,500000,İstanbul Arnavutköy 33 | 156,1.6 TS Distinctive,2005,262000,Siyah,247900,Ankara Keçiören 34 | Giulietta,1.6 JTD Super TCT,2016,105500,Gri,733000,Zonguldak Ereğli 35 | 147,1.6 TS Distinctive,2004,250000,Siyah,160000,Isparta Merkez 36 | Giulietta,1.6 JTD Distinctive,2014,156000,Siyah,535000,İstanbul Esenyurt 37 | Giulietta,1.6 JTD Super TCT,2017,82000,Kırmızı,725000,İstanbul Ataşehir 38 | 159,1.9 JTD Distinctive Plus,2011,185000,Beyaz,513500,Ankara Yenimahalle 39 | Giulietta,1.4 TB MultiAir Distinctive,2012,156000,Beyaz,450000,İstanbul Sarıyer 40 | 146,1.4 TS,1997,259000,Beyaz,140000,Zonguldak Ereğli 41 | 147,1.6 TS Distinctive,2005,265000,Gri,162000,İstanbul Esenyurt 42 | Giulietta,1.6 JTD Distinctive,2013,142000,Beyaz,470000,İstanbul Tuzla 43 | 147,1.6 TS Progression,2003,274000,Mavi,205000,Antalya Muratpaşa 44 | 146,1.6 L,1996,214000,Kırmızı,96000,Ankara Sincan 45 | Giulietta,1.4 TB MultiAir Distinctive,2012,57000,Beyaz,575000,Mersin Yenişehir 46 | 156,1.6 TS Progression,2004,239000,Şampanya,245000,Ankara Etimesgut 47 | 156,1.6 TS,2001,356300,Kırmızı,145000,Antalya Kepez 48 | 147,1.6 TS Progression,2009,39000,Siyah,355000,Antalya Muratpaşa 49 | Giulietta,1.6 JTD Distinctive,2011,111000,Beyaz,475000,Ankara Çankaya 50 | 156,2.0 TS Executive,2002,347000,Beyaz,172500,Bolu Merkez 51 | 156,1.6 TS Distinctive,2004,231375,Gri,240000,İzmir Karşıyaka 52 | 156,1.6 TS Distinctive,2004,240000,Lacivert,229000,İstanbul Bağcılar 53 | 147,1.6 TS Distinctive,2003,170000,Gri,175000,Konya Sarayönü 54 | Giulietta,1.6 JTD Super TCT,2017,155000,Beyaz,593500,Antalya Gazipaşa 55 | 159,1.9 JTD Distinctive Plus,2008,209000,Şampanya,575000,İstanbul Üsküdar 56 | Giulietta,1.6 JTD Distinctive,2011,179000,Kırmızı,493500,Sinop Boyabat 57 | Giulietta,1.4 TB MultiAir Distinctive,2013,10729,Kırmızı,689950,İstanbul Sancaktepe 58 | Giulietta,1.4 TB MultiAir Distinctive,2014,68000,Gri,740000,Ankara Çankaya 59 | Giulietta,1.4 TB MultiAir Distinctive,2012,165000,Beyaz,477500,İstanbul Bağcılar 60 | 156,1.6 TS Distinctive,2004,256000,Kırmızı,267500,Ordu Altınordu 61 | 147,1.6 TS Progression,2004,250000,Kırmızı,199000,İstanbul Bağcılar 62 | 147,1.6 TS Distinctive,2004,260000,Mavi,220000,Antalya Alanya 63 | Giulietta,1.6 JTD Progression Plus,2014,128000,Beyaz,485000,İzmir Menderes 64 | Giulietta,1.6 JTD Progression Plus,2014,224000,Beyaz,482000,Ankara Pursaklar 65 | 156,1.6 TS Distinctive,2004,250000,Mavi,215000,İstanbul Bayrampaşa 66 | 156,2.0 TS Distinctive,2001,280000,Gümüş Gri,180000,Mardin Artuklu 67 | MiTo,1.4 T MultiAir TCT Sportivo,2011,131000,Beyaz,515000,Malatya Yeşilyurt 68 | Giulietta,1.6 JTD Distinctive,2014,261000,Füme,415000,Muğla Menteşe 69 | 156,1.6 TS Distinctive,2006,205000,Siyah,290000,Ankara Çankaya 70 | Giulietta,1.4 TB MultiAir Distinctive,2015,108000,Gri,700000,İstanbul Sarıyer 71 | 156,2.0 TS,2001,280000,Kırmızı,232000,İstanbul Bağcılar 72 | 156,1.6 TS Distinctive,2004,209700,Mavi,255000,Eskişehir Odunpazarı 73 | MiTo,1.3 JTD City,2012,179000,Kırmızı,410000,İstanbul Tuzla 74 | Giulietta,1.6 JTD Distinctive,2012,204000,Beyaz,427000,Hatay Arsuz 75 | MiTo,1.3 JTD City,2013,171000,Beyaz,365000,İstanbul Pendik 76 | Giulietta,1.6 JTD Distinctive,2015,141000,Beyaz,540000,Balıkesir Altıeylül 77 | 156,1.6 TS Distinctive,2004,300000,Kırmızı,257000,Denizli Merkezefendi 78 | Giulietta,1.6 JTD Super TCT,2017,98000,Gümüş Gri,730000,İstanbul Sultangazi 79 | 156,2.0 TS Distinctive,2002,237000,Kırmızı,235000,Muğla Bodrum 80 | Giulietta,1.6 JTD Super TCT,2018,70500,Beyaz,670000,Eskişehir Odunpazarı 81 | Giulietta,1.6 JTD Distinctive,2013,277000,Siyah,388000,İstanbul Pendik 82 | 159,1.9 JTD Distinctive,2007,198200,Siyah,330000,Ankara Keçiören 83 | 159,1.9 JTD Distinctive,2007,297000,Siyah,395000,Malatya Yeşilyurt 84 | 146,1.4 TS,1999,221000,Kırmızı,131000,İstanbul Üsküdar 85 | 156,1.6 TS,2000,30000,Kırmızı,142000,Sivas Merkez 86 | 159,1.9 JTD Distinctive,2006,338000,Siyah,305000,İstanbul Tuzla 87 | 159,1.9 JTD Distinctive Plus,2007,415000,Siyah,325000,Konya Selçuklu 88 | Giulietta,1.4 TB MultiAir Distinctive,2011,118000,Siyah,600000,İstanbul Esenler 89 | 146,1.4 TS,1998,230000,Siyah,103750,İzmir Bergama 90 | 147,1.6 TS Progression,2004,172000,Siyah,205000,Şanlıurfa Haliliye 91 | 147,1.6 TS Progression,2004,172000,Siyah,205000,Şanlıurfa Haliliye 92 | Giulietta,1.6 JTD Sprint,2020,34000,Gri,915000,İstanbul Bahçelievler 93 | 147,1.6 TS Distinctive,2003,185000,Gri,245000,İstanbul Beykoz 94 | 156,1.6 TS Distinctive,2006,192000,Siyah,310000,Ankara Mamak 95 | 156,1.6 TS Distinctive,2005,250000,Şampanya,230000,Bursa Nilüfer 96 | 147,1.6 TS Progression,2005,295250,Gri,227750,Şanlıurfa Haliliye 97 | 156,1.6 TS,2001,197000,Gri,205000,Malatya Battalgazi 98 | 147,1.6 TS Distinctive,2004,124500,Lacivert,255000,Bursa Osmangazi 99 | Giulietta,1.4 TB MultiAir Distinctive,2014,68000,Gri,199000,Malatya Battalgazi 100 | Giulietta,1.4 TB MultiAir Distinctive,2012,173000,Beyaz,639000,İstanbul Küçükçekmece 101 | MiTo,1.4 T MultiAir TCT Sportivo,2013,122540,Lacivert,505000,İstanbul Sarıyer 102 | Giulietta,1.6 JTD Giulietta,2020,87500,Beyaz,727000,Antalya Serik 103 | 156,1.6 TS,1998,320000,Bordo,165000,Kocaeli Gebze 104 | Giulietta,1.6 JTD Distinctive,2011,238000,Beyaz,555555,İstanbul Sarıyer 105 | Giulietta,1.6 JTD Progression,2017,97000,Kırmızı,615000,İstanbul Kağıthane 106 | Giulietta,1.6 JTD Progression Plus,2015,169500,Siyah,470000,Aydın Didim 107 | 156,2.0 TS,1998,330000,Mavi,169500,Bursa Nilüfer 108 | Giulietta,1.4 TB MultiAir Distinctive,2012,172500,Beyaz,405000,Eskişehir Odunpazarı 109 | 146,1.6 TS,1997,310000,Kırmızı,125000,İzmir Buca 110 | MiTo,1.3 JTD City,2012,142000,Kırmızı,355000,İstanbul Bağcılar 111 | 159,1.9 JTD Distinctive Plus,2009,313000,Siyah,350000,Ankara Elmadağ 112 | Giulietta,1.6 JTD Super TCT,2016,87650,Beyaz,725000,Tokat Merkez 113 | 159,1.9 JTD Progression,2007,228000,Siyah,375000,İstanbul Arnavutköy 114 | 156,1.6 TS Distinctive,2004,299700,Kırmızı,300500,İstanbul Gaziosmanpaşa 115 | Giulietta,1.4 TB Progression Plus,2011,351000,Siyah,467500,Bursa Yıldırım 116 | MiTo,1.4 T MultiAir Quadrifoglio Verde,2011,145000,Beyaz,425000,İzmir Karşıyaka 117 | Giulietta,1.6 JTD Distinctive,2011,186000,Kırmızı,399000,İstanbul Gaziosmanpaşa 118 | MiTo,1.6 JTD Distinctive,2010,184500,Beyaz,335000,Trabzon Ortahisar 119 | Brera,2.2 JTS,2007,184000,Kırmızı,860000,Bursa Nilüfer 120 | Giulietta,1.4 TB MultiAir Distinctive,2013,75000,Beyaz,587500,İstanbul Kartal 121 | 147,1.6 TS Distinctive,2004,264000,Füme,220000,İzmir Buca 122 | 159,2.4 JTD Distinctive,2007,316000,Siyah,397500,Kocaeli Körfez 123 | Giulietta,1.6 JTD Progression,2017,137000,Füme,610000,Gaziantep Şahinbey 124 | Giulietta,1.6 JTD Progression,2016,66000,Kırmızı,615000,İzmir Gaziemir 125 | Giulietta,1.4 TB MultiAir Distinctive,2012,154000,Beyaz,500000,Kırıkkale Merkez 126 | 146,1.4 TS,1998,321000,Bej,109000,Kahramanmaraş Onikişubat 127 | Giulietta,1.4 TB MultiAir Distinctive,2014,112000,Beyaz,620000,İstanbul Bakırköy 128 | 166,2.0 TS,1999,281000,Siyah,160000,Kocaeli Başiskele 129 | 156,1.6 TS Distinctive,2005,225000,Siyah,228500,Eskişehir Tepebaşı 130 | 156,2.0 TS Executive,1999,208500,Lacivert,220000,Bursa Yıldırım 131 | Giulietta,1.4 TB MultiAir Distinctive,2015,99000,Beyaz,680000,İstanbul Esenyurt 132 | Giulietta,1.6 JTD Giulietta,2020,32000,Beyaz,765000,İstanbul Ataşehir 133 | Giulietta,1.6 JTD Distinctive,2015,236000,Beyaz,470000,İstanbul Sancaktepe 134 | 146,1.4 TS,1998,350000,Siyah,126500,İzmir Karabağlar 135 | 156,2.0 JTS Distinctive,2004,215000,Siyah,275000,Konya Selçuklu 136 | Giulietta,1.4 TB Distinctive,2011,189290,Siyah,435000,Tekirdağ Çorlu 137 | MiTo,1.6 JTD Distinctive,2009,215000,Kırmızı,425000,Ankara Çankaya 138 | 147,1.6 TS Collezione,2009,196000,Siyah,299999,İzmir Buca 139 | 156,1.6 TS Distinctive,2005,114000,Siyah,325000,İzmir Karşıyaka 140 | 146,1.4 TS,1998,308000,Kırmızı,175000,Antalya Kepez 141 | 156,1.6 TS Distinctive,2005,259000,Kırmızı,245000,Tekirdağ Çerkezköy 142 | 145,1.6 TS Sportivo,2000,224312,Siyah,159750,İstanbul Pendik 143 | 145,1.4 TS STD,1998,254000,Kırmızı,120000,Tekirdağ Çorlu 144 | Giulietta,1.6 JTD Distinctive,2014,119000,Siyah,574500,Bursa Nilüfer 145 | Giulietta,1.4 TB MultiAir Super TCT,2016,135000,Gri,797000,Ankara Yenimahalle 146 | 147,1.6 TS Distinctive,2003,258000,Beyaz,177000,Konya Meram 147 | 146,2.0 Ti,1999,281000,Kırmızı,185000,İstanbul Üsküdar 148 | Giulietta,1.6 JTD Super TCT,2018,64000,Beyaz,795000,İstanbul Tuzla 149 | 156,1.6 TS Distinctive,2005,327000,Siyah,225000,Ankara Gölbaşı 150 | Giulietta,1.6 JTD Distinctive,2014,94500,Beyaz,492000,İstanbul Sultangazi 151 | 156,2.0 TS Selespeed,2000,307000,Gümüş Gri,235000,Tekirdağ Süleymanpaşa 152 | Giulietta,1.4 TB MultiAir Distinctive,2014,109000,Siyah,665000,İstanbul Kadıköy 153 | GTV,2.0 TB,1996,125000,Bordo,410000,İstanbul Beşiktaş 154 | 147,1.6 TS Progression,2004,191500,Gri,189000,Kilis Merkez 155 | Giulietta,1.4 TB Progression Plus,2013,120000,Kırmızı,454950,İstanbul Esenyurt 156 | Giulia,2.0 T Sprint,2020,9000,Beyaz,1750000,Adana Seyhan 157 | 145,1.6 L,1997,197000,Yeşil,150000,İstanbul Beşiktaş 158 | 156,1.6 TS Distinctive,2004,205000,Mavi,299000,İstanbul Güngören 159 | 156,1.6 TS,2001,226000,Siyah,210000,Manisa Soma 160 | 147,1.6 TS Distinctive,2004,262000,Siyah,295000,İstanbul Kağıthane 161 | 156,1.6 TS Distinctive,2004,237000,Bordo,280000,İzmir Karabağlar 162 | Giulietta,1.6 JTD Distinctive,2014,109000,Siyah,510000,İstanbul Ümraniye 163 | Giulietta,1.6 JTD Distinctive,2012,180000,Beyaz,460000,İstanbul Maltepe 164 | 147,1.6 TS Distinctive,2004,266000,Mavi,210000,İzmir Çiğli 165 | Giulietta,1.4 TB MultiAir Distinctive,2013,132000,Kırmızı,550000,İstanbul Beşiktaş 166 | 156,1.6 TS,2000,300000,Mavi,175000,Erzurum Palandöken 167 | MiTo,1.4 T MultiAir TCT Sportivo,2012,110000,Sarı,565000,İstanbul Kadıköy 168 | MiTo,1.3 JTD City,2013,118000,Kırmızı,435000,Muğla Menteşe 169 | Giulietta,1.6 JTD Progression Plus,2011,307000,Beyaz,361400,Ankara Çankaya 170 | Brera,3.2 JTS Q4 Sky Window,2007,99000,Kırmızı,256500,İstanbul Sarıyer 171 | 147,1.6 TS Distinctive,2004,287000,Gri,209000,Diyarbakır Çüngüş 172 | Giulietta,1.6 JTD Distinctive,2013,188000,Kırmızı,455000,İstanbul Kadıköy 173 | 159,1.9 JTS Distinctive,2006,190000,Kırmızı,347000,Burdur Bucak 174 | Giulietta,1.6 JTD Distinctive,2014,94000,Kırmızı,528900,Aydın Nazilli 175 | 147,2.0 TS Distinctive,2003,262000,Mavi,239750,Ankara Çankaya 176 | Giulietta,1.4 TB MultiAir Distinctive,2012,70000,Beyaz,500000,Ankara Çankaya 177 | Giulietta,1.6 JTD Progression,2017,68000,Füme,670000,Bursa Osmangazi 178 | Giulietta,1.6 JTD Super TCT,2018,74000,Beyaz,649500,İstanbul Güngören 179 | Giulietta,1.6 JTD Distinctive,2014,176000,Beyaz,457500,Samsun Tekkeköy 180 | Giulietta,1.6 JTD Super TCT,2018,79000,Füme,680000,İzmir Bornova 181 | Giulietta,1.4 TB MultiAir Distinctive,2013,84000,Beyaz,553850,Kayseri Kocasinan 182 | GT,2.0 JTS Dis.Selespeed,2006,171000,Siyah,385000,İstanbul Sultangazi 183 | Giulietta,1.4 TB MultiAir Distinctive,2015,101000,Kırmızı,647000,İstanbul Fatih 184 | 156,2.0 TS Selespeed,2001,224000,Gümüş Gri,212000,Adana Çukurova 185 | 156,2.0 TS Selespeed,2001,224000,Kırmızı,223500,Sakarya Akyazı 186 | 156,1.6 TS Distinctive,2004,242000,Gri,259900,Ankara Keçiören 187 | Brera,3.2 JTS Q4 Sky Window,2007,99000,Kırmızı,1100000,İstanbul Sarıyer 188 | 156,1.6 TS Distinctive,2005,242000,Bordo,256500,Ankara Keçiören 189 | 164,2.0 Turbo,1994,153000,Kahverengi,333000,Bursa Nilüfer 190 | Giulietta,1.6 JTD Progression,2016,155000,Beyaz,595000,İzmir Buca 191 | 156,1.6 TS Distinctive,2004,238000,Gri,250000,İstanbul Ümraniye 192 | Giulietta,1.4 TB Distinctive,2012,49000,Kırmızı,540000,Antalya Konyaaltı 193 | 147,1.6 TS Distinctive,2003,285000,Kırmızı,205000,Mersin Toroslar 194 | 159,1.9 JTD Distinctive,2008,198000,Siyah,357900,İstanbul Bahçelievler 195 | 146,1.6 TS,1999,260000,Gümüş Gri,133500,İstanbul Gaziosmanpaşa 196 | Giulietta,1.4 TB Progression Plus,2013,91300,Beyaz,510000,İzmir Buca 197 | Giulietta,1.4 TB Distinctive,2011,113000,Beyaz,550000,Manisa Şehzadeler 198 | 159,1.9 JTS Distinctive,2006,183000,Bordo,360000,Kocaeli Körfez 199 | Giulietta,1.4 TB MultiAir Distinctive,2013,115000,Beyaz,695000,İzmir Karşıyaka 200 | 156,1.6 TS,1999,350000,Beyaz,191500,Kocaeli İzmit 201 | 146,1.4 TS,1998,307000,Yeşil,140000,İstanbul Silivri 202 | Giulietta,1.6 JTD Super TCT,2018,90000,Beyaz,689750,İstanbul Ataşehir 203 | Giulietta,1.4 TB MultiAir Distinctive,2015,152000,Kırmızı,830000,İstanbul Kadıköy 204 | 146,1.6 L,1996,420000,Lacivert,63000,Sakarya Serdivan 205 | 147,1.6 TS Distinctive,2004,242000,Gri,220000,Antalya Demre 206 | 156,2.0 TS,1999,340250,Yeşil,170000,Bursa İnegöl 207 | 145,1.4,1998,257000,Yeşil,125000,Bursa Mustafakemalpaşa 208 | 156,2.0 TS Distinctive,2001,266000,Gümüş Gri,190000,Tekirdağ Çorlu 209 | MiTo,1.3 JTD City,2012,190000,Kırmızı,350000,Ankara Çankaya 210 | Giulietta,1.6 JTD Super TCT,2018,130000,Füme,765000,İstanbul Bağcılar 211 | 147,1.6 TS Distinctive,2009,370000,Siyah,200000,İstanbul Avcılar 212 | Giulietta,1.6 JTD Progression,2017,179868,Kırmızı,590000,İstanbul Sultanbeyli 213 | 156,2.0 TS Executive,1999,271000,Gümüş Gri,223000,Mersin Yenişehir 214 | 159,1.9 JTS Distinctive,2008,302000,Siyah,389500,Mersin Mezitli 215 | 147,1.6 TS Distinctive,2004,215500,Şampanya,253000,Afyonkarahisar Merkez 216 | 156,1.6 TS Distinctive,2005,300000,Kırmızı,245000,Adana Çukurova 217 | Giulietta,1.6 JTD Progression Plus,2015,151000,Beyaz,440000,Gaziantep Şahinbey 218 | 159,1.9 JTS Distinctive,2008,139000,Siyah,525000,Kırklareli Lüleburgaz 219 | Giulietta,1.6 JTD Super TCT,2017,111000,Gümüş Gri,664000,İzmir Karşıyaka 220 | 156,1.6 TS Distinctive,2004,365000,Gri,250000,Çanakkale Ezine 221 | 145,1.6,1997,306000,Beyaz,112500,İstanbul Beylikdüzü 222 | 156,1.6 TS,2001,306000,Gri,168500,Bursa Nilüfer 223 | 156,1.6 TS,2000,283000,Lacivert,175000,Ankara Sincan 224 | Giulietta,1.4 TB MultiAir Distinctive,2012,165000,Siyah,624000,Karaman Merkez 225 | 159,1.9 JTD Distinctive,2007,283000,Gümüş Gri,345000,Bursa Yıldırım 226 | 147,2.0 TS Selespeed Distinctive,2003,230000,Siyah,285000,Muğla Bodrum 227 | Giulietta,1.4 TB MultiAir Distinctive,2012,165000,Kırmızı,525000,Ankara Keçiören 228 | 156,1.6 TS Distinctive,2005,239000,Gri,230000,Aydın Söke 229 | Giulietta,1.6 JTD Super TCT,2018,86500,Beyaz,629500,İstanbul Bağcılar 230 | Giulietta,1.6 JTD Super TCT,2016,64400,Beyaz,653000,İstanbul Maltepe 231 | Giulietta,1.4 TB MultiAir Distinctive,2012,130000,Kırmızı,525000,Antalya Alanya 232 | Giulia,2.0 T Sprint,2020,8300,Beyaz,1705000,Mersin Toroslar 233 | Giulietta,1.6 JTD Distinctive,2015,278000,Beyaz,385000,İstanbul Pendik 234 | Giulietta,1.4 TB MultiAir Distinctive,2013,196575,Beyaz,584900,Hatay Antakya 235 | Giulietta,1.6 JTD Distinctive,2014,155000,Beyaz,435000,İstanbul Başakşehir 236 | Giulietta,1.4 TB MultiAir Distinctive,2013,136500,Beyaz,588000,Adana Seyhan 237 | Giulietta,1.6 JTD Distinctive,2013,150000,Beyaz,485000,İzmir Gaziemir 238 | 159,1.9 JTD Distinctive Plus,2007,285000,Kahverengi,310000,Ankara Etimesgut 239 | 159,1.9 JTD Distinctive Plus,2009,172800,Bordo,525000,İstanbul Bahçelievler 240 | Giulietta,1.6 JTD Distinctive,2013,209000,Mavi,465000,İstanbul Ümraniye 241 | Giulietta,1.75 TBI Quadrifoglio Verde,2011,165000,Beyaz,615000,Eskişehir Odunpazarı 242 | 147,1.6 TS Distinctive,2003,335000,Siyah,235000,Antalya Muratpaşa 243 | 156,1.6 TS Distinctive,2006,266000,Siyah,269500,İzmir Bayraklı 244 | 146,1.6 L,1996,323000,Füme,112500,Mersin Yenişehir 245 | Giulietta,1.6 JTD Distinctive,2011,237000,Beyaz,465000,Ankara Keçiören 246 | Giulietta,1.4 TB MultiAir Distinctive,2012,122000,Kırmızı,575000,İstanbul Beykoz 247 | Giulietta,1.6 JTD Distinctive,2012,225000,Kırmızı,447900,İzmir Bayraklı 248 | Giulietta,1.6 JTD Super TCT,2016,154000,Gri,680000,Ankara Yenimahalle 249 | Giulietta,1.6 JTD Distinctive,2014,140000,Mavi,520000,Bilecik Bozüyük 250 | 146,1.6 L,1997,249000,Siyah,129750,Isparta Merkez 251 | 156,1.6 TS Distinctive,2006,244000,Siyah,250000,Mersin Tarsus 252 | 156,2.0 TS Selespeed,2000,321000,Yeşil,209000,Ankara Etimesgut 253 | 156,2.0 TS Distinctive,2000,343500,Füme,189900,Ankara Etimesgut 254 | 147,1.6 TS Distinctive,2006,350000,Gümüş Gri,219750,Edirne Merkez 255 | Giulietta,1.6 JTD Super TCT,2018,92300,Beyaz,728000,Antalya Alanya 256 | 146,1.6 L,1997,241000,Kırmızı,140000,Eskişehir Odunpazarı 257 | Giulietta,1.6 JTD Progression,2017,102000,Füme,600000,Eskişehir Odunpazarı 258 | Giulietta,1.6 JTD Giulietta,2020,18000,Kırmızı,785000,İstanbul Bakırköy 259 | Giulietta,1.6 JTD Distinctive,2014,85000,Beyaz,535000,Bursa Nilüfer 260 | Giulietta,1.6 JTD Super TCT,2016,73000,Siyah,656000,İstanbul Eyüpsultan 261 | Giulietta,1.6 JTD Distinctive,2013,151000,Siyah,470000,Bursa Nilüfer 262 | Giulietta,1.4 TB MultiAir Distinctive,2012,122300,Beyaz,520000,Trabzon Yomra 263 | Giulietta,1.4 TB Progression Plus,2011,137500,Beyaz,418000,Van İpekyolu 264 | 145,1.7,1996,215000,Kırmızı,165000,Eskişehir Odunpazarı 265 | 156,1.6 TS,2000,226000,Lacivert,183000,Afyonkarahisar Merkez 266 | Giulietta,1.4 TB MultiAir Distinctive,2012,64350,Beyaz,573000,Antalya Serik 267 | MiTo,1.4 T Distinctive,2009,179500,Kırmızı,440000,Bursa Nilüfer 268 | 156,2.0 TS Distinctive,2001,219000,Lacivert,210000,Kastamonu Merkez 269 | 146,1.6 TS,1998,178000,Kırmızı,88900,Ankara Pursaklar 270 | 156,1.6 TS Distinctive,2006,288000,Siyah,254900,Ankara Keçiören 271 | 156,1.6 TS Distinctive,2006,321000,Gümüş Gri,256000,Ankara Çankaya 272 | 147,1.6 TS Distinctive,2004,310000,Kırmızı,252500,Bursa Osmangazi 273 | Giulietta,1.6 JTD Distinctive,2013,172500,Beyaz,495000,İstanbul Ümraniye 274 | Giulietta,1.6 JTD Distinctive,2012,145000,Beyaz,425000,Kocaeli İzmit 275 | 156,1.6 TS Distinctive,2004,330000,Bordo,270000,Bursa Mudanya 276 | 166,2.0 TB,1999,289000,Gümüş Gri,230000,İstanbul Çekmeköy 277 | Giulietta,1.6 JTD Distinctive,2011,179500,Beyaz,459500,Ankara Altındağ 278 | Giulietta,1.4 TB MultiAir Progression Pluse,2012,176897,Beyaz,528000,Ankara Çankaya 279 | Giulia,2.0 T Veloce,2022,9000,Gri,2425000,Mersin Yenişehir 280 | Giulietta,1.4 TB MultiAir Distinctive,2011,185000,Beyaz,469000,Edirne Merkez 281 | Giulietta,1.6 JTD Progression Plus,2011,185000,Siyah,385000,Ankara Çankaya 282 | Giulietta,1.6 JTD Distinctive,2015,126000,Beyaz,510000,İstanbul Kartal 283 | Giulietta,1.6 JTD Distinctive,2011,249000,Siyah,385000,Antalya Konyaaltı 284 | 159,1.9 JTD Distinctive,2006,271000,Gümüş Gri,335000,Bursa Mustafakemalpaşa 285 | 156,2.0 TS Distinctive,2002,208000,Gümüş Gri,285000,Bursa Osmangazi 286 | Giulietta,1.6 JTD Distinctive,2013,164500,Siyah,460000,İstanbul Küçükçekmece 287 | 146,1.6 L,1996,300000,Şampanya,113000,Eskişehir Odunpazarı 288 | Giulietta,1.6 JTD Super TCT,2018,157000,Gri,652500,Antalya Kepez 289 | Giulietta,1.6 JTD Progression,2016,168000,Kırmızı,605500,Antalya Manavgat 290 | Giulietta,1.6 JTD Giulietta,2020,74000,Beyaz,735000,Mersin Akdeniz 291 | 156,1.6 TS,2001,252000,Siyah,198000,Antalya Kepez 292 | 146,1.6 L,1996,262500,Kırmızı,130000,Aydın Efeler 293 | 159,1.9 JTD Distinctive,2008,256000,Siyah,395000,Artvin Borçka 294 | 156,1.6 TS Distinctive,2004,228500,Füme,282500,İstanbul Kartal 295 | 147,1.9 JTD Q2,2003,276000,Yeşil,290000,İzmir Kemalpaşa 296 | 159,1.9 JTD Distinctive,2006,260000,Siyah,360000,Antalya Muratpaşa 297 | 156,2.0 TS,1998,513000,Siyah,155000,İstanbul Esenyurt 298 | Giulietta,1.6 JTD Giulietta,2020,31186,Gri,798500,İstanbul Maltepe 299 | Giulietta,1.6 JTD Distinctive,2014,100000,Beyaz,525000,İstanbul Küçükçekmece 300 | 156,1.6 TS Distinctive,2006,206000,Gri,240000,Hatay Yayladağı 301 | 159,1.9 JTD Distinctive Plus,2007,278000,Siyah,500000,Kars Merkez 302 | Giulietta,1.6 JTD Distinctive,2014,147000,Siyah,447000,Antalya Kemer 303 | 156,2.0 TS,2000,306000,Gümüş Gri,230000,Bursa Osmangazi 304 | 156,1.6 TS Distinctive,2004,240000,Lacivert,224750,İstanbul Bağcılar 305 | 147,1.6 TS Progression,2004,210000,Gümüş Gri,223000,Diyarbakır Yenişehir 306 | 156,2.0 TS Selespeed,2001,240000,Gümüş Gri,223000,İstanbul Kartal 307 | GT,2.0 JTS Distinctive,2006,167000,Lacivert,305000,İstanbul Zeytinburnu 308 | 156,2.0 TS Selespeed,2001,304000,Gümüş Gri,180000,Erzurum Palandöken 309 | GT,2.0 JTS Dis.Selespeed,2008,211000,Kırmızı,319900,İstanbul Ümraniye 310 | Giulietta,1.4 TB Progression Plus,2012,217500,Beyaz,410000,Mersin Mezitli 311 | Giulietta,1.6 JTD Giulietta,2020,65000,Siyah,759000,İstanbul Üsküdar 312 | Giulietta,1.6 JTD Progression,2016,129782,Beyaz,630500,İstanbul Kartal 313 | MiTo,1.4 T Distinctive,2010,147000,Beyaz,395000,İstanbul Maltepe 314 | Giulietta,1.6 JTD Distinctive,2014,100000,Siyah,525000,İstanbul Şişli 315 | 156,1.6 TS Distinctive,2004,380000,Siyah,210000,Kayseri Kocasinan 316 | Giulietta,1.6 JTD Progression,2018,82500,Gri,599000,İstanbul Üsküdar 317 | 159,1.9 JTD Distinctive,2008,317750,Siyah,349500,Antalya Alanya 318 | Giulietta,1.6 JTD Distinctive,2013,98550,Beyaz,519000,İstanbul Sarıyer 319 | Giulietta,1.6 JTD Progression Plus,2012,300000,Kırmızı,425000,Gaziantep İslahiye 320 | Giulietta,1.6 JTD Distinctive,2013,176000,Beyaz,374900,Kayseri Kocasinan 321 | 159,1.9 JTD Distinctive,2007,313000,Siyah,330000,İstanbul Eyüpsultan 322 | 145,1.7,1995,111111,Yeşil,95000,İstanbul Küçükçekmece 323 | 147,1.6 TS Progression,2005,210000,Siyah,219500,Ankara Etimesgut 324 | 145,1.6 L,1996,209000,Lacivert,127000,İzmir Çiğli 325 | MiTo,1.4 T MultiAir Quadrifoglio Verde,2011,105000,Beyaz,420000,İstanbul Beylikdüzü 326 | Giulietta,1.4 TB MultiAir Distinctive,2011,195000,Kırmızı,473500,Kayseri Kocasinan 327 | Giulia Quadrifoglio,2.9,2017,6859,Kırmızı,5400000,İstanbul Maltepe 328 | 159,1.9 JTD Distinctive Plus,2007,292000,Siyah,325000,Bursa Osmangazi 329 | Giulietta,1.6 JTD Progression,2016,106000,Beyaz,635000,Ankara Yenimahalle 330 | 159,2.4 JTD Distinctive,2007,225000,Beyaz,339000,İstanbul Sarıyer 331 | 156,1.6 TS,2001,310000,Gri,184000,Ankara Çankaya 332 | Giulietta,1.6 JTD Progression Plus,2011,205000,Bordo,400000,Muğla Milas 333 | Giulietta,1.6 JTD Distinctive,2014,156344,Beyaz,524000,Kocaeli İzmit 334 | 156,1.6 TS Distinctive,2006,175000,Gümüş Gri,338000,Ankara Sincan 335 | 159,1.9 JTD Distinctive Plus,2007,208900,Siyah,410000,Hatay Dörtyol 336 | 156,1.6 TS Distinctive,2004,279000,Kırmızı,221750,İstanbul Kartal 337 | Giulietta,1.6 JTD Progression Plus,2015,230850,Beyaz,435000,Ankara Çankaya 338 | 156,1.9 JTD Impression,1998,280000,Gri,319000,Ankara Keçiören 339 | Giulia,2.0 T Veloce,2022,13000,Kırmızı,2950000,Bursa Nilüfer 340 | Giulietta,1.6 JTD Distinctive,2014,92600,Beyaz,529000,Gaziantep Şehitkamil 341 | GT,2.0 JTS Distinctive,2006,193000,Mavi,317950,Antalya Muratpaşa 342 | Giulietta,1.6 JTD Super TCT,2018,59200,Kırmızı,749000,İstanbul Üsküdar 343 | Giulietta,1.6 JTD Progression Plus,2014,199500,Beyaz,435000,Ankara Çankaya 344 | Giulietta,1.6 JTD Distinctive,2014,104200,Siyah,525000,Kayseri Talas 345 | 156,1.6 TS Distinctive,2005,186000,Şampanya,275000,İzmir Karşıyaka 346 | Giulietta,1.4 TB MultiAir Distinctive,2011,199000,Bordo,385000,İstanbul Kartal 347 | 147,1.6 TS Distinctive,2005,266000,Siyah,240000,İzmir Beydağ 348 | Giulietta,1.6 JTD Distinctive,2014,185000,Siyah,490000,Sakarya Erenler 349 | MiTo,1.4 T MultiAir TCT,2012,129000,Beyaz,485000,Kocaeli Gebze 350 | 156,2.0 TS Selespeed,2001,306000,Mavi,225000,İzmir Konak 351 | 147,1.6 TS Distinctive,2003,174000,Gri,233000,Antalya Muratpaşa 352 | 156,2.0 TS,1999,259000,Gri,170000,Ankara Etimesgut 353 | 159,1.9 JTD Distinctive,2006,229266,Siyah,390000,İzmir Bornova 354 | Giulietta,1.6 JTD Distinctive,2014,115000,Beyaz,560000,Kahramanmaraş Dulkadiroğlu 355 | 156,2.0 TS Selespeed,2001,245000,Yeşil,210000,Balıkesir Edremit 356 | Giulietta,1.6 JTD Distinctive,2015,215000,Kırmızı,450000,İzmir Gaziemir 357 | 145,1.4 TS STD,1999,313000,Kırmızı,119000,Bursa Osmangazi 358 | 159,1.8 Distinctive,2009,240000,Siyah,429000,Zonguldak Ereğli 359 | Giulietta,1.6 JTD Distinctive,2011,295000,Kırmızı,361000,Bursa Osmangazi 360 | Giulietta,1.4 TB MultiAir Distinctive,2014,71000,Beyaz,646000,İzmir Buca 361 | 156,1.6 TS Distinctive,2004,146500,Siyah,279900,İzmir Bayraklı 362 | Giulietta,1.6 JTD Progression,2016,162500,Beyaz,595000,İzmir Karabağlar 363 | Giulietta,1.6 JTD Super TCT,2016,230000,Mavi,552000,İstanbul Bağcılar 364 | 156,2.0 TS Executive,1999,330000,Gri,195000,Ankara Keçiören 365 | 147,1.6 TS Black Line,2005,252000,Füme,187000,Kocaeli Gölcük 366 | 156,1.6 TS Distinctive,2006,265000,Siyah,257000,İstanbul Beylikdüzü 367 | 156,1.6 TS Distinctive,2004,282000,Sarı,239750,Gaziantep Şahinbey 368 | MiTo,1.4 T Distinctive,2009,176000,Siyah,395000,Ankara Sincan 369 | MiTo,1.4 T MultiAir TCT,2011,124000,Kırmızı,438000,İzmir Çiğli 370 | Giulietta,1.4 TB MultiAir Distinctive,2015,81500,Beyaz,700000,Tekirdağ Süleymanpaşa 371 | 147,1.6 TS Distinctive,2005,298000,Füme,215000,Ankara Etimesgut 372 | 156,1.6 TS,2000,175000,Gri,240000,İstanbul Ataşehir 373 | Giulietta,1.6 JTD Distinctive,2013,175000,Beyaz,404000,İzmir Karşıyaka 374 | 33,1.5 Giardinetta,1990,74000,Kırmızı,86000,Kocaeli İzmit 375 | 156,2.0 TS,1999,260000,Gri,210000,Antalya Konyaaltı 376 | Giulietta,1.4 TB MultiAir Super TCT,2018,46000,Gri,885000,İstanbul Beşiktaş 377 | 156,1.6 TS Distinctive,2004,171800,Füme,272000,Ankara Etimesgut 378 | Giulietta,1.6 JTD Distinctive,2015,222000,Beyaz,425000,Bursa İznik 379 | Giulietta,1.6 JTD Progression Plus,2012,195000,Kırmızı,490000,Antalya Muratpaşa 380 | Giulietta,1.4 TB MultiAir Distinctive,2014,195000,Beyaz,525000,Kocaeli Gebze 381 | 156,1.6 TS Distinctive,2006,154000,Füme,260000,İzmir Karabağlar 382 | MiTo,1.4 T MultiAir TCT,2011,124000,Kırmızı,175000,Kocaeli Gölcük 383 | Giulietta,1.4 TB MultiAir Distinctive,2014,146700,Gri,565000,İstanbul Silivri 384 | Giulietta,1.4 TB MultiAir Super TCT,2016,34000,Beyaz,765000,İstanbul Küçükçekmece 385 | 147,1.6 TS Progression,2006,265000,Siyah,225000,İstanbul Gaziosmanpaşa 386 | Giulietta,1.4 TB Progression Plus,2011,120000,Beyaz,497000,Karabük Merkez 387 | 156,1.6 TS,2002,217000,Beyaz,205000,Ankara Pursaklar 388 | 147,1.6 TS Progression,2005,245000,Siyah,200000,Muğla Fethiye 389 | 33,1.5 IE,1990,90000,Kırmızı,175000,İzmir Çeşme 390 | 156,2.0 TS Distinctive,2002,245000,Beyaz,255000,İstanbul Esenyurt 391 | 147,1.6 TS Distinctive,2005,214000,Gri,164000,Kocaeli Gölcük 392 | Giulietta,1.6 JTD Distinctive,2011,240000,Beyaz,340000,Bursa Mudanya 393 | Giulietta,1.4 TB MultiAir Distinctive,2015,155000,Beyaz,620000,Ankara Etimesgut 394 | 156,1.6 TS,1999,150000,Gri,232000,Kocaeli Çayırova 395 | 156,1.6 TS Distinctive,2004,259000,Siyah,270000,Bursa Mustafakemalpaşa 396 | Giulietta,1.6 JTD Giulietta,2021,8500,Mor,890000,İstanbul Kağıthane 397 | MiTo,1.4 T MultiAir Quadrifoglio Verde,2011,215000,Siyah,430000,Bursa Yıldırım 398 | 156,2.0 TS,1999,341000,Bordo,199000,Aydın Efeler 399 | Giulietta,1.4 TB MultiAir Distinctive,2012,178500,Siyah,535000,Ankara Çankaya 400 | Giulietta,1.6 JTD Giulietta,2020,45000,Mavi,780000,İstanbul Başakşehir 401 | 147,1.6 TS Progression,2007,200000,Kırmızı,226000,Ankara Keçiören 402 | Giulietta,1.6 JTD Super TCT,2018,180000,Füme,580000,İstanbul Maltepe 403 | Giulietta,1.6 JTD Distinctive,2012,256400,Beyaz,387500,Karaman Merkez 404 | Giulietta,1.4 TB MultiAir Progression Pluse,2012,82000,Beyaz,591000,İstanbul Eyüpsultan 405 | 147,2.0 TS Selespeed Distinctive,2006,180000,Füme,350000,İstanbul Pendik 406 | 147,1.6 TS Distinctive,2006,208500,Siyah,297500,İzmir Buca 407 | 156,1.6 TS Distinctive,2004,203000,Turkuaz,275500,Ankara Keçiören 408 | 156,1.6 TS Progression,2004,286000,Gri,299900,İstanbul Bağcılar 409 | 159,1.9 JTD Distinctive Plus,2007,254000,Siyah,428000,İstanbul Ümraniye 410 | Giulietta,1.6 JTD Distinctive,2012,180000,Beyaz,400000,İstanbul Beykoz 411 | 146,1.4 TS,1998,301000,Siyah,125000,Bursa Nilüfer 412 | 147,1.6 TS Distinctive,2004,250000,Mavi,220000,İzmir Menemen 413 | 147,1.6 TS Distinctive,2006,218000,Gümüş Gri,245000,Ankara Keçiören 414 | Giulietta,1.6 JTD Distinctive,2012,169700,Beyaz,479000,Ankara Çankaya 415 | Giulietta,1.6 JTD Distinctive,2015,143000,Füme,569000,Denizli Pamukkale 416 | Giulietta,1.6 JTD Distinctive,2015,113000,Kırmızı,610000,Tekirdağ Çerkezköy 417 | 156,2.0 TS Distinctive,2002,188000,Gri,190000,Denizli Merkezefendi 418 | 147,1.6 TS Distinctive,2007,236000,Siyah,280000,İstanbul Üsküdar 419 | 156,1.6 TS Distinctive,2004,316000,Gri,260000,Ankara Çankaya 420 | Giulietta,1.4 TB MultiAir Distinctive,2011,155000,Beyaz,510000,Sakarya Adapazarı 421 | 156,2.0 TS,1999,290000,Bordo,140000,Tokat Başçiftlik 422 | 145,1.7,1996,208000,Gri,139000,İzmir Torbalı 423 | 159,1.9 JTD Distinctive Plus,2010,158000,Mavi,440000,İstanbul Eyüpsultan 424 | 156,2.0 TS Selespeed,2000,317000,Gümüş Gri,230000,Kastamonu Merkez 425 | Giulietta,1.4 TB MultiAir Distinctive,2011,168000,Siyah,480000,Antalya Kepez 426 | GT,2.0 JTS Distinctive,2006,171600,Siyah,323000,İstanbul Maltepe 427 | 159,1.9 JTD Distinctive,2007,286000,Gri,380000,Adana Sarıçam 428 | Giulietta,1.4 TB MultiAir Distinctive,2015,155100,Beyaz,560000,Muğla Milas 429 | Spider,2.0 TS,1996,190000,Gümüş Gri,545000,Antalya Konyaaltı 430 | 156,1.6 TS,1998,387000,Siyah,150000,İstanbul Avcılar 431 | 147,1.6 TS Distinctive,2004,180000,Gri,200000,İstanbul Esenler 432 | Giulietta,1.4 TB Progression Plus,2012,80600,Kırmızı,500000,İstanbul Maltepe 433 | Giulietta,1.6 JTD Distinctive,2013,210000,Kırmızı,386900,İstanbul Bağcılar 434 | 147,1.6 TS Distinctive,2004,302000,Siyah,200000,İstanbul Maltepe 435 | Giulietta,1.6 JTD Progression Plus,2015,128000,Beyaz,518500,İstanbul Kağıthane 436 | MiTo,1.4 T MultiAir TCT,2012,112000,Kırmızı,469000,İstanbul Esenyurt 437 | 166,3.0 Sportronic,2004,190000,Siyah,365000,İstanbul Kartal 438 | Sprint,1.7,1988,37000,Kırmızı,1050000,Ankara Gölbaşı 439 | Giulietta,1.6 JTD Distinctive,2014,135000,Gri,577000,Ankara Çankaya 440 | 147,1.6 TS Progression,2006,219000,Bordo,192000,Ankara Çankaya 441 | 156,1.6 TS Distinctive,2004,258000,Gümüş Gri,235000,Antalya Manavgat 442 | Giulietta,1.6 JTD Sprint,2020,41000,Kırmızı,895000,İstanbul Kadıköy 443 | Giulietta,1.6 JTD Distinctive,2011,226000,Beyaz,430000,Antalya Muratpaşa 444 | Giulia Quadrifoglio,2.9,2016,21000,Kırmızı,4700000,İstanbul Beşiktaş 445 | 156,1.6 TS,2000,260302,Gri,230000,Muğla Yatağan 446 | Giulietta,1.6 JTD Distinctive,2011,196000,Beyaz,375000,Kütahya Merkez 447 | Spider,2.0 TS,1996,186000,Sarı,475000,Ankara Yenimahalle 448 | 159,1.9 JTD Distinctive,2008,160000,Siyah,430000,Ankara Sincan 449 | MiTo,1.4 T MultiAir TCT,2012,162000,Kırmızı,509000,İstanbul Kartal 450 | 156,1.6 TS Distinctive,2002,315000,Kırmızı,165000,İzmir Bornova 451 | Giulietta,1.4 TB MultiAir Distinctive,2015,33000,Kırmızı,749900,Ankara Akyurt 452 | 156,2.0 TS,1999,155000,Gri,230000,Manisa Şehzadeler 453 | Giulietta,1.6 JTD Super TCT,2016,175000,Beyaz,639000,Ankara Akyurt 454 | Giulietta,1.4 TB MultiAir Distinctive,2012,122000,Beyaz,430000,Manisa Saruhanlı 455 | 156,1.6 TS Distinctive,2005,283000,Beyaz,268000,Sivas Merkez 456 | Giulietta,1.4 TB MultiAir Distinctive,2012,153000,Beyaz,475000,Gaziantep Şahinbey 457 | Giulietta,1.4 TB MultiAir Distinctive,2015,123000,Kırmızı,625000,Mersin Yenişehir 458 | Giulietta,1.6 JTD Distinctive,2015,238000,Beyaz,449000,Antalya Kepez 459 | Giulietta,1.4 TB MultiAir Distinctive,2015,117000,Kırmızı,735000,İstanbul Ümraniye 460 | Giulietta,1.4 TB MultiAir Distinctive,2012,165000,Beyaz,530000,Adana Seyhan 461 | Giulietta,1.6 JTD Super TCT,2017,89000,Gri,655000,Adana Seyhan 462 | 159,1.9 JTD Distinctive,2007,203000,Gri,479000,Ankara Yenimahalle 463 | Giulietta,1.6 JTD Progression Plus,2015,190000,Beyaz,497500,İstanbul Büyükçekmece 464 | Giulia,2.0 Veloce,2017,50000,Lacivert,1895000,İstanbul Sarıyer 465 | 156,1.6 TS,2000,260000,Siyah,195750,İstanbul Bahçelievler 466 | 156,1.6 TS,1998,327000,Kırmızı,147500,Mersin Gülnar 467 | Giulietta,1.4 TB MultiAir Distinctive,2011,165000,Beyaz,390000,Isparta Merkez 468 | MiTo,1.4 T Distinctive,2010,188000,Beyaz,340000,Antalya Alanya 469 | Giulietta,1.6 JTD Giulietta,2020,80000,Beyaz,762750,Denizli Merkezefendi 470 | Giulietta,1.4 TB MultiAir Distinctive,2012,105000,Kırmızı,483000,İstanbul Kağıthane 471 | 159,1.9 JTD Distinctive,2008,213000,Siyah,423000,Antalya Döşemealtı 472 | 156,2.0 TS,1998,298000,Füme,200000,Kütahya Gediz 473 | 146,1.6 L,1997,316000,Yeşil,139000,Denizli Pamukkale 474 | Giulietta,1.4 TB MultiAir Distinctive,2011,162300,Beyaz,485000,İstanbul Bayrampaşa 475 | Giulietta,1.4 TB MultiAir Distinctive,2013,215000,Kırmızı,483000,Antalya Aksu 476 | Giulietta,1.6 JTD Progression Plus,2011,138500,Kırmızı,432500,Bursa Osmangazi 477 | Giulietta,1.6 JTD Distinctive,2014,152200,Beyaz,490000,Edirne Merkez 478 | 156,2.0 TS,2001,280000,Bordo,195000,İstanbul Ataşehir 479 | 156,2.0 TS Selespeed,2001,305000,Siyah,190000,İzmir Çiğli 480 | Giulietta,1.6 JTD Progression Plus,2014,168000,Beyaz,397500,Kilis Merkez 481 | Giulietta,1.4 TB MultiAir Distinctive,2012,80000,Kırmızı,625000,Isparta Yalvaç 482 | Giulietta,1.6 JTD Distinctive,2013,201000,Siyah,405000,İstanbul Üsküdar 483 | 156,2.0 TS Selespeed,2000,228435,Lacivert,215000,İstanbul Başakşehir 484 | Giulietta,1.6 JTD Distinctive,2011,257000,Beyaz,390000,Aydın Efeler 485 | Giulietta,1.6 JTD Distinctive,2012,325000,Kırmızı,365000,Konya Karatay 486 | 147,1.6 TS Distinctive,2005,190000,Gümüş Gri,216500,Kocaeli Gebze 487 | 156,1.6 TS,2001,230000,Kırmızı,200000,Uşak Merkez 488 | Giulietta,1.6 JTD Progression Plus,2015,200000,Beyaz,480000,İstanbul Büyükçekmece 489 | 159,1.9 JTS Distinctive,2007,178000,Bordo,380000,İstanbul Küçükçekmece 490 | Giulietta,1.6 JTD Distinctive,2014,174000,Siyah,465000,Bilecik Merkez 491 | MiTo,1.4 T MultiAir TCT Sportivo,2012,117250,Kırmızı,550000,Bolu Merkez 492 | 156,1.6 TS Distinctive,2004,282000,Kırmızı,335000,İstanbul Maltepe 493 | MiTo,1.3 JTD City,2013,115600,Mavi,399000,İstanbul Avcılar 494 | 146,1.4 TS,1998,250000,Mavi,150000,Karabük Safranbolu 495 | Giulietta,1.6 JTD Distinctive,2014,305000,Siyah,430000,İstanbul Sancaktepe 496 | 159,1.9 JTD Distinctive Plus,2007,235000,Siyah,430000,Adana Çukurova 497 | 147,1.6 TS Distinctive,2004,193000,Beyaz,210000,İstanbul Fatih 498 | Giulietta,1.6 JTD Distinctive,2013,214000,Beyaz,379750,Sakarya Adapazarı 499 | Giulietta,1.6 JTD Sprint,2020,23480,Kırmızı,880000,Ankara Altındağ 500 | 156,2.0 TS,2000,258000,Gümüş Gri,238000,Tekirdağ Kapaklı 501 | 156,1.6 TS Distinctive,2005,273000,Siyah,255000,Antalya Kepez 502 | 156,2.0 TS,1999,257000,Bordo,209000,İstanbul Kartal 503 | 159,1.9 JTD Distinctive,2006,328000,Siyah,368000,Bolu Merkez 504 | Giulietta,1.6 JTD Progression,2018,119000,Beyaz,588000,Bursa Nilüfer 505 | 156,1.6 TS Distinctive,2006,246981,Siyah,275000,Kocaeli Gölcük 506 | 146,1.6 TS,1999,240000,Kırmızı,117500,Konya Ereğli 507 | 156,2.0 TS Distinctive,2003,196000,Gümüş Gri,245000,Ankara Keçiören 508 | 156,1.6 TS Distinctive,2005,280000,Mavi,280000,Van İpekyolu 509 | 156,1.6 TS Distinctive,2000,248500,Kırmızı,160000,Kocaeli Gebze 510 | 156,2.0 TS,2000,259000,Gri,208000,Konya Selçuklu 511 | 156,2.0 JTS Distinctive,2002,252000,Gümüş Gri,195000,İzmir Konak 512 | MiTo,1.4 T MultiAir TCT Sportivo,2013,126000,Beyaz,590000,İstanbul Beşiktaş 513 | 147,1.6 TS Distinctive,2006,275000,Turuncu,215000,İstanbul Başakşehir 514 | 145,1.6 L,1997,271000,Gri,125000,İstanbul Beşiktaş 515 | Giulietta,1.6 JTD Distinctive,2015,198500,Kırmızı,495000,İzmir Karşıyaka 516 | 146,2.0 Ti,1997,307600,Gümüş Gri,195500,İzmir Balçova 517 | 147,1.6 TS Progression,2003,160000,Kırmızı,265000,Bilecik Merkez 518 | Giulietta,1.4 TB MultiAir Distinctive,2015,74000,Kırmızı,744000,İstanbul Beşiktaş 519 | 147,1.6 TS Distinctive,2004,273000,Kırmızı,178000,İstanbul Şişli 520 | Giulietta,1.4 TB MultiAir Distinctive,2014,134000,Kırmızı,674990,İstanbul Maltepe 521 | 156,1.6 TS Distinctive,2004,279400,Gri,275000,Eskişehir Odunpazarı 522 | Giulietta,1.6 JTD Distinctive,2013,94217,Beyaz,525000,Afyonkarahisar Merkez 523 | Giulietta,1.6 JTD Distinctive,2012,139000,Beyaz,495000,İstanbul Eyüpsultan 524 | 156,1.6 TS Progression,2004,272000,Siyah,245555,İstanbul Başakşehir 525 | Giulietta,1.4 TB MultiAir Super TCT,2018,65000,Beyaz,610000,İstanbul Bayrampaşa 526 | GTV,2.0 TB,1997,195000,Gümüş Gri,222250,Aydın Efeler 527 | Giulietta,1.4 TB MultiAir Distinctive,2012,248000,Kırmızı,434000,Konya Karatay 528 | 147,1.6 TS Distinctive,2004,210000,Siyah,206000,İstanbul Esenyurt 529 | Giulietta,1.6 JTD Super TCT,2016,190000,Kırmızı,605000,Antalya Kemer 530 | 147,1.6 TS Distinctive,2003,336000,Gri,162500,Ankara Etimesgut 531 | 147,1.6 TS Distinctive,2008,147550,Siyah,290000,İzmir Bayraklı 532 | 147,1.6 TS Distinctive,2006,196500,Gri,212500,İstanbul Ataşehir 533 | 147,1.6 TS Distinctive,2005,253000,Mavi,214000,İstanbul Avcılar 534 | 147,1.6 TS Distinctive,2008,229000,Kırmızı,260000,İzmir Karşıyaka 535 | Giulietta,1.4 TB MultiAir Distinctive,2011,153000,Siyah,395000,İstanbul Başakşehir 536 | Giulietta,1.4 TB Progression Plus,2013,110000,Beyaz,449000,Bursa Nilüfer 537 | MiTo,1.4 T Progression,2009,164000,Kırmızı,394500,Balıkesir Altıeylül 538 | Giulietta,1.6 JTD Giulietta,2020,58600,Gri,745000,Bursa Gemlik 539 | 147,1.6 TS Distinctive,2006,195600,Kırmızı,251000,İstanbul Bakırköy 540 | 159,1.9 JTD Distinctive Plus,2011,350000,Siyah,410000,İstanbul Esenler 541 | Giulietta,1.6 JTD Distinctive,2012,265000,Mavi,400000,İstanbul Avcılar 542 | Giulietta,1.6 JTD Progression,2016,29310,Siyah,665000,İstanbul Beşiktaş 543 | Giulietta,1.6 JTD Progression Plus,2014,177000,Beyaz,495000,Mersin Yenişehir 544 | 155,2.0 TS Super Losso,1997,185000,Lacivert,155000,Mersin Toroslar 545 | 156,1.6 TS,1998,231800,Bordo,225000,İzmir Karşıyaka 546 | Giulietta,1.6 JTD Distinctive,2014,96500,Beyaz,505000,İstanbul Çekmeköy 547 | Giulietta,1.6 JTD Progression,2016,140000,Beyaz,627000,Kocaeli Körfez 548 | 156,1.6 TS Distinctive,2006,139000,Bej,325000,İzmir Karşıyaka 549 | 156,1.6 TS Distinctive,2004,260000,Lacivert,259000,Muğla Köyceğiz 550 | 147,1.6 TS Distinctive,2004,201000,Gümüş Gri,255000,Burdur Merkez 551 | Giulietta,1.6 JTD Distinctive,2011,152000,Beyaz,550000,İstanbul Kadıköy 552 | Spider,2.0 TS,1999,153500,Kırmızı,615000,İstanbul Üsküdar 553 | 156,2.0 TS,1998,261000,Gümüş Gri,230000,Çorum Merkez 554 | Giulietta,1.6 JTD Distinctive,2012,196000,Beyaz,412000,İzmir Karşıyaka 555 | Giulietta,1.4 TB MultiAir Distinctive,2013,93500,Beyaz,600000,Ankara Yenimahalle 556 | MiTo,1.4 T MultiAir Quadrifoglio Verde,2011,144000,Siyah,460000,İstanbul Ümraniye 557 | 147,1.6 TS Distinctive,2006,220000,Şampanya,210000,İzmir Karabağlar 558 | MiTo,1.4 T Distinctive,2012,170000,Kırmızı,534990,İstanbul Maltepe 559 | Giulietta,1.6 JTD Distinctive,2012,211000,Kırmızı,425000,Ankara Akyurt 560 | Giulietta,1.6 JTD Distinctive,2013,225000,Beyaz,450000,İstanbul Çatalca 561 | 147,1.6 TS Distinctive,2006,225000,Kırmızı,280000,Bursa Yıldırım 562 | 147,1.6 TS Distinctive,2004,214000,Siyah,220000,Mersin Erdemli 563 | 147,1.6 TS Distinctive,2004,247968,Kırmızı,180000,Ankara Mamak 564 | Giulietta,1.6 JTD Distinctive,2014,235000,Kırmızı,440000,Ankara Etimesgut 565 | Giulietta,1.4 TB Progression Plus,2015,90000,Bordo,525000,Muğla Marmaris 566 | 159,1.9 JTD Progression,2006,353000,Bordo,375000,Ankara Çankaya 567 | 156,1.6 TS Distinctive,2004,239000,Gri,230000,İzmir Buca 568 | 156,2.0 TS,2001,240000,Siyah,203000,Mersin Yenişehir 569 | Giulietta,1.4 TB MultiAir Distinctive,2012,290000,Beyaz,435000,İstanbul Bağcılar 570 | 159,1.9 JTD Distinctive Plus,2008,305000,Şampanya,365000,Ankara Çankaya 571 | 156,1.6 TS Distinctive,2006,270000,Gri,270000,Tekirdağ Muratlı 572 | 156,2.0 TS Distinctive,2002,274000,Gümüş Gri,210000,İzmir Bornova 573 | Giulietta,1.6 JTD Distinctive,2011,197500,Gri,430000,Bursa Nilüfer 574 | Giulietta,1.6 JTD Distinctive,2012,203000,Beyaz,405000,İzmir Torbalı 575 | 147,1.6 TS Distinctive,2004,308000,Kırmızı,204000,Ankara Sincan 576 | Giulietta,1.6 JTD Distinctive,2015,185000,Gri,535000,Bursa Nilüfer 577 | Giulietta,1.4 TB MultiAir Distinctive,2014,72100,Beyaz,640000,Gaziantep Şahinbey 578 | 156,2.0 TS Executive,1999,333700,Kırmızı,232500,İstanbul Bayrampaşa 579 | 159,1.9 JTD Distinctive Plus,2006,300550,Gri,350000,Ankara Mamak 580 | Giulietta,1.4 TB MultiAir Distinctive,2012,139000,Beyaz,210000,Konya Meram 581 | Giulietta,1.6 JTD Distinctive,2015,51250,Beyaz,523000,Ankara Yenimahalle 582 | Giulietta,1.6 JTD Super TCT,2018,50000,Kahverengi,735750,İstanbul Esenyurt 583 | Giulietta,1.4 TB MultiAir Distinctive,2012,144000,Beyaz,405750,Adana Seyhan 584 | Giulietta,1.6 JTD Progression Plus,2012,165000,Gri,470000,İstanbul Avcılar 585 | Giulietta,1.6 JTD Distinctive,2012,257300,Kırmızı,432000,Balıkesir Bandırma 586 | 156,1.6 TS Distinctive,2005,202000,Mavi,249999,Aydın Nazilli 587 | 159,1.9 JTD Distinctive Plus,2007,203000,Siyah,400000,İstanbul Ataşehir 588 | Giulietta,1.6 JTD Distinctive,2014,146000,Siyah,515000,İstanbul Beylikdüzü 589 | Giulietta,1.4 TB MultiAir Distinctive,2013,180000,Beyaz,595750,Gaziantep Şehitkamil 590 | Giulietta,1.6 JTD Distinctive,2014,165000,Siyah,392000,Konya Meram 591 | Giulietta,1.6 JTD Progression Plus,2014,125000,Beyaz,499900,İstanbul Kartal 592 | Giulietta,1.6 JTD Giulietta,2020,44500,Kırmızı,740000,İstanbul Esenler 593 | 147,1.6 TS Distinctive,2004,312000,Kırmızı,217500,Malatya Yeşilyurt 594 | Giulietta,1.6 JTD Distinctive,2015,114000,Kırmızı,545000,Sivas Suşehri 595 | Giulietta,1.4 TB MultiAir Distinctive,2012,139000,Beyaz,510000,Ankara Mamak 596 | Giulietta,1.6 JTD Progression Plus,2015,187000,Beyaz,496000,Antalya Muratpaşa 597 | Giulietta,1.4 TB MultiAir Distinctive,2012,111951,Beyaz,535000,İstanbul Kadıköy 598 | Giulietta,1.4 TB MultiAir Distinctive,2011,220000,Siyah,382000,Osmaniye Merkez 599 | 156,1.6 TS Distinctive,2005,265000,Siyah,265000,Malatya Battalgazi 600 | 156,1.6 TS Progression,2004,284200,Kahverengi,220000,Hatay Kırıkhan 601 | Giulietta,1.6 JTD Distinctive,2014,110000,Kırmızı,498500,İstanbul Esenyurt 602 | 147,1.6 TS Distinctive,2004,285834,Gri,200000,Çorum Merkez 603 | Giulia,2.0 T Veloce,2021,12500,Gri,2205000,İstanbul Bağcılar 604 | Giulietta,1.6 JTD Progression Plus,2012,257000,Beyaz,465000,Bursa Osmangazi 605 | Giulietta,1.4 TB MultiAir Progression Pluse,2012,160000,Beyaz,525000,İstanbul Beşiktaş 606 | 147,2.0 TS Selespeed Distinctive,2005,194000,Gümüş Gri,217250,Ankara Akyurt 607 | Giulietta,1.6 JTD Distinctive,2011,220000,Kırmızı,480000,Bursa Mudanya 608 | 159,1.9 JTD Distinctive Plus,2008,326000,Kırmızı,385000,İstanbul Bağcılar 609 | Giulietta,1.6 JTD Distinctive,2013,177000,Kırmızı,439000,Ankara Çankaya 610 | Giulietta,1.6 JTD Distinctive,2012,329000,Beyaz,377500,İstanbul Çatalca 611 | Giulietta,1.4 TB MultiAir Distinctive,2014,96500,Beyaz,589000,Uşak Merkez 612 | Giulietta,1.6 JTD Distinctive,2013,184000,Beyaz,444000,İzmir Karşıyaka 613 | Giulietta,1.6 JTD Distinctive,2015,179000,Kırmızı,460000,Gaziantep Şehitkamil 614 | MiTo,1.4 T MultiAir TCT,2011,146000,Beyaz,449900,İstanbul Esenyurt 615 | Giulietta,1.6 JTD Distinctive,2012,100500,Beyaz,598000,Kocaeli İzmit 616 | Giulietta,1.6 JTD Progression Plus,2013,163000,Beyaz,425000,İstanbul Maltepe 617 | 147,1.6 TS Distinctive,2008,247500,Kırmızı,260000,Balıkesir Ayvalık 618 | Giulietta,1.4 TB MultiAir Distinctive,2011,169000,Beyaz,495000,Hatay Antakya 619 | 156,2.0 TS Selespeed,2001,313000,Siyah,225000,Ankara Etimesgut 620 | 159,1.9 JTD Distinctive Plus,2008,410000,Bej,299000,Eskişehir Odunpazarı 621 | 147,1.6 TS Distinctive,2006,250254,Siyah,220000,Eskişehir Odunpazarı 622 | Giulietta,1.6 JTD Progression Plus,2011,110827,Beyaz,445000,Mersin Yenişehir 623 | Giulietta,1.6 JTD Distinctive,2011,192000,Füme,339000,İstanbul Ataşehir 624 | Giulietta,1.6 JTD Distinctive,2011,220000,Kırmızı,505000,İstanbul Beylikdüzü 625 | Giulietta,1.6 JTD Super TCT,2016,97000,Siyah,764750,İzmir Narlıdere 626 | 159,1.9 JTD Distinctive,2008,221000,Siyah,390000,Denizli Merkezefendi 627 | 156,2.0 JTS Distinctive,2004,250000,Siyah,251500,İzmir Buca 628 | 159,1.9 JTD Distinctive Plus,2010,207550,Gri,465000,İzmir Konak 629 | Giulietta,1.6 JTD Distinctive,2015,155996,Kırmızı,563000,Ankara Çankaya 630 | Giulietta,1.4 TB Distinctive,2011,129000,Siyah,535000,Gaziantep Şehitkamil 631 | Giulietta,1.6 JTD Progression Plus,2011,270000,Füme,435000,Ankara Etimesgut 632 | 156,1.6 TS,2001,194000,Beyaz,182000,Şanlıurfa Haliliye 633 | 146,1.4 TS,1998,244000,Bordo,159999,Van Çaldıran 634 | 159,1.9 JTD Distinctive Plus,2010,130000,Siyah,445000,Bursa Yıldırım 635 | GT,2.0 JTS Dis.Selespeed,2007,155000,Mavi,380000,İstanbul Bayrampaşa 636 | Spider,3.0 TS,1996,89000,Siyah,575000,İstanbul Kartal 637 | Giulietta,1.4 TB MultiAir Distinctive,2011,79000,Siyah,600000,Van Tuşba 638 | 166,2.0 TS Distinctive,2005,290000,Siyah,270000,İzmir Buca 639 | 147,1.6 TS Distinctive,2007,273000,Kırmızı,230000,İstanbul Ataşehir 640 | Giulietta,1.4 TB MultiAir Distinctive,2015,54670,Beyaz,682000,Konya Karatay 641 | 156,1.6 TS,1999,280000,Mavi,175000,Kırklareli Vize 642 | 156,1.6 TS,2001,274400,Kırmızı,200000,Sakarya Adapazarı 643 | 159,1.9 JTD Distinctive Plus,2007,239000,Siyah,450900,İstanbul Çekmeköy 644 | 145,1.4 TS STD,1999,256000,Kırmızı,116500,Rize Çayeli 645 | Giulietta,1.6 JTD Progression Plus,2012,128000,Beyaz,440000,Bursa Nilüfer 646 | 159,1.9 JTD Distinctive,2007,250100,Gri,392000,İstanbul Beyoğlu 647 | 145,1.7,1996,204000,Kırmızı,135000,Edirne Merkez 648 | Giulietta,1.4 TB MultiAir Distinctive,2011,213000,Kırmızı,460000,Adana Seyhan 649 | Giulietta,1.6 JTD Super TCT,2017,159000,Gümüş Gri,625000,Eskişehir Odunpazarı 650 | Giulietta,1.4 TB Distinctive,2011,89500,Beyaz,381000,Sakarya Adapazarı 651 | 166,3.0 Sportronic,1999,220000,Gri,215000,Kocaeli Çayırova 652 | Giulietta,1.6 JTD Distinctive,2014,152000,Siyah,525000,Ankara Çankaya 653 | 156,1.6 TS Distinctive,2003,249000,Lacivert,229500,İzmir Bornova 654 | 145,1.6,1996,224000,Kırmızı,85000,Eskişehir Tepebaşı 655 | Giulietta,1.6 JTD Distinctive,2013,163000,Kırmızı,482000,Kocaeli İzmit 656 | 156,1.6 TS,2001,279000,Mavi,205000,İstanbul Ümraniye 657 | 156,1.6 TS Distinctive,2006,211000,Siyah,285000,Diyarbakır Kulp 658 | 146,1.6 TS,1998,305000,Gri,120000,Ankara Etimesgut 659 | 146,1.4 TS,1997,223000,Kırmızı,129900,Kocaeli Darıca 660 | 156,1.6 TS Distinctive,2004,233000,Siyah,225000,İzmir Gaziemir 661 | 147,1.6 TS Distinctive,2005,167000,Siyah,235000,İzmir Kemalpaşa 662 | Giulietta,1.4 TB MultiAir Distinctive,2012,88000,Kırmızı,585000,Antalya Muratpaşa 663 | 145,1.4 TS STD,1998,315000,Mavi,123000,Ankara Etimesgut 664 | 166,2.0 TS,2002,177000,Bordo,205000,Gaziantep Oğuzeli 665 | 147,1.6 TS Distinctive,2005,298500,Mavi,245000,İzmir Bergama 666 | Giulietta,1.4 TB Distinctive,2011,135000,Beyaz,402500,İstanbul Beylikdüzü 667 | Giulietta,1.6 JTD Distinctive,2015,130000,Kırmızı,618000,İstanbul Beykoz 668 | 146,1.6 L,1996,332000,Siyah,124000,Adana Seyhan 669 | Giulietta,1.6 JTD Progression Plus,2014,252500,Beyaz,455000,İzmir Bornova 670 | Giulietta,1.4 TB MultiAir Distinctive,2014,119000,Lacivert,615000,Konya Meram 671 | MiTo,1.4 T MultiAir TCT,2013,99000,Beyaz,449900,İstanbul Büyükçekmece 672 | 156,1.6 TS Distinctive,2004,260000,Gri,282000,İstanbul Küçükçekmece 673 | Giulietta,1.6 JTD Progression,2018,110000,Beyaz,639000,Ankara Akyurt 674 | 146,1.6 L,1996,275000,Şampanya,105000,İstanbul Kadıköy 675 | Giulietta,1.4 TB MultiAir Distinctive,2012,116000,Beyaz,675990,İstanbul Maltepe 676 | 147,1.6 TS Progression,2006,360000,Siyah,196000,Antalya Alanya 677 | Giulietta,1.6 JTD Progression Plus,2015,179000,Beyaz,550000,İstanbul Avcılar 678 | 146,1.4 TS,1998,288000,Gri,135500,Ankara Elmadağ 679 | 156,1.6 TS Distinctive,2004,280000,Gri,242000,Yozgat Sorgun 680 | Giulietta,1.6 JTD Distinctive,2014,213000,Siyah,465000,Kayseri Kocasinan 681 | 156,1.6 TS Distinctive,2004,280000,Mavi,230000,İzmir Karşıyaka 682 | Giulietta,1.6 JTD Giulietta,2020,29300,Kırmızı,765000,İstanbul Esenyurt 683 | 147,1.6 TS Progression,2009,182000,Kırmızı,284500,İstanbul Sarıyer 684 | Giulietta,1.4 TB MultiAir Distinctive,2011,110000,Beyaz,528000,Çanakkale Yenice 685 | Giulietta,1.4 TB Progression Plus,2013,165000,Beyaz,435500,İstanbul Ataşehir 686 | Giulietta,1.6 JTD Distinctive,2012,180000,Beyaz,369850,İstanbul Eyüpsultan 687 | Giulietta,1.6 JTD Distinctive,2014,220000,Kırmızı,325000,Ankara Yenimahalle 688 | Giulietta,1.6 JTD Super TCT,2016,110000,Gri,815000,Konya Meram 689 | 156,2.0 TS Distinctive,2001,272000,Siyah,193000,Ankara Yenimahalle 690 | Giulietta,1.6 JTD Progression Plus,2012,172600,Beyaz,422500,Sakarya Sapanca 691 | Giulietta,1.4 TB Progression Plus,2011,97000,Beyaz,445000,Kocaeli Gebze 692 | Giulietta,1.4 TB Progression Plus,2011,183000,Beyaz,410000,Sivas Merkez 693 | 145,1.6,1996,115500,Yeşil,122750,İstanbul Ümraniye 694 | Giulietta,1.6 JTD Distinctive,2014,60173,Kırmızı,535000,İstanbul Ümraniye 695 | 147,1.6 TS Distinctive,2003,182000,Kırmızı,232000,İstanbul Küçükçekmece 696 | 145,1.6,1996,240000,Kırmızı,137000,Muğla Bodrum 697 | 156,1.6 TS,2001,315000,Gümüş Gri,151900,İstanbul Başakşehir 698 | 147,2.0 TS Selespeed Distinctive,2005,245000,Siyah,240000,Gaziantep Şehitkamil 699 | 147,1.6 TS Distinctive,2007,260000,Bordo,230000,Antalya Alanya 700 | 156,1.6 TS Distinctive,2004,176000,Kırmızı,275000,İstanbul Maltepe 701 | MiTo,1.4 T MultiAir TCT Sportivo,2012,106000,Beyaz,515000,İstanbul Beykoz 702 | 156,1.6 TS Progression,2004,187000,Siyah,278000,Antalya Kepez 703 | 146,1.4 TS,1997,295000,Beyaz,113000,Şanlıurfa Haliliye 704 | GT,2.0 JTS Distinctive,2006,160000,Kırmızı,338000,Kocaeli Başiskele 705 | Giulietta,1.6 JTD Distinctive,2015,179600,Beyaz,473500,Ankara Çankaya 706 | Giulietta,1.4 TB MultiAir Distinctive,2011,120000,Beyaz,450000,İstanbul Ataşehir 707 | Giulietta,1.6 JTD Progression Plus,2011,116000,Beyaz,451500,İstanbul Eyüpsultan 708 | 155,2.0 TS Super Losso,1997,280000,Siyah,140000,Konya Selçuklu 709 | MiTo,1.4 T Distinctive,2009,165500,Kırmızı,405000,İstanbul Gaziosmanpaşa 710 | 156,1.6 TS Distinctive,2004,264000,Füme,255000,İstanbul Avcılar 711 | Giulietta,1.4 TB MultiAir Super TCT,2017,56750,Beyaz,888000,Rize Merkez 712 | 156,1.6 TS,1998,243000,Mavi,141500,İstanbul Diğer 713 | Giulietta,1.4 TB MultiAir Distinctive,2013,145000,Beyaz,449000,Kayseri Kocasinan 714 | 147,1.6 TS Progression,2004,197000,Siyah,195000,Ankara Beypazarı 715 | 145,1.6,1997,288000,Kırmızı,143000,İstanbul Ataşehir 716 | Giulia,2.0 T Veloce,2022,7350,Siyah,2390000,İstanbul Kadıköy 717 | Giulietta,1.6 JTD Distinctive,2011,162700,Siyah,395900,İzmir Gaziemir 718 | Giulietta,1.6 JTD Progression Plus,2014,128500,Beyaz,502000,İstanbul Zeytinburnu 719 | GT,2.0 JTS Distinctive,2006,124236,Siyah,350000,İstanbul Fatih 720 | Giulietta,1.6 JTD Progression Plus,2013,150000,Beyaz,470000,Antalya Muratpaşa 721 | 156,2.0 TS Distinctive,2001,222000,Gri,158500,İstanbul Küçükçekmece 722 | MiTo,1.6 JTD Distinctive,2009,225000,Beyaz,340000,İstanbul Bağcılar 723 | Giulietta,1.4 TB MultiAir Distinctive,2013,76844,Beyaz,619000,Çorum Merkez 724 | 147,1.6 TS Distinctive,2004,227000,Siyah,200000,Antalya Muratpaşa 725 | 156,2.0 TS Selespeed,2000,353000,Gümüş Gri,235000,İstanbul Ümraniye 726 | MiTo,1.4 T Distinctive,2009,197000,Siyah,345000,Kocaeli İzmit 727 | Giulietta,1.6 JTD Distinctive,2012,122000,Beyaz,462500,İzmir Gaziemir 728 | Giulietta,1.4 TB Progression Plus,2014,63000,Beyaz,550000,İstanbul Büyükçekmece 729 | 156,2.0 TS,1998,276000,Siyah,140000,Antalya Alanya 730 | Giulietta,1.6 JTD Distinctive,2012,142500,Kırmızı,430000,Ankara Etimesgut 731 | 145,1.6,1996,225000,Siyah,134000,Kocaeli Çayırova 732 | MiTo,1.4 T MultiAir TCT,2011,142125,Beyaz,485000,İstanbul Üsküdar 733 | 156,2.0 TS Distinctive,2000,366000,Kırmızı,190000,İstanbul Kadıköy 734 | 156,1.6 TS Distinctive,2005,214800,Şampanya,280000,İstanbul Avcılar 735 | Giulietta,1.4 TB MultiAir Distinctive,2014,166000,Kırmızı,635000,Uşak Merkez 736 | Giulietta,1.4 TB MultiAir Distinctive,2012,139000,Gümüş Gri,503000,Ankara Çankaya 737 | GTV,2.0 TB,1997,142000,Beyaz,421000,Antalya Aksu 738 | Giulietta,1.6 JTD Distinctive,2013,190000,Beyaz,465000,Gaziantep Şehitkamil 739 | 156,1.6 TS Distinctive,2005,278000,Siyah,240000,Gaziantep Şahinbey 740 | MiTo,1.3 JTD City,2012,161235,Kırmızı,425000,Ankara Çankaya 741 | Giulietta,1.4 TB MultiAir Distinctive,2013,123000,Beyaz,589000,Manisa Salihli 742 | Giulietta,1.6 JTD Super TCT,2020,49000,Beyaz,835000,Antalya Muratpaşa 743 | 166,2.0 TS Executive,2001,260000,Siyah,145000,Sivas Şarkışla 744 | Giulietta,1.6 JTD Distinctive,2012,301000,Kırmızı,395000,İstanbul Bağcılar 745 | 147,1.6 TS Distinctive,2005,213000,Füme,274000,İstanbul Büyükçekmece 746 | Giulietta,1.4 TB MultiAir Distinctive,2015,87000,Beyaz,630000,İstanbul Küçükçekmece 747 | 33,1.5 IE,1990,147000,Kırmızı,75000,İstanbul Pendik 748 | Giulietta,1.6 JTD Distinctive,2012,176500,Beyaz,412500,Ankara Etimesgut 749 | Giulietta,1.6 JTD Progression Plus,2011,238000,Siyah,383000,Gaziantep Şahinbey 750 | Giulietta,1.6 JTD Distinctive,2011,177000,Beyaz,398000,İstanbul Ümraniye 751 | 145,1.7,1995,247000,Gri,95000,İstanbul Eyüpsultan 752 | 159,1.9 JTD Distinctive Plus,2008,319000,Kahverengi,425000,İzmir Çiğli 753 | 159,1.9 JTD Distinctive,2006,269000,Gri,293000,İstanbul Bayrampaşa 754 | 145,1.6,1996,215000,Yeşil,140000,Mersin Erdemli 755 | 147,2.0 TS Selespeed Distinctive,2004,175000,Bej,215000,İstanbul Ataşehir 756 | Giulietta,1.4 TB MultiAir Distinctive,2011,94000,Gümüş Gri,500000,Balıkesir Karesi 757 | MiTo,1.4 T MultiAir TCT,2013,117000,Beyaz,425000,İstanbul Beşiktaş 758 | Giulietta,1.4 TB MultiAir Distinctive,2012,179900,Beyaz,535000,Antalya Muratpaşa 759 | Giulietta,1.6 JTD Super TCT,2018,155200,Gri,613000,İstanbul Sancaktepe 760 | Giulietta,1.6 JTD Distinctive,2013,161000,Beyaz,470000,İstanbul Sancaktepe 761 | Giulietta,1.4 TB MultiAir Distinctive,2012,288000,Beyaz,409000,Düzce Merkez 762 | Giulietta,1.6 JTD Progression Plus,2012,104700,Beyaz,457500,İstanbul Kadıköy 763 | Giulietta,1.6 JTD Progression,2017,47000,Beyaz,725000,Ankara Çankaya 764 | 156,1.6 TS Distinctive,2006,299000,Füme,225000,Aydın Söke 765 | Giulietta,1.6 JTD Distinctive,2011,188000,Beyaz,393750,İstanbul Esenyurt 766 | MiTo,1.4 T MultiAir Quadrifoglio Verde,2010,118000,Kırmızı,365000,İstanbul Esenyurt 767 | Giulietta,1.4 TB MultiAir Distinctive,2014,78000,Kırmızı,665500,Sakarya Serdivan 768 | 159,3.2 JTS Q4 Distinctive,2006,208000,Füme,1375000,İstanbul Sarıyer 769 | Giulietta,1.6 JTD Distinctive,2011,188000,Beyaz,470000,İstanbul Maltepe 770 | Giulietta,1.6 JTD Distinctive,2013,235000,Kırmızı,407500,İstanbul Ataşehir 771 | Giulietta,1.6 JTD Progression Plus,2011,178000,Siyah,410000,İstanbul Gaziosmanpaşa 772 | 147,1.6 TS Distinctive,2004,253000,Kırmızı,193000,İzmir Çiğli 773 | MiTo,1.4 T Distinctive,2009,168000,Sarı,339000,İstanbul Kadıköy 774 | 156,1.6 TS Distinctive,2004,262000,Gri,230000,Hatay Dörtyol 775 | 147,1.6 TS Progression,2009,93800,Siyah,337500,İstanbul Beylikdüzü 776 | Giulietta,1.6 JTD Distinctive,2012,215000,Kırmızı,445000,Denizli Acıpayam 777 | 156,2.0 TS Distinctive,2000,370000,Gri,187000,Muğla Milas 778 | MiTo,1.6 JTD Progression,2009,217000,Kahverengi,335900,İstanbul Büyükçekmece 779 | 156,1.6 TS Distinctive,2005,187000,Siyah,283000,Balıkesir Karesi 780 | Giulietta,1.6 JTD Distinctive,2015,103084,Siyah,588000,Ankara Çankaya 781 | 156,1.6 TS Distinctive,2005,240000,Gri,270000,Mardin Savur 782 | Giulietta,1.6 JTD Distinctive,2014,170000,Beyaz,580000,İzmir Karşıyaka 783 | 159,1.9 JTD Distinctive Plus,2008,269000,Bordo,337900,İstanbul Bağcılar 784 | Giulietta,1.6 JTD Distinctive,2015,118000,Beyaz,520000,Ankara Çankaya 785 | 147,1.6 TS Distinctive,2005,320000,Kırmızı,265000,Mersin Silifke 786 | Giulietta,1.4 TB MultiAir Distinctive,2014,134990,Kırmızı,639000,İstanbul Üsküdar 787 | Giulia,2.0 T Sprint,2020,32700,Lacivert,1919000,İstanbul Üsküdar 788 | 156,2.0 TS Executive,1999,230000,Gümüş Gri,172000,Eskişehir Odunpazarı 789 | Giulietta,1.6 JTD Super TCT,2016,75800,Kırmızı,688900,Denizli Sarayköy 790 | Giulietta,1.6 JTD Distinctive,2012,245000,Beyaz,420000,İstanbul Kadıköy 791 | 147,1.6 TS Distinctive,2004,210000,Gri,233000,İzmir Güzelbahçe 792 | Brera,3.2 JTS Q4 Sky Window,2006,6080,Siyah,1700000,İstanbul Maltepe 793 | Giulietta,1.6 JTD Super TCT,2016,105000,Kırmızı,689000,Mersin Yenişehir 794 | Giulietta,1.6 JTD Super TCT,2016,140000,Beyaz,725000,Eskişehir Odunpazarı 795 | 156,1.6 TS Progression,2004,220000,Kırmızı,294500,Burdur Bucak 796 | Giulietta,1.6 JTD Distinctive,2014,117000,Beyaz,509000,İstanbul Başakşehir 797 | Giulietta,1.6 JTD Distinctive,2015,103000,Kırmızı,550000,Diyarbakır Kayapınar 798 | 159,1.9 JTD Distinctive,2006,212000,Siyah,365000,Balıkesir Altıeylül 799 | 156,1.6 TS Distinctive,2006,360000,Siyah,190000,İstanbul Ataşehir 800 | Giulietta,1.4 TB MultiAir Distinctive,2015,89592,Beyaz,779000,Ankara Etimesgut 801 | Giulietta,1.6 JTD Distinctive,2014,90000,Siyah,517000,Bartın Merkez 802 | 156,2.0 TS Executive,1999,227000,Siyah,180000,Eskişehir Tepebaşı 803 | 147,1.6 TS Progression,2004,230000,Siyah,200000,Erzurum Yakutiye 804 | Giulietta,1.4 TB MultiAir Distinctive,2012,116000,Beyaz,615750,İstanbul Pendik 805 | Giulietta,1.6 JTD Progression,2016,166000,Beyaz,659000,Adana Seyhan 806 | 159,1.9 JTD Distinctive Plus,2009,187000,Beyaz,450000,İzmir Konak 807 | 147,1.6 TS Distinctive,2005,299000,Siyah,215000,Nevşehir Merkez 808 | MiTo,1.4 T MultiAir TCT Sportivo,2011,97000,Beyaz,515000,Kocaeli Gebze 809 | Giulietta,1.6 JTD Distinctive,2013,156000,Beyaz,420000,İstanbul Kartal 810 | 147,1.6 TS Black Line,2006,175000,Siyah,245000,İstanbul Beşiktaş 811 | 156,1.6 TS Distinctive,2004,185000,Füme,272500,İstanbul Kadıköy 812 | 156,1.6 TS Distinctive,2004,290000,Gümüş Gri,239750,Ankara Keçiören 813 | Giulietta,1.6 JTD Distinctive,2014,169000,Beyaz,490000,Tekirdağ Çorlu 814 | 147,1.6 TS Distinctive,2004,223000,Kırmızı,229750,Çorum Merkez 815 | Giulia,2.0 T Veloce,2020,46000,Mavi,2150000,İstanbul Kadıköy 816 | 159,1.9 JTD Distinctive,2008,300500,Siyah,385000,İstanbul Zeytinburnu 817 | Giulietta,1.4 TB MultiAir Distinctive,2013,123000,Beyaz,465000,İstanbul Sarıyer 818 | Giulietta,1.4 TB Distinctive,2011,104000,Beyaz,455000,İstanbul Pendik 819 | 156,2.0 TS,2000,287000,Siyah,170000,Aydın Söke 820 | Giulietta,1.4 TB MultiAir Distinctive,2013,90550,Beyaz,620000,İstanbul Maltepe 821 | Giulietta,1.4 TB MultiAir Distinctive,2012,165000,Füme,535000,İstanbul Fatih 822 | 146,1.6 TS,1997,352000,Lacivert,121000,İstanbul Küçükçekmece 823 | 156,1.6 TS Distinctive,2004,248000,Bej,265000,İzmir Karabağlar 824 | Giulietta,1.6 JTD Distinctive,2014,150000,Kırmızı,449000,İstanbul Çekmeköy 825 | Giulietta,1.6 JTD Distinctive,2012,220000,Beyaz,443000,İstanbul Sancaktepe 826 | 147,1.6 TS Distinctive,2008,158000,Kırmızı,295000,Sivas Merkez 827 | 147,1.6 TS Progression,2003,238500,Kırmızı,204000,Ankara Mamak 828 | Giulietta,1.75 TBI Quadrifoglio Verde,2011,167000,Kırmızı,680000,Antalya Konyaaltı 829 | 147,1.6 TS Distinctive,2006,228000,Gri,255000,İstanbul Esenyurt 830 | MiTo,1.6 JTD Distinctive,2010,270000,Beyaz,325000,İstanbul Başakşehir 831 | 156,2.0 TS Selespeed,2001,290000,Mavi,220000,İstanbul Başakşehir 832 | 159,1.9 JTD Distinctive,2007,208412,Gümüş Gri,370000,İzmir Karşıyaka 833 | 159,1.9 JTD Distinctive,2006,262000,Siyah,335000,Diğer 834 | 156,1.6 TS Distinctive,2004,343000,Lacivert,215000,Muğla Bodrum 835 | 145,1.4 TS STD,1998,180000,Lacivert,117500,Antalya Diğer 836 | MiTo,1.4 T Distinctive,2011,178000,Siyah,420000,İstanbul Maltepe 837 | 156,2.0 TS,1998,300010,Gümüş Gri,162000,Denizli Pamukkale 838 | Giulietta,1.6 JTD Progression Plus,2014,175000,Gri,510000,İstanbul Pendik 839 | 147,1.9 JTD Q2,2003,261000,Siyah,225000,İstanbul Kadıköy 840 | Giulietta,1.6 JTD Distinctive,2011,270000,Beyaz,620000,Muğla Bodrum 841 | Giulietta,1.4 TB MultiAir Distinctive,2012,129700,Beyaz,615000,İstanbul Ataşehir 842 | 146,1.4 TS,1998,222000,Bordo,120000,İstanbul Küçükçekmece 843 | 156,1.6 TS Distinctive,2004,243000,Kırmızı,239500,Eskişehir Odunpazarı 844 | Giulietta,1.6 JTD Distinctive,2011,171000,Beyaz,405000,İstanbul Küçükçekmece 845 | Giulietta,1.4 TB Distinctive,2011,118000,Beyaz,445000,İstanbul Esenler 846 | Giulia,2.0 T Veloce,2022,20000,Füme,2430000,İstanbul Başakşehir 847 | Giulietta,1.6 JTD Distinctive,2011,270000,Beyaz,384750,Ankara Sincan 848 | Giulietta,1.4 TB MultiAir Distinctive,2012,71000,Beyaz,544000,İstanbul Maltepe 849 | MiTo,1.3 JTD City,2014,111889,Kırmızı,400000,Gaziantep Şehitkamil 850 | 147,1.6 TS Distinctive,2005,259000,Siyah,235000,Afyonkarahisar Merkez 851 | 147,1.6 TS Distinctive,2004,344191,Mavi,185000,Manisa Yunusemre 852 | 159,2.4 JTD Distinctive,2007,311000,Füme,357500,İstanbul Kadıköy 853 | Giulietta,1.4 TB MultiAir Distinctive,2011,191000,Bordo,420000,Kocaeli Gebze 854 | Giulietta,1.4 TB MultiAir Distinctive,2011,174000,Beyaz,520000,İstanbul Bahçelievler 855 | Giulietta,1.4 TB Progression Plus,2014,130758,Kırmızı,490000,Balıkesir Bandırma 856 | MiTo,1.3 JTD City,2012,191000,Beyaz,352500,İstanbul Maltepe 857 | Giulia,2.0 T Veloce,2022,10243,Beyaz,2430000,Konya Karatay 858 | 146,1.6 TS,1997,352000,Lacivert,121000,İstanbul Küçükçekmece 859 | 166,2.0 TB,1999,260000,Siyah,173000,İzmir Bornova 860 | 147,1.6 TS Distinctive,2003,232300,Kırmızı,188000,Aydın Nazilli 861 | Giulietta,1.4 TB MultiAir Super TCT,2016,87000,Beyaz,799000,İzmir Karabağlar 862 | Giulietta,1.6 JTD Progression Plus,2012,152000,Beyaz,445000,İzmir Gaziemir 863 | Giulietta,1.6 JTD Progression Plus,2014,110000,Siyah,515000,İstanbul Kartal 864 | 146,1.6 L,1997,272300,Siyah,125000,İstanbul Üsküdar 865 | 159,1.9 JTD Distinctive Plus,2007,243000,Bordo,485000,İstanbul Ataşehir 866 | 156,1.6 TS Distinctive,2005,326000,Mavi,259000,Muğla Bodrum 867 | -------------------------------------------------------------------------------- /Week07/alfaromeosoup.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import re 3 | from bs4 import BeautifulSoup 4 | import time 5 | import random 6 | import csv 7 | import os 8 | 9 | 10 | class AlfaRomeo: 11 | def __init__(self, domain, link, csv_file, update_interval): 12 | self.domain = domain 13 | self.link = link 14 | self.csv_file = csv_file 15 | self.update_interval = update_interval 16 | self.__car_list = [] 17 | 18 | def update_cars(self): 19 | car_list = [] 20 | url = f"{self.domain}{self.link}" 21 | # url = "https://www.sahibinden.com/alfa-romeo?pagingSize=50" 22 | # url = "https://www.canbula.com/alfaromeo/page01.html" 23 | headers = { 24 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36" 25 | } 26 | next_page = True 27 | while next_page: 28 | result = requests.get(url, headers=headers) 29 | result = re.sub(r"", '\n', result.text) 30 | soup = BeautifulSoup(result, "html.parser", from_encoding="utf-8") 31 | rows = soup.find_all("tr", {"class": "searchResultsItem", "data-id": True}) 32 | for row in rows: 33 | model = row.find_all("td", {"class": "searchResultsTagAttributeValue"})[0].text.strip() 34 | version = row.find_all("td", {"class": "searchResultsTagAttributeValue"})[1].text.strip() 35 | year = int(row.find_all("td", {"class": "searchResultsAttributeValue"})[0].text.strip()) 36 | km = int(row.find_all("td", {"class": "searchResultsAttributeValue"})[1].text.strip().replace(".", "")) 37 | color = row.find_all("td", {"class": "searchResultsAttributeValue"})[2].text.strip() 38 | price = int(row.find("td", {"class": "searchResultsPriceValue"}).text.strip().split(",")[0].replace(".", "").replace("TL", "")) 39 | location = row.find("td", {"class": "searchResultsLocationValue"}).text.strip().replace("\n", " ") 40 | car_list.append( 41 | { 42 | "model": model, 43 | "version": version, 44 | "year": year, 45 | "km": km, 46 | "color": color, 47 | "price": price, 48 | "location": location 49 | } 50 | ) 51 | next_link = soup.find("a", {"class": "prevNextBut", "title": "Sonraki"}) 52 | if next_link is None: 53 | next_page = False 54 | else: 55 | next_page = True 56 | url = f"{self.domain}{next_link.get('href')}" 57 | time.sleep(random.randint(1, 5)+random.random()) 58 | self.__car_list = car_list 59 | 60 | def save_cars(self): 61 | with open(self.csv_file, "w", newline="", encoding="utf-8") as file: 62 | writer = csv.DictWriter(file, fieldnames=["model", "version", "year", "km", "color", "price", "location"]) 63 | writer.writeheader() 64 | for car in self.__car_list: 65 | writer.writerow(car) 66 | 67 | def load_cars(self): 68 | with open(self.csv_file, "r", newline="", encoding="utf-8") as file: 69 | reader = csv.DictReader(file) 70 | self.__car_list = [row for row in reader] 71 | 72 | def delete_cars(self): 73 | self.__car_list = [] 74 | try: 75 | os.remove(self.csv_file) 76 | except: 77 | pass 78 | 79 | def cars(self): 80 | if not os.path.exists(self.csv_file) or (time.time() - os.path.getmtime(self.csv_file)) > self.update_interval: 81 | self.update_cars() 82 | self.save_cars() 83 | else: 84 | self.load_cars() 85 | return self.__car_list 86 | 87 | 88 | if __name__ == "__main__": 89 | alfa_romeo = AlfaRomeo( 90 | "https://www.sahibinden.com", 91 | "/alfa-romeo?pagingSize=50", 92 | f"{os.getcwd()}/Week07/alfa_romeo.csv", 93 | 36000 94 | ) 95 | cars = alfa_romeo.cars() 96 | print(cars) 97 | -------------------------------------------------------------------------------- /Week07/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | app = Flask(__name__) 3 | 4 | @app.route('/') 5 | def hello_world(): # put application's code here 6 | return 'Hello World!' 7 | 8 | if __name__ == '__main__': 9 | app.run() 10 | -------------------------------------------------------------------------------- /Week07/static/style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canbula/DataVisualization/b5f2f92eb520f29ac983f4b90b8f76b3dd9ecb7e/Week07/static/style.css -------------------------------------------------------------------------------- /Week07/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $Title$ 6 | 7 | 8 | $END$ 9 | 10 | -------------------------------------------------------------------------------- /Week08/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | app = Flask(__name__) 3 | 4 | @app.route('/') 5 | def hello_world(): # put application's code here 6 | return 'Hello World!' 7 | 8 | if __name__ == '__main__': 9 | app.run() 10 | -------------------------------------------------------------------------------- /Week08/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $Title$ 6 | 7 | 8 | $END$ 9 | 10 | -------------------------------------------------------------------------------- /Week13/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from selenium import webdriver 3 | from webdriver_manager.chrome import ChromeDriverManager 4 | from selenium.webdriver.chrome.service import Service 5 | from selenium.webdriver.common.by import By 6 | import pandas as pd 7 | import io 8 | 9 | 10 | app = Flask(__name__) 11 | 12 | 13 | def fetch(): 14 | options = webdriver.ChromeOptions() 15 | options.add_argument("--headless") 16 | options.add_argument("--ignore-certificate-errors") 17 | options.add_argument("--incognito") 18 | service = Service(ChromeDriverManager().install()) 19 | browser = webdriver.Chrome(service=service, options=options) 20 | link = "http://www.koeri.boun.edu.tr/scripts/lst1.asp" 21 | browser.get(link) 22 | raw_text = browser.find_element(By.TAG_NAME, "pre").text 23 | browser.close() 24 | return raw_text 25 | 26 | 27 | """ 28 | 0 1 2 3 4 5 6 7 8 29 | 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 30 | 2023.05.15 13:09:44 38.1272 37.7975 14.3 -.- 1.8 -.- FINDIKKOY-DOGANSEHIR (MALATYA) İlksel 31 | """ 32 | 33 | 34 | def parse(raw_text): 35 | data_buffer = io.StringIO(raw_text) 36 | widths = [(0, 10), (11, 19), (21, 28), 37 | (31, 38), (43, 49), (59, 63), 38 | (71, 120)] 39 | df = pd.read_fwf(data_buffer, colspecs=widths, 40 | skiprows=[i for i in range(6)], 41 | header=None) 42 | df.columns = ["Date", "Time", 43 | "Latitude", "Longitude", 44 | "Depth", "Magnitude", "Location"] 45 | return df 46 | 47 | 48 | @app.route("/") 49 | def main(): 50 | raw_text = fetch() 51 | df = parse(raw_text) 52 | return render_template("index.html", 53 | dates=df["Date"].tolist(), 54 | times=df["Time"].tolist(), 55 | latitudes=df["Latitude"].tolist(), 56 | longitudes=df["Longitude"].tolist(), 57 | depths=df["Depth"].tolist(), 58 | magnitudes=df["Magnitude"].tolist(), 59 | locations=df["Location"].tolist(), 60 | content=df.to_html()) 61 | 62 | 63 | if __name__ == "__main__": 64 | app.run() 65 | -------------------------------------------------------------------------------- /Week13/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Earthquake Data 6 | 7 | 8 | 9 |
10 | 51 |
52 |
53 | 84 |
85 |
86 | 129 |
130 | {{ content|safe }} 131 | 132 | --------------------------------------------------------------------------------