I've come across some code where the use of numpy.ravel() is resulting in a 2D array - I've had a look at the documentation, which says that ravel() returns a 1D array (see https://numpy.org/doc/stable/reference/generated/numpy.ravel.html).
Here's a code snippet that shows this:
def jumbo():
import numpy as np
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
matrix = np.zeros((3,3))
matrix.ravel()[:] = my_list
return matrix
new_matrix = jumbo()
print(f"new matrix is:\n{new_matrix}")
I suppose part of what I'm asking is what is the function of the range specifier [:] here?