Mar-05-2020, 02:20 PM
Thanks. How can I tell if size is an integer or a tuple of integers?
Is the number of elements in the tuple corresponds to the dimension of the nd-array? For example if size is a tuple of (x, y), then np.random.randn(*size) generates a 2 dimensional array of x rows and y columns. If size is a tuple of three elements (x, y, z), then np.random.randn(*size) generates a 3 dimensional array of x rows, y columns and z levels?
Is the number of elements in the tuple corresponds to the dimension of the nd-array? For example if size is a tuple of (x, y), then np.random.randn(*size) generates a 2 dimensional array of x rows and y columns. If size is a tuple of three elements (x, y, z), then np.random.randn(*size) generates a 3 dimensional array of x rows, y columns and z levels?