擅长:python、mysql、java
<p>以下内容将筛选出在集合<code>keys</code>中具有第一行条目的<code>actions</code>列:</p>
<pre><code>import numpy as np
x = 10
actions = np.random.randint(5, size=(2,x))
print(actions)
keys = np.array([1,2,3])
print(keys)
filtered_actions = actions[:,~np.sum([actions[0,:] == key for key in keys], dtype=bool, axis=0)]
print(filtered_actions)
</code></pre>