arrays - Porting IDL code, lindgen function to Python -
afternoon everyone. i'm porting on idl code python , it's been plain sailing until point far. i'm stuck on section of idl code: nsteps = 266 ind2 = ((lindgen(nsteps+1,nsteps+1)) mod (nsteps+1)) dk2 = (k2arr((ind2+1) < nsteps) - k2arr(ind2-1) > 0)) / 2. my version of includes rewritten lindgen function follows: def pylindgen(shape): nelem = numpy.prod(numpy.array(shape)) out = numpy.arange(nelem,dtype=int) return numpy.reshape(out,shape) ... , ported code k2arr array of shape (267,): ind2 = pylindgen((nsteps+1,nsteps+1)) % (nsteps+1) dk2 = (k2arr[ (ind2+1) < nsteps ] - k2arr[ (ind2-1) > 0. ]) / 2. now, problem code makes ind2 array where, looking @ idl code , errors thrown in python script, i'm sure it's meant scalar. missing feature of these idl functions? any thoughts appreciated. cheers. my knowledge of idl not used be, had research little. operator ">" in idl not equivalent of python (or other la...