0

What would be a numpy function that goes through array a and then output the indexes where values of array b is allocated.

Code:

a = np.array(["BTCUSD", "ETHUSDC", "BBB", "ETHUSD", "cow"])
b=  np.array(["BTCUSD", "ETHUSD"])

Expected output:

Indexes: 0, 3
tony selcuk
  • 709
  • 3
  • 11

1 Answers1

0
phraseIndex = np.where(a == phrase)

w3 Schools

Stack Overflow

NumPy Docs

yeeshue99
  • 238
  • 2
  • 8