()
| 4079 | |
| 4080 | @pytest.mark.numpy |
| 4081 | def 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 | |
| 4092 | def create_sample_expressions(): |