You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
that asks Python to run the [function]({{ page.root }}/reference.html#function) `loadtxt` which
72
71
belongs to the `numpy` library.
73
-
This [dotted notation]({{ page.root }}/reference.html#dotted-notation)
74
-
is used everywhere in Python: the thing that appears before the dot contains the thing that
75
-
appears after.
72
+
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,
73
+
`object_name.method()` will invoke on object_name method.
76
74
77
75
As an example, John Smith is the John that belongs to the Smith family.
78
76
We could use the dot notation to write his name `smith.john`,
@@ -205,16 +203,16 @@ first value in data: 0.0
205
203
{: .output}
206
204
207
205
~~~
208
-
print('middle value in data:', data[30, 20])
206
+
print('middle value in data:', data[29, 19])
209
207
~~~
210
208
{: .language-python}
211
209
212
210
~~~
213
-
middle value in data: 13.0
211
+
middle value in data: 16.0
214
212
~~~
215
213
{: .output}
216
214
217
-
The expression `data[30, 20]` accesses the element at row 30, column 20. While this expression may
215
+
The expression `data[29, 19]` accesses the element at row 30, column 20. While this expression may
218
216
not surprise you,
219
217
`data[0, 0]` might.
220
218
Programming languages like Fortran, MATLAB and R start counting at 1
@@ -411,11 +409,6 @@ maximum inflammation for patient 0: 18.0
411
409
~~~
412
410
{: .output}
413
411
414
-
Everything in a line of code following the '#' symbol is a
415
-
[comment]({{ page.root }}/reference.html#comment) that is ignored by Python.
416
-
Comments allow programmers to leave explanatory notes for other
417
-
programmers or their future selves.
418
-
419
412
We don't actually need to store the row in a variable of its own.
420
413
Instead, we can combine the selection and the function call:
0 commit comments