Verified Commit c894b564 authored by Renato Alves's avatar Renato Alves 🌱
Browse files

Create arrow object

parent 638b7c70
......@@ -145,6 +145,14 @@ e.g. how many dimensions does our array have, and of what size?
This is represented by the `shape` of an array, which denotes the length of the array in each dimension.
e.g. for the toy arrow example above:
~~~
import numpy as np # this is how numpy is traditionally loaded
# Our arrow as displayed in the figure above
arrow = np.array([[255, 255, 255, 0],
[ 0, 255, 0, 255],
[ 0, 0, 255, 255],
[ 0, 0, 0, 255]])
print(arrow.shape)
print(arrow.ndim)
~~~
......@@ -163,7 +171,6 @@ section).
Finally, we might want to calculate some summary statistics for our array like the mean or standard deviation.
~~~
import numpy as np # this is how numpy is traditionally installed
print(np.mean(raw))
print(np.std(raw))
~~~
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment