| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | name,column1,column2,column3 | |
| 2 | 2 | abc,1.1,4.2,1.2 | |
| 3 | 3 | def,2.1,1.4,5.2 | |
| 4 | - ghi,1.5,1.2,2.1 | ||
| 5 | - jkl,1.8,1.1,4.2 | ||
| 4 | + ghi,1.5,1.2,-2.1 | ||
| 5 | + jkl,1.8,-1.1,4.2 | ||
| 6 | 6 | mno,9.4,6.6,6.2 | |
| 7 | 7 | pqr,1.4,8.3,8.4 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | name,column1,column2,column3 | |
| 2 | - abc,1.1^,4.2,1.2^ | ||
| 2 | + abc,1.1*,4.2,1.2 | ||
| 3 | 3 | def,2.1,1.4,5.2 | |
| 4 | - ghi,1.5,1.2,2.1 | ||
| 5 | - jkl,1.8,1.1^,4.2 | ||
| 6 | - mno,9.4*,6.6,6.2 | ||
| 7 | - pqr,1.4,8.3*,8.4* | ||
| 4 | + ghi,1.5,1.2,-2.1* | ||
| 5 | + jkl,1.8,-1.1*,4.2 | ||
| 6 | + mno,9.4,6.6,6.2 | ||
| 7 | + pqr,1.4,8.3,8.4 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "metadata": { | |
| 3 | 3 | "name": "", | |
| 4 | - "signature": "sha256:13c10e46fea51bcbbf203261897bb4d8ea2087e39925e077d452778f78d62b1e" | ||
| 4 | + "signature": "sha256:7ce6d9e0e1dc3da5c31fc5f3a5ab7687870a76cd4adaedd6da95bc6451755b12" | ||
| 5 | 5 | }, | |
| 6 | 6 | "nbformat": 3, | |
| 7 | 7 | "nbformat_minor": 0, | |
@@ -141,7 +141,7 @@ | |||
| 141 | 141 | "language": "python", | |
| 142 | 142 | "metadata": {}, | |
| 143 | 143 | "outputs": [], | |
| 144 | - "prompt_number": 4 | ||
| 144 | + "prompt_number": 1 | ||
| 145 | 145 | }, | |
| 146 | 146 | { | |
| 147 | 147 | "cell_type": "code", | |
@@ -167,7 +167,7 @@ | |||
| 167 | 167 | ] | |
| 168 | 168 | } | |
| 169 | 169 | ], | |
| 170 | - "prompt_number": 5 | ||
| 170 | + "prompt_number": 2 | ||
| 171 | 171 | }, | |
| 172 | 172 | { | |
| 173 | 173 | "cell_type": "markdown", | |
@@ -207,13 +207,14 @@ | |||
| 207 | 207 | " \"\"\" Prints CSV file to standard output.\"\"\"\n", | |
| 208 | 208 | " print(50*'-')\n", | |
| 209 | 209 | " for row in csv_content:\n", | |
| 210 | + " row = [str(e) for e in row]\n", | ||
| 210 | 211 | " print('\\t'.join(row))\n", | |
| 211 | 212 | " print(50*'-')" | |
| 212 | 213 | ], | |
| 213 | 214 | "language": "python", | |
| 214 | 215 | "metadata": {}, | |
| 215 | 216 | "outputs": [], | |
| 216 | - "prompt_number": 6 | ||
| 217 | + "prompt_number": 3 | ||
| 217 | 218 | }, | |
| 218 | 219 | { | |
| 219 | 220 | "cell_type": "code", | |
@@ -238,15 +239,15 @@ | |||
| 238 | 239 | "name\tcolumn1\tcolumn2\tcolumn3\n", | |
| 239 | 240 | "abc\t1.1\t4.2\t1.2\n", | |
| 240 | 241 | "def\t2.1\t1.4\t5.2\n", | |
| 241 | - "ghi\t1.5\t1.2\t2.1\n", | ||
| 242 | - "jkl\t1.8\t1.1\t4.2\n", | ||
| 242 | + "ghi\t1.5\t1.2\t-2.1\n", | ||
| 243 | + "jkl\t1.8\t-1.1\t4.2\n", | ||
| 243 | 244 | "mno\t9.4\t6.6\t6.2\n", | |
| 244 | 245 | "pqr\t1.4\t8.3\t8.4\n", | |
| 245 | 246 | "--------------------------------------------------\n" | |
| 246 | 247 | ] | |
| 247 | 248 | } | |
| 248 | 249 | ], | |
| 249 | - "prompt_number": 7 | ||
| 250 | + "prompt_number": 4 | ||
| 250 | 251 | }, | |
| 251 | 252 | { | |
| 252 | 253 | "cell_type": "markdown", | |
@@ -291,7 +292,7 @@ | |||
| 291 | 292 | "language": "python", | |
| 292 | 293 | "metadata": {}, | |
| 293 | 294 | "outputs": [], | |
| 294 | - "prompt_number": 8 | ||
| 295 | + "prompt_number": 5 | ||
| 295 | 296 | }, | |
| 296 | 297 | { | |
| 297 | 298 | "cell_type": "code", | |
@@ -310,12 +311,12 @@ | |||
| 310 | 311 | "text": [ | |
| 311 | 312 | "first 3 rows:\n", | |
| 312 | 313 | "['name', 'column1', 'column2', 'column3']\n", | |
| 313 | - "['abc', 1.1, 4.2, 1.2]\n", | ||
| 314 | - "['def', 2.1, 1.4, 5.2]\n" | ||
| 314 | + "['abc', '1.1', '4.2', '1.2']\n", | ||
| 315 | + "['def', '2.1', '1.4', '5.2']\n" | ||
| 315 | 316 | ] | |
| 316 | 317 | } | |
| 317 | 318 | ], | |
| 318 | - "prompt_number": 9 | ||
| 319 | + "prompt_number": 6 | ||
| 319 | 320 | }, | |
| 320 | 321 | { | |
| 321 | 322 | "cell_type": "markdown", | |
@@ -374,7 +375,7 @@ | |||
| 374 | 375 | "language": "python", | |
| 375 | 376 | "metadata": {}, | |
| 376 | 377 | "outputs": [], | |
| 377 | - "prompt_number": 10 | ||
| 378 | + "prompt_number": 7 | ||
| 378 | 379 | }, | |
| 379 | 380 | { | |
| 380 | 381 | "cell_type": "markdown", | |
@@ -393,6 +394,7 @@ | |||
| 393 | 394 | "print_csv(csv_cont)\n", | |
| 394 | 395 | "\n", | |
| 395 | 396 | "print('\\n\\nCSV sorted by column \"column3\":')\n", | |
| 397 | + "convert_cells_to_floats(csv_cont)\n", | ||
| 396 | 398 | "csv_sorted = sort_by_column(csv_cont, 'column3')\n", | |
| 397 | 399 | "print_csv(csv_sorted)" | |
| 398 | 400 | ], | |
@@ -410,8 +412,8 @@ | |||
| 410 | 412 | "name\tcolumn1\tcolumn2\tcolumn3\n", | |
| 411 | 413 | "abc\t1.1\t4.2\t1.2\n", | |
| 412 | 414 | "def\t2.1\t1.4\t5.2\n", | |
| 413 | - "ghi\t1.5\t1.2\t2.1\n", | ||
| 414 | - "jkl\t1.8\t1.1\t4.2\n", | ||
| 415 | + "ghi\t1.5\t1.2\t-2.1\n", | ||
| 416 | + "jkl\t1.8\t-1.1\t4.2\n", | ||
| 415 | 417 | "mno\t9.4\t6.6\t6.2\n", | |
| 416 | 418 | "pqr\t1.4\t8.3\t8.4\n", | |
| 417 | 419 | "--------------------------------------------------\n", | |
@@ -420,17 +422,17 @@ | |||
| 420 | 422 | "CSV sorted by column \"column3\":\n", | |
| 421 | 423 | "--------------------------------------------------\n", | |
| 422 | 424 | "name\tcolumn1\tcolumn2\tcolumn3\n", | |
| 425 | + "ghi\t1.5\t1.2\t-2.1\n", | ||
| 423 | 426 | "abc\t1.1\t4.2\t1.2\n", | |
| 424 | - "ghi\t1.5\t1.2\t2.1\n", | ||
| 425 | - "jkl\t1.8\t1.1\t4.2\n", | ||
| 427 | + "jkl\t1.8\t-1.1\t4.2\n", | ||
| 426 | 428 | "def\t2.1\t1.4\t5.2\n", | |
| 427 | 429 | "mno\t9.4\t6.6\t6.2\n", | |
| 428 | 430 | "pqr\t1.4\t8.3\t8.4\n", | |
| 429 | 431 | "--------------------------------------------------\n" | |
| 430 | 432 | ] | |
| 431 | 433 | } | |
| 432 | 434 | ], | |
| 433 | - "prompt_number": 11 | ||
| 435 | + "prompt_number": 8 | ||
| 434 | 436 | }, | |
| 435 | 437 | { | |
| 436 | 438 | "cell_type": "markdown", | |
@@ -489,13 +491,13 @@ | |||
| 489 | 491 | " col_index = sorted_csv[0].index(col)\n", | |
| 490 | 492 | " else:\n", | |
| 491 | 493 | " col_index = col\n", | |
| 492 | - " sorted_csv[1][col_index] += marker\n", | ||
| 494 | + " sorted_csv[1][col_index] = str(sorted_csv[1][col_index]) + marker\n", | ||
| 493 | 495 | " return None" | |
| 494 | 496 | ], | |
| 495 | 497 | "language": "python", | |
| 496 | 498 | "metadata": {}, | |
| 497 | 499 | "outputs": [], | |
| 498 | - "prompt_number": 12 | ||
| 500 | + "prompt_number": 9 | ||
| 499 | 501 | }, | |
| 500 | 502 | { | |
| 501 | 503 | "cell_type": "code", | |
@@ -509,29 +511,29 @@ | |||
| 509 | 511 | " (modifies input CSV content list).\n", | |
| 510 | 512 | " \n", | |
| 511 | 513 | " \"\"\"\n", | |
| 512 | - " for c in csv_cont[0][1:]:\n", | ||
| 514 | + " for c in range(1, len(csv_cont[0])):\n", | ||
| 513 | 515 | " mark_minmax(csv_cont, c, mark_max, marker)\n", | |
| 514 | 516 | " marked_csv = sort_by_column(csv_cont, 0, False)\n", | |
| 515 | 517 | " return marked_csv" | |
| 516 | 518 | ], | |
| 517 | 519 | "language": "python", | |
| 518 | 520 | "metadata": {}, | |
| 519 | 521 | "outputs": [], | |
| 520 | - "prompt_number": 13 | ||
| 522 | + "prompt_number": 10 | ||
| 521 | 523 | }, | |
| 522 | 524 | { | |
| 523 | 525 | "cell_type": "code", | |
| 524 | 526 | "collapsed": false, | |
| 525 | 527 | "input": [ | |
| 526 | 528 | "import copy\n", | |
| 529 | + "\n", | ||
| 527 | 530 | "csv_cont = csv_to_list('../Data/test.csv')\n", | |
| 528 | 531 | "\n", | |
| 529 | 532 | "csv_marked = copy.deepcopy(csv_cont)\n", | |
| 530 | - "mark_all_col(csv_marked, mark_max=True, marker='*')\n", | ||
| 531 | - "mark_all_col(csv_marked, mark_max=False, marker='^')\n", | ||
| 533 | + "convert_cells_to_floats(csv_marked)\n", | ||
| 534 | + "mark_all_col(csv_marked, mark_max=False, marker='*')\n", | ||
| 532 | 535 | "print_csv(csv_marked)\n", | |
| 533 | - "\n", | ||
| 534 | - "print('^: min-value\\n*: max-value')" | ||
| 536 | + "print('*: min-value')" | ||
| 535 | 537 | ], | |
| 536 | 538 | "language": "python", | |
| 537 | 539 | "metadata": {}, | |
@@ -542,19 +544,18 @@ | |||
| 542 | 544 | "text": [ | |
| 543 | 545 | "--------------------------------------------------\n", | |
| 544 | 546 | "name\tcolumn1\tcolumn2\tcolumn3\n", | |
| 545 | - "abc\t1.1^\t4.2\t1.2^\n", | ||
| 547 | + "abc\t1.1*\t4.2\t1.2\n", | ||
| 546 | 548 | "def\t2.1\t1.4\t5.2\n", | |
| 547 | - "ghi\t1.5\t1.2\t2.1\n", | ||
| 548 | - "jkl\t1.8\t1.1^\t4.2\n", | ||
| 549 | - "mno\t9.4*\t6.6\t6.2\n", | ||
| 550 | - "pqr\t1.4\t8.3*\t8.4*\n", | ||
| 549 | + "ghi\t1.5\t1.2\t-2.1*\n", | ||
| 550 | + "jkl\t1.8\t-1.1*\t4.2\n", | ||
| 551 | + "mno\t9.4\t6.6\t6.2\n", | ||
| 552 | + "pqr\t1.4\t8.3\t8.4\n", | ||
| 551 | 553 | "--------------------------------------------------\n", | |
| 552 | - "^: min-value\n", | ||
| 553 | - "*: max-value\n" | ||
| 554 | + "*: min-value\n" | ||
| 554 | 555 | ] | |
| 555 | 556 | } | |
| 556 | 557 | ], | |
| 557 | - "prompt_number": 14 | ||
| 558 | + "prompt_number": 12 | ||
| 558 | 559 | }, | |
| 559 | 560 | { | |
| 560 | 561 | "cell_type": "markdown", | |
@@ -603,7 +604,7 @@ | |||
| 603 | 604 | "language": "python", | |
| 604 | 605 | "metadata": {}, | |
| 605 | 606 | "outputs": [], | |
| 606 | - "prompt_number": 15 | ||
| 607 | + "prompt_number": 13 | ||
| 607 | 608 | }, | |
| 608 | 609 | { | |
| 609 | 610 | "cell_type": "markdown", | |
@@ -633,17 +634,17 @@ | |||
| 633 | 634 | "Written CSV file:\n", | |
| 634 | 635 | "--------------------------------------------------\n", | |
| 635 | 636 | "name\tcolumn1\tcolumn2\tcolumn3\n", | |
| 636 | - "abc\t1.1^\t4.2\t1.2^\n", | ||
| 637 | + "abc\t1.1*\t4.2\t1.2\n", | ||
| 637 | 638 | "def\t2.1\t1.4\t5.2\n", | |
| 638 | - "ghi\t1.5\t1.2\t2.1\n", | ||
| 639 | - "jkl\t1.8\t1.1^\t4.2\n", | ||
| 640 | - "mno\t9.4*\t6.6\t6.2\n", | ||
| 641 | - "pqr\t1.4\t8.3*\t8.4*\n", | ||
| 639 | + "ghi\t1.5\t1.2\t-2.1*\n", | ||
| 640 | + "jkl\t1.8\t-1.1*\t4.2\n", | ||
| 641 | + "mno\t9.4\t6.6\t6.2\n", | ||
| 642 | + "pqr\t1.4\t8.3\t8.4\n", | ||
| 642 | 643 | "--------------------------------------------------\n" | |
| 643 | 644 | ] | |
| 644 | 645 | } | |
| 645 | 646 | ], | |
| 646 | - "prompt_number": 16 | ||
| 647 | + "prompt_number": 14 | ||
| 647 | 648 | }, | |
| 648 | 649 | { | |
| 649 | 650 | "cell_type": "code", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments