Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

NumPy multidimensional arrays are easy! 🧊

30.6K views on YouTube

#coding #python #numpy

import numpy as np

array = np.array([[[‘A’, ‘B’, ‘C’], [‘D’, ‘E’, ‘F’], [‘G’, ‘H’, ‘I’]],
[[‘J’, ‘K’, ‘L’], [‘M’, ‘N’, ‘O’], [‘P’, ‘Q’, ‘R’]],
[[‘S’, ‘T’, ‘U’], [‘V’, ‘W’, ‘X’], [‘Y’, ‘Z’, ‘ ‘]]])

print(array.ndim) #returns number of dimensions
print(array.shape) #returns a tuple of integers that represent the shape

word = array[0, 0, 0] + array[2, 0, 0] + array[2, 0, 0]

print(word)