3-3-2-6. Create an ndarray

import numpy as np

# Using the Built-in functions you learned about on the
# previous page, create a 4 x 4 ndarray that only
# contains consecutive even numbers from 2 to 32 (inclusive)

X = 

Try creating the same array using the np.linspace() function. The answer is below:

np.linspace(2,32,16).reshape(4,4)

import numpy as np

X = np.arange(2,34,2).reshape(4,4)
%d 블로거가 이것을 좋아합니다: