| 1 | initial version |
It's quite straightforward:
[a for a in A if all(a[j]==1 for j in B)]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.