LoginSignup
0
0

More than 1 year has passed since last update.

python numpy 2d array filter

Last updated at Posted at 2023-01-26

keyName = myvalue
keyIdx = 0

import numpy as np

def LookUp(npArr, keyName, keyIdx):
    keyFilter = np.array([keyName])
    res = np.in1d(npArr[:, keyIdx], keyFilter)
    return npArr[res][0]
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0