Question from the Python Machine Learning test

Reshape a 2x4 array into a 2x2x2 array in scikit-learn

Easy

Consider vec, an array created like this

vec = numpy.array([[1,2,3,4],[5,6,7,8]])

What is the result of

vec2 = vec.reshape(2,2,2)

?

Author: W3D TeamStatus: PublishedQuestion passed 716 times
Edit
3
Community Evaluations
developer avatar
Subhi Yarmemet
02/10/2024
@Équipe W3D. Bonjour, je pense qu'il manque des virgules entre les éléments dans chaque sous-tableau.