Shortcuts

torcharrow.functional.get_max_count

torcharrow.functional.get_max_count(input_ids: ListColumn, matching_ids: ListColumn)

如果 input_ids 和 matching_ids 之间存在重叠项,则将重叠 id 的最大实例数贡献给最大计数。

Parameters:
  • input_ids (第一个ID列表) –

  • matching_ids (第二个ID列表) –

示例

>>> import torcharrow as ta
>>> from torcharrow import functional
>>> input_ids = ta.column([[1, 1, 2, 3],[5,8],[13]])
>>> matching_ids = ta.column([[1,2,3],[2,3],[13,13,13,13,13]])
>>> functional.get_max_count(input_ids, matching_ids)
0  4
1  0
2  5
dtype: Float32(nullable=True), length: 3, null_count: 0