### compare vectors pairwise

Posted:

**Thu Jul 19, 2018 10:29 am**Hi,

I would like to calculate the area overlapping between two currents curves y1 and y2.

First,I need to select the points of the intersection which are given by all the points of y2(y2<y1) and then y1(y1<y2).

I tryed this:

Psec1 = y1.indwhere("<=", y2)

Psec2 = y2.indwhere("<=", y1)

areaint = dt*Psec1.sum() + dt*Psec2.sum()

but it is not the right command, I know, because the indwhere doesn't want a vector as criterion but a value.

I was thinking to use the apply("func") but how still Can I compare the elements of y1 and y2 pairwise?

Best

I would like to calculate the area overlapping between two currents curves y1 and y2.

First,I need to select the points of the intersection which are given by all the points of y2(y2<y1) and then y1(y1<y2).

I tryed this:

Psec1 = y1.indwhere("<=", y2)

Psec2 = y2.indwhere("<=", y1)

areaint = dt*Psec1.sum() + dt*Psec2.sum()

but it is not the right command, I know, because the indwhere doesn't want a vector as criterion but a value.

I was thinking to use the apply("func") but how still Can I compare the elements of y1 and y2 pairwise?

Best