diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-02-05 12:16:42 -0700 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-02-05 12:16:42 -0700 |
| commit | 9c2e0d2d6d4a59b1a8cc34a98e416f97f67364df (patch) | |
| tree | 21e220973f98def2e38572a29647babcf131bedc /tutorials/3.x_arrays.md | |
| parent | 98f45d4781b2123ca3cc11245282c6353d1c2be6 (diff) | |
restructured tutorial/readme.md to reflect course overview
Diffstat (limited to 'tutorials/3.x_arrays.md')
| -rw-r--r-- | tutorials/3.x_arrays.md | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tutorials/3.x_arrays.md b/tutorials/3.x_arrays.md index 57debfd..e698d67 100644 --- a/tutorials/3.x_arrays.md +++ b/tutorials/3.x_arrays.md @@ -1,5 +1,21 @@ # Arrays +In computer programming, an array is a structure for storing and retrieving data. We often talk about an array as if it were a grid in space, with each cell storing one element of the data. For instance, if each element of the data were a number, we might visualize a “one-dimensional” array like a list: + +| 1 | 5 | 2 | 0 | + +A two-dimensional array would be like a table: + +| 1 | 5 | 2 | 0 | +| 8 | 3 | 6 | 1 | +| 1 | 7 | 2 | 9 | + +A three-dimensional array would be like a set of tables, perhaps stacked as though they were printed on separate pages. + +- From [Numpy documentation](https://numpy.org/doc/2.2/user/absolute_beginners.html) + +--- + In this tutorial we will be introducing arrays and we will be using the numpy library. Arrays, lists, vectors, matrices, sets - You might've heard of them before, they all store data. In programming, an array is a variable that can hold more than one value at a time. We will be using the Numpy python library to create arrays. Since we already have installed Numpy previously, we can start using the package. @@ -9,8 +25,8 @@ When using packages in python, we need to let it know what package we will be us ``` import numpy as np ``` -<code> import numpy </code> specifies what library to import. -<code> as np </code> gives the library an alias in your script. It's common convention in Python programming to make the code shorter and more readable. We will be using *np* as it's a standard using in many projects. +<code> import </code> calls for a library to use, in our case it is Numpy. +<code> as </code> gives the library an alias in your script. It's common convention in Python programming to make the code shorter and more readable. We will be using *np* as it's a standard using in many projects. # Creating arrays Now that the script has been |
