Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bio-IT Workshops
Intermediate Python
Commits
c894b564
Verified
Commit
c894b564
authored
Jul 08, 2020
by
Renato Alves
🌱
Browse files
Create arrow object
parent
638b7c70
Changes
1
Hide whitespace changes
Inline
Side-by-side
_episodes/02-data.md
View file @
c894b564
...
...
@@ -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))
~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment