[Python] How to find points of the x axis corresponding to the values of y equal to some value

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    I have a sine signal defined by two lists

    enter image description here

    and I want to know the points of conductance (s) at which the voltage is 0.5.

    I did it wit this code: voltage = [...] conductance = [...] edges = [] for n in voltage: if n == 0: pass elif voltage[n] > 0.5 and voltage[n-1] < 0.5 : edges.append(conductance[n]) elif voltage[n] < 0.5 and voltage[n-1] > -35. : edges.append(conductance[n])'

    Is there a better or more precise way of doing it? Maybe using some numpy function? Or by intersecating with a horizontal line?

    Continue reading...

Compartilhe esta Página