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

Function test_winsorize

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

Source from the content-addressed store, hash-verified

4510
4511
4512def test_winsorize():
4513 arr = pa.array([10, 4, 9, 8, 5, 3, 7, 2, 1, 6])
4514
4515 result = pc.winsorize(arr, 0.1, 0.8)
4516 assert result.to_pylist() == [8, 4, 8, 8, 5, 3, 7, 2, 2, 6]
4517
4518 result = pc.winsorize(
4519 arr, options=pc.WinsorizeOptions(lower_limit=0.1, upper_limit=0.8))
4520 assert result.to_pylist() == [8, 4, 8, 8, 5, 3, 7, 2, 2, 6]

Callers

nothing calls this directly

Calls 2

WinsorizeOptionsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected