On Tuesday, April 5, 2016 at 3:36:09 PM UTC+2, Gabriel Gellner wrote:
>
> you can do the python example as:
>
> a[[1, 4] + range(7, 17, 2)]
> (ignoring the issues that this is not the same range as julia since python 
> uses 0-based indices ...)
>

Thanks. I'm getting an error, though:

TypeError: can only concatenate list (not "range") to list

I assume you are using Python 2.7, while I'm at 3.5. But still, this helps. 
It seems I can do:

a[[1, 4] + list(range(7, 17, 2))]

which is a real improvement.

As to the overall topic I don't think it is fair to have to poo-poo python 
> to also feel that julia does it well. I really like both. 
>

I really don't like poo-pooing of python, but I think it's a response to 
some pretty unreasonable criticism from the OP. In my newbie opinion, array 
indexing is an area where Julia shines, much more so than NumPy.

Reply via email to