Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从整数间隔生成特定长度的所有可能序列。(np.arange(start,end)) 如果它只是一组特定长度的子多集,我可以选择: https ://stackoverflow.com/a/4941846/257640 我不确定它是否会成为最有效率的。
所以“subseq”函数将是这样的:
subseq(np.arange(1,4),2)
应该返回:
[[1,1], [1,2], [1,3], [2,2], [2,3], [3,3]]
谢谢你。