0
votes

`

import numpy as np

import matplotlib.pyplot as plt

x = np.array([3900.06,3900.16,3900.26])

y = np.array([0.311254,0.588623,0.724301])

if min(y):

print(x[min(y)])`

maybe someone can help me with the following problem: I'm searching for the x point where the point y is at minimum. enter image description here

Thanks, for any kind of help :)

1
Pleas post actual code. not an image of code, so people can copy, test and reproduce it easily. - match
Maybe someone can help you, but first please post the data as text and not as an image. - pault
import numpy as np import matplotlib.pyplot as plt x = np.array([3900.06,3900.16,3900.26]) y = np.array([0.311254,0.588623,0.724301]) if min(y): print(x[min(y)]) - Oswald
x[np.argmin(y)] - aberry

1 Answers

1
votes

Without testing whether or not y has a min (not sure if this is a requirement for the application without more source), using np.argmin():

import numpy as np

x = np.array([3900.06, 3900.16, 3900.26])
y = np.array([0.311254, 0.588623, 0.724301])

print(x[np.argmin(y)])