Re: [Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread Sebastian Berg
On Mon, 2017-07-10 at 16:16 +0300, eat wrote: > Hi, > > On Mon, Jul 10, 2017 at 3:20 PM, wrote: > > Dear All > > I'm looking in a way to reshape a 2D matrix into a 3D one ; in my > > example I want to move the columns from the 4th to the 8th in the > > 2nd plane  (3rd dimension i guess) > > a =  

Re: [Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread paul . carrico
"Question: Did you try to control the python & numpy versions by creating a virtualenv, or a conda env?" I've just downloaded (ana)conda, but I've to take care first that it does not substitute to current python release working for for other solvers thanks for the information's and the suppor

Re: [Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread Yarko Tymciurak
On Mon, Jul 10, 2017 at 8:46 AM Yarko Tymciurak wrote: > On Mon, Jul 10, 2017 at 8:37 AM wrote: > >> Thanks >> >> >> Nevertheless it does not work for me and I suspect the python/numpy >> releases :-( >> >> The server on which I'm working on is under Contos 7 that uses python 2.7 >> et numpy 1.7

Re: [Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread paul . carrico
Thanks Nevertheless it does not work for me and I suspect the python/numpy releases :-( The server on which I'm working on is under Contos 7 that uses python 2.7 et numpy 1.7 from memory ; I tried to upgrade both of them (plus spyder) but it fails. I didn't want to impact the other solvers in

Re: [Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread eat
Hi, On Mon, Jul 10, 2017 at 3:20 PM, wrote: > Dear All > > I'm looking in a way to reshape a 2D matrix into a 3D one ; in my example > I want to *move the columns from the 4th to the 8th in the 2nd plane* (3rd > dimension i guess) > > a = np.random.rand(5,8); print(a) > > I tried > > a = p.res

[Numpy-discussion] reshape 2D array into 3D

2017-07-10 Thread paul . carrico
Dear All I'm looking in a way to reshape a 2D matrix into a 3D one ; in my example I want to MOVE THE COLUMNS FROM THE 4TH TO THE 8TH IN THE 2ND PLANE (3rd dimension i guess) a = np.random.rand(5,8); print(a) I tried a = p.reshape(d, (2,5,4), ) but it is not what I'm expecting Nota : it

Re: [Numpy-discussion] Reshape 2D array into 3D

2017-07-10 Thread Matthieu Brucher
Hi, This works, but reshape doesn't move data around. What happens is that the data is flattened and then reshaped. If your 5 is not supposed to move, you should create a 2,5,4 array and then copy the two slices by hand, or use transpose (make it 5,4,2 and then transpose to 2,5,4=. Matthieu Le 1

[Numpy-discussion] Reshape 2D array into 3D

2017-07-10 Thread paul . carrico
Dear All I'm looking in a way to reshape a 2D matrix into a 3D one ; in my example I want to MOVE THE COLUMNS FROM THE 4TH TO THE 8TH IN THE 2ND PLANE (3rd dimension i guess) a = np.random.rand(5,8); print(a) I tried a = p.reshape(d, (2,5,4), ) but it is not what I'm expecting Nota : it