Re: [Numpy-discussion] Generalized rectangle intersection. (Was: Array blitting)

2017-07-10 Thread Mikhail V
On 10 July 2017 at 10:34, Jerome Kieffer wrote: > On Sun, 9 Jul 2017 23:35:58 +0200 > Mikhail V wrote: > >> disclaimer: I am not a past contributor to numpy and I don't know >> much about github, and what pull request means. So I just put the >> examples here. >> >> So in short, the proposal idea

Re: [Numpy-discussion] Generalized rectangle intersection. (Was: Array blitting)

2017-07-10 Thread Stefan van der Walt
On Mon, Jul 10, 2017, at 01:34, Jerome Kieffer wrote: > On Sun, 9 Jul 2017 23:35:58 +0200 > Mikhail V wrote: > > > disclaimer: I am not a past contributor to numpy and I don't know > > much about github, and what pull request means. So I just put the > > examples here. > > > > So in short, the p

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

Re: [Numpy-discussion] Generalized rectangle intersection. (Was: Array blitting)

2017-07-10 Thread Jerome Kieffer
On Sun, 9 Jul 2017 23:35:58 +0200 Mikhail V wrote: > disclaimer: I am not a past contributor to numpy and I don't know > much about github, and what pull request means. So I just put the > examples here. > > So in short, the proposal idea is to add a library function which > calculates the inter