alt solution to exercise 4
Uses nbytes instead of itemsize * size
This commit is contained in:
parent
9be9c8cd23
commit
ee15dec2c7
@ -37,6 +37,9 @@ hint: size, itemsize
|
||||
Z = np.zeros((10,10))
|
||||
print("%d bytes" % (Z.size * Z.itemsize))
|
||||
|
||||
# Simpler alternative
|
||||
print("%d bytes" % Z.nbytes)
|
||||
|
||||
< q5
|
||||
How to get the documentation of the numpy add function from the command line? (★☆☆)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user