MCPcopy Create free account
hub / github.com/apache/arrow / test_tdigest

Function test_tdigest

python/pyarrow/tests/test_compute.py:3508–3523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3506
3507
3508def test_tdigest():
3509 arr = pa.array([1, 2, 3, 4])
3510 result = pc.tdigest(arr)
3511 assert result.to_pylist() == [2.5]
3512
3513 arr = pa.chunked_array([pa.array([1, 2]), pa.array([3, 4])])
3514 result = pc.tdigest(arr)
3515 assert result.to_pylist() == [2.5]
3516
3517 arr = pa.array([1, 2, 3, 4])
3518 result = pc.tdigest(arr, q=[0, 0.5, 1])
3519 assert result.to_pylist() == [1, 2.5, 4]
3520
3521 arr = pa.chunked_array([pa.array([1, 2]), pa.array([3, 4])])
3522 result = pc.tdigest(arr, [0, 0.5, 1]) # positional `q`
3523 assert result.to_pylist() == [1, 2.5, 4]
3524
3525
3526def test_fill_null_segfault():

Callers

nothing calls this directly

Calls 2

chunked_arrayMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected