python的combinations_with_replacement这个函数 MMA怎么实现?
mathematica吧
全部回复
仅看楼主
level 7
igs816 楼主
combinations_with_replacement(iterable, r)
返回iterable中所有长度为r的子序列,返回的子序列中的项按输入iterable中的顺序排序,带重复
combinations_with_replacement([1, 2, 3], 2)
输出:
(1, 1)(1, 2)(1, 3)(2, 2)(2, 3)(3, 3)
2017年12月28日 15点12分 1
1