函数模式 #
计算一组数字或包含值(数字或字符)的列表的模式。如果存在多个模式,则返回这些值的列表。
Syntax #
math.mode(a, b, c, ...)
math.mode(A)
Parameters #
| Parameter | Type | Description |
|---|---|---|
args |
… * | 单个矩阵 |
Returns #
| Type | Description |
|---|---|
| * | 所有值的模式 |
Throws #
Type | Description —- | ———–
Examples #
math.mode(2, 1, 4, 3, 1) // returns [1]
math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]
math.mode(1, 4, 6, 1, 6) // returns [1, 6]
math.mode('a','a','b','c') // returns ["a"]
math.mode(1, 1.5, 'abc') // returns [1, 1.5, "abc"]