0
Hi, I’m learning python, I saw the basics and I’m in a problem where I need to do operations between arrays. I have, for example, two arrays of equal dimension D. For each index I in the array, I want to make the difference between the two i-th elements (one of each array) and square, then move to another array in which the product will have the same index I, and then add everything up, take the square root and get the Euclidean distance between the coordinates indicated by the array. The challenge is to do this without using loops. Can someone shed some light on it? And I’d appreciate it if you had some good material on array operations to indicate. Thank you!
Why exactly do you need to do this without loops?
– Woss
Recursiveness would be considered a loop in this case?
– Clayton Tosatti
the module
numpy
has methods for arrays– tomasantunes
@Claytontosatti clear. In any case in fact.
– Onilol