|
27 | 27 | },
|
28 | 28 | {
|
29 | 29 | "cell_type": "code",
|
30 |
| - "execution_count": 1, |
| 30 | + "execution_count": 4, |
31 | 31 | "metadata": {},
|
32 | 32 | "outputs": [],
|
33 | 33 | "source": [
|
|
116 | 116 | }
|
117 | 117 | ],
|
118 | 118 | "source": [
|
119 |
| - "# Create an array filled with 1 values\n", |
| 119 | + "# Create an array filled with 0 values\n", |
120 | 120 | "np.zeros((2, 3))"
|
121 | 121 | ]
|
122 | 122 | },
|
|
138 | 138 | }
|
139 | 139 | ],
|
140 | 140 | "source": [
|
141 |
| - "# Create an array filled with 0 values\n", |
| 141 | + "# Create an array filled with 1 values\n", |
142 | 142 | "np.ones((2, 3))"
|
143 | 143 | ]
|
144 | 144 | },
|
|
542 | 542 | ]
|
543 | 543 | },
|
544 | 544 | {
|
545 |
| - "attachments": {}, |
546 | 545 | "cell_type": "markdown",
|
547 | 546 | "metadata": {},
|
548 | 547 | "source": [
|
|
556 | 555 | },
|
557 | 556 | {
|
558 | 557 | "cell_type": "code",
|
559 |
| - "execution_count": 21, |
| 558 | + "execution_count": 5, |
560 | 559 | "metadata": {},
|
561 | 560 | "outputs": [
|
562 | 561 | {
|
|
565 | 564 | "array([5, 6, 7])"
|
566 | 565 | ]
|
567 | 566 | },
|
568 |
| - "execution_count": 21, |
| 567 | + "execution_count": 5, |
569 | 568 | "metadata": {},
|
570 | 569 | "output_type": "execute_result"
|
571 | 570 | }
|
|
579 | 578 | },
|
580 | 579 | {
|
581 | 580 | "cell_type": "code",
|
582 |
| - "execution_count": 22, |
| 581 | + "execution_count": 6, |
583 | 582 | "metadata": {},
|
584 | 583 | "outputs": [
|
585 | 584 | {
|
|
588 | 587 | "array([5, 6, 7])"
|
589 | 588 | ]
|
590 | 589 | },
|
591 |
| - "execution_count": 22, |
| 590 | + "execution_count": 6, |
592 | 591 | "metadata": {},
|
593 | 592 | "output_type": "execute_result"
|
594 | 593 | }
|
|
602 | 601 | "cell_type": "markdown",
|
603 | 602 | "metadata": {},
|
604 | 603 | "source": [
|
605 |
| - "NumPy provides basic mathematical and statistical functions like mean, min, max, sum, prod, std, var, summation across different axes, transposing of a matrix, etc.\n", |
606 |
| - "\n", |
| 604 | + "NumPy provides basic mathematical and statistical functions like mean, min, max, sum, prod, std, var, summation across different axes, transposing of a matrix, etc." |
| 605 | + ] |
| 606 | + }, |
| 607 | + { |
| 608 | + "cell_type": "code", |
| 609 | + "execution_count": 15, |
| 610 | + "metadata": {}, |
| 611 | + "outputs": [ |
| 612 | + { |
| 613 | + "name": "stdout", |
| 614 | + "output_type": "stream", |
| 615 | + "text": [ |
| 616 | + "mean: 6.0\n", |
| 617 | + "std: 0.816496580927726\n", |
| 618 | + "sum: 18\n", |
| 619 | + "var: 0.6666666666666666\n", |
| 620 | + "min: 5\n", |
| 621 | + "max: 7\n" |
| 622 | + ] |
| 623 | + } |
| 624 | + ], |
| 625 | + "source": [ |
| 626 | + "c = a + b\n", |
| 627 | + "print(\"mean: %s\" % c.mean())\n", |
| 628 | + "print(\"std: %s\" % c.std())\n", |
| 629 | + "print(\"sum: %s\" % c.sum())\n", |
| 630 | + "print(\"var: %s\" % c.var())\n", |
| 631 | + "print(\"min: %s\" % c.min())\n", |
| 632 | + "print(\"max: %s\" % c.max())" |
| 633 | + ] |
| 634 | + }, |
| 635 | + { |
| 636 | + "cell_type": "markdown", |
| 637 | + "metadata": {}, |
| 638 | + "source": [ |
607 | 639 | "A particular NumPy feature of interest is solving a system of linear equations. NumPy has a function to solve linear equations. \n",
|
608 | 640 | "For example these linear equations \n",
|
609 | 641 | "\n",
|
|
4753 | 4785 | "name": "python",
|
4754 | 4786 | "nbconvert_exporter": "python",
|
4755 | 4787 | "pygments_lexer": "ipython2",
|
4756 |
| - "version": "2.7.15" |
| 4788 | + "version": "2.7.15rc1" |
4757 | 4789 | }
|
4758 | 4790 | },
|
4759 | 4791 | "nbformat": 4,
|
|
0 commit comments