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
  Issues with Shape/Reshape for CNN moddy10 0 1,428 Oct-12-2021, 03:54 PM
Last Post: moddy10
  [pandas] How to reshape the list Mekala 6 7,258 Jul-26-2020, 12:49 AM
Last Post: Mekala
  cannot reshape array of size 0 into shape Roro 2 6,195 Jun-14-2020, 11:28 AM
Last Post: Roro
  Simple numpy reshape error wih contour3D AdeIsHere 0 2,150 Sep-17-2019, 12:01 PM
Last Post: AdeIsHere
  'list' object has no attribute 'reshape' SamSoftwareLtd 1 15,480 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