Deep-ML is a free, open-source machine learning challenge platform. Practice ML coding problems, work with real datasets in labs, and learn through interactive articles.
Please enable JavaScript to use the full platform.
Write a Python function that reshapes a given matrix into a specified shape. if it cant be reshaped return back an empty list []
[]
a = [[1,2,3,4],[5,6,7,8]], new_shape = (4, 2)
[[1, 2], [3, 4], [5, 6], [7, 8]]
The given matrix is reshaped from 2x4 to 4x2.
mmujtabah
StoatScript