MathTop

permute_by 函数

按照排列给出的一基位置重新排列列表。

语法

  • permute_by(list, permutation)
  • apply_permutation(list, permutation)

参数与选项

list形如 [1, 2, 3] 的列表字面量。
permutation用于重新排列列表的一基位置序列。

示例

  1. 应用排列permute_by([a, b, c], [3, 1, 2])返回 [c, a, b]。