SyntaxFix
Write A Post
Hire A Developer
Questions
In [14]: b = np.reshape(a, (np.product(a.shape),)) In [15]: b Out[15]: array([1, 2, 3, 4, 5, 6])
or, simply:
In [16]: a.flatten() Out[16]: array([1, 2, 3, 4, 5, 6])