To improve the execution time, I replaced a comprehension list with a condition in with np.where(). It works fine where the value matches but i want to have a condition where the value is in the string not equal:
import numpy as np
currencies = np.array(["USD","NZL","EUR","KWR"])
currencie = [x for x in list(currencies) if x in "USDKLR EUR"]
#returns ["USD","EUR"]
#What works:
currencie = currencies[np.where(currencies == "EUR")]
#returns ["EUR"]
What I want is the in condition but using np.where or numpy function, no list treatement.
currencie = currencies[np.where(currencies in "USDKLR EUR")]