|
99 | 99 | "id": "4a28ab32-78b5-48bb-a962-c01f9ad3eaa2",
|
100 | 100 | "metadata": {},
|
101 | 101 | "source": [
|
102 |
| - "The expression `np.loadtxt(...)` is a function call that asks Python to run the function `loadtxt` which belongs to the `numpy` library. The dot notation in Python is used most of all as an object attribute/property specifier or for invoking its method. `object.property` will give you the object.property value, `object_name.method()` will invoke on object_name method.\n", |
| 102 | + "The expression `np.loadtxt(...)` is a function call that asks Python to run the function `loadtxt` which belongs to the `numpy` library. The dot notation in Python is used most of all as an object attribute/property specifier, or for invoking its method. `object.property` will give you the object.property value, `object_name.method()` will invoke on object_name method.\n", |
103 | 103 | "\n",
|
104 | 104 | "As an example, John Smith is the John that belongs to the Smith family. We could use the dot notation to write his name `smith.john`, just as `loadtxt` is a function that belongs to the `numpy` library.\n",
|
105 | 105 | "\n",
|
|
257 | 257 | "source": [
|
258 | 258 | "The output tells us that the `data` array variable contains 60 rows and 40 columns. When we created the variable `data` to store our arthritis data, we did not only create the array; we also created information about the array, called members or attributes. This extra information describes `data` in the same way an adjective describes a noun. `data.shape` is an attribute of `data` which describes the dimensions of `data`. We use the same dotted notation for the attributes of variables that we use for the functions in libraries because they have the same part-and-whole relationship.\n",
|
259 | 259 | "\n",
|
260 |
| - "If we want to get a single number from the array, we must provide an index in square brackets after the variable name, just as we do in math when referring to an element of a matrix. Our inflammation data has two dimensions, so we will need to use two indices to refer to one specific value:" |
| 260 | + "If we want to get a single number from the array, we must provide an index in square brackets after the variable name, just as we do in maths when referring to an element of a matrix. Our inflammation data has two dimensions, so we will need to use two indices to refer to one specific value:" |
261 | 261 | ]
|
262 | 262 | },
|
263 | 263 | {
|
|
355 | 355 | "id": "6fe8654d-647b-45b0-8f9e-a5ed2061dfd7",
|
356 | 356 | "metadata": {},
|
357 | 357 | "source": [
|
358 |
| - "The slice `0:4` means, \"Start at index 0 and go up to, but not including, index 4\". Again, the up-to-but-not including takes a bit of getting used to, but the rule is that the difference between the upper and lower bounds is the number of values in the slice.\n", |
| 358 | + "The slice `0:4` means, \"Start at index 0 and go up to, but not including, index 4\". Again, the up-to-but-not-including takes a bit of getting used to, but the rule is that the difference between the upper and lower bounds is the number of values in the slice.\n", |
359 | 359 | "\n",
|
360 | 360 | "We don't have to start slices at 0:"
|
361 | 361 | ]
|
|
455 | 455 | "\n",
|
456 | 456 | "## Not All Functions Have Input\n",
|
457 | 457 | "\n",
|
458 |
| - "Generally, a function uses inputs to produce outputs.However, some functions produce outputs without\n", |
| 458 | + "Generally, a function uses inputs to produce outputs. However, some functions produce outputs without\n", |
459 | 459 | "needing any input. For example, checking the current time doesn't require any input."
|
460 | 460 | ]
|
461 | 461 | },
|
|
808 | 808 | "metadata": {},
|
809 | 809 | "source": [
|
810 | 810 | "## Thin Slices\n",
|
811 |
| - "The expression `element[3:3]` produces an empty string, i.e., a string that contains no characters. If `data` holds our array of patient data, what does `data[3:3, 4:4]` produce?What about `data[3:3, :]`?" |
| 811 | + "The expression `element[3:3]` produces an empty string, i.e., a string that contains no characters. If `data` holds our array of patient data, what does `data[3:3, 4:4]` produce? What about `data[3:3, :]`?" |
812 | 812 | ]
|
813 | 813 | },
|
814 | 814 | {
|
|
955 | 955 | "id": "72bcfd3a-bf13-4a28-b161-b84fe58ddd4c",
|
956 | 956 | "metadata": {},
|
957 | 957 | "source": [
|
958 |
| - "alling `np.diff(patient3_week1)` would do the following calculations and return the 6 difference values in a new array." |
| 958 | + "Calling `np.diff(patient3_week1)` would do the following calculations and return the 6 difference values in a new array." |
959 | 959 | ]
|
960 | 960 | },
|
961 | 961 | {
|
|
1104 | 1104 | "name": "python",
|
1105 | 1105 | "nbconvert_exporter": "python",
|
1106 | 1106 | "pygments_lexer": "ipython3",
|
1107 |
| - "version": "3.12.2" |
| 1107 | + "version": "3.9.19" |
1108 | 1108 | }
|
1109 | 1109 | },
|
1110 | 1110 | "nbformat": 4,
|
|
0 commit comments