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

Function test_hypot

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

Source from the content-addressed store, hash-verified

4079
4080@pytest.mark.numpy
4081def test_hypot():
4082 x = np.array([3.0, 0.0, -5.0, 1.5, 7.25])
4083 y = np.array([4.0, 0.0, 12.0, -2.0, 0.0])
4084 result = pc.hypot(pa.array(x), pa.array(y))
4085 np.testing.assert_array_almost_equal(
4086 result.to_numpy(zero_copy_only=False), np.hypot(x, y))
4087
4088 # scalar inputs
4089 assert pc.hypot(pa.scalar(3.0), pa.scalar(4.0)).as_py() == pytest.approx(5.0)
4090
4091
4092def create_sample_expressions():

Callers

nothing calls this directly

Calls 3

as_pyMethod · 0.80
arrayMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected