Hi guys,
I have 2 short numpyrelated questions. In numpy, if one can invert an arbitrary array arr along a given axis using the syntax arr[::1,...] What is the equivalent idiom in Julia? The other issue is, how can I truncate an array between a lower and upper bound? In numpy, this is easily done with np.clip: http://docs.scipy.org/doc/numpy/reference/generated/numpy.clip.html Tnx! A 
Check out `clamp` for your second question: http://docs.julialang.org/en/latest/stdlib/base/#Base.clamp On Wed, Jul 23, 2014 at 10:07 AM, Andrei Berceanu <[hidden email]> wrote:

In reply to this post by Andrei Berceanu
On Wednesday, July 23, 2014 10:07:20 AM UTC4, Andrei Berceanu wrote:
And with regards to this, I think you're after `flipdim` — http://docs.julialang.org/en/latest/stdlib/base/#Base.flipdim There's also the Matlablike names flipud and fliplr for the first two axes (up/down and left/right). 
In reply to this post by Andrei Berceanu
A[end:1:1, ...]
On Wednesday, July 23, 2014 07:07:20 AM Andrei Berceanu wrote: > Hi guys, > > I have 2 short numpyrelated questions. > > In numpy, if one can invert an arbitrary array *arr* along a given axis > using the syntax > > *arr[::1,...]* > > What is the equivalent idiom in Julia? > > The other issue is, how can I truncate an array between a lower and upper > bound? > In numpy, this is easily done with np.clip: > > http://docs.scipy.org/doc/numpy/reference/generated/numpy.clip.html > > Tnx! > A 
Thanks guys, works like a charm!
A On Wednesday, July 23, 2014 4:32:56 PM UTC+2, Tim Holy wrote: A[end:1:1, ...] 
You can also write that range as `end:1:1` in Julia (similar to Matlab). On Wed, Jul 23, 2014 at 8:14 AM, Andrei Berceanu <[hidden email]> wrote:

Free forum by Nabble  Edit this page 