I have 3 images, and i store them in a list C.
from sklearn.datasets import load_sample_images
datasets = load_sample_images()
image1 = [datasets.images[1][:,:,0],datasets.images[1][:,:,0],datasets.images[0][:,:,0]]
# datasets.images[1][:,:,0] is a Numpy array
For some reason, i want to flatten each of them. and stored the result in a NumPy array. My solution is
result = np.array([item.flatten() for item in image1])
Is there any better solution?