Python Forum
reshape from 3D to 3D matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reshape from 3D to 3D matrix
#1
Hi

In the following example, I'm still trying to find a way to reshape the 2D matrix into a 3D one:
  • the columns remain unchaged
  • they are moved in depth column 1 moves to (1, x, x), column 2 moves to (2, x, x) and so on


But is reshape the best tool?

Thanks for any advice

Paul
n = 100
m = 10
# order = 'C' => in line
# order = 'F' => in columns
A = np.arange(n*m).reshape( (n, m), order='F') 
B = np.reshape(A, (10,n,1), order='F')
C = np.reshape(A, (10,n,1), order='C')
D = np.reshape(A, (10,n,1), order='A')
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [pandas] How to reshape the list Mekala 6 943 Jul-26-2020, 12:49 AM
Last Post: Mekala
  cannot reshape array of size 0 into shape Roro 2 2,233 Jun-14-2020, 11:28 AM
Last Post: Roro
  Simple numpy reshape error wih contour3D AdeIsHere 0 684 Sep-17-2019, 12:01 PM
Last Post: AdeIsHere
  'list' object has no attribute 'reshape' SamSoftwareLtd 1 9,478 Nov-04-2018, 10:38 PM
Last Post: stullis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020