#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ENGG1811. Illustrating the numpy ravel and reshape functions """ import numpy as np # %% b = np.array([[ 3, 9, 5, 1], [ 14, 51, 16, 7], [ 12, 39, 47, 11]]) b_flat = np.ravel(b) b_2by6 = np.reshape(b,(2,6)) b_6by2 = np.reshape(b,(6,2)) b_3by4 = np.reshape(b,(3,4)) b_4by3 = np.reshape(b,(4,3)) # You may also want to check out vstack(), hstack()