[SciPy-User] equivalent of ind2sub

Keith Goodman kwgoodman at gmail.com
Thu Apr 8 13:48:09 EDT 2010


On Thu, Apr 8, 2010 at 10:23 AM, Anil C R <cr.anil at gmail.com> wrote:
> is there any function which is similar to matlab function ind2sub?

Is it enough to be able to use 1d indexing of a 2d array? You can do that with:

>> x
array([[0, 1, 2],
       [3, 4, 5]])
>> x.flat[0]
   0
>> x.flat[1]
   1
>> x.flat[5]
   5



More information about the SciPy-User mailing list