1
我開始在numpy! 有些numpy的函數可以從另一個數組中搜索一個數組,並返回相似的數組? 謝謝!我如何搜索numpy的大數組陣列
import numpy as np
def searchBinA(B = ['04','22'],A):
result = []
?......? numpy.search(B,A)? "is this correct?"
return result
A = [['03', '04', '18', '22', '25', '29','30'], ['02', '04', '07', '09', '14', '29','30'], \
['06', '08', '11', '13', '17', '19','30'], ['04', '08', '22', '23', '27', '29','30'], \
['03', '05', '15', '22', '24', '25','30']]
print(str(searchBinA()))
output:[['03', '04', '18', '22', '25', '29','30'], ['04', '08', '22', '23', '27', '29','30']]
是各行中的那些元素'了'獨特之處? 'B'中的元素是獨特的嗎? – Divakar
是的!Ais每一行中的每個元素都是獨一無二的!但A中的每一行可能不是唯一的! b中的每個元素也是唯一的! – user4230219