Reputation: 561
I've got this sentence in Python:
max(xrange(j, n), key=lambda i: abs(m[i][j]))
I know how to implement lambda sentence but don't have any idea how to do the xrange(j, n)
iteration.
Best regards, Szymon
Upvotes: 1
Views: 74
Reputation: 1703
You can define a range similar to matlab, with the colon operator. For example
1:5 # prints range 1 : 5
However, your code would translate to
maximum(map(abs, m))
Upvotes: 3