MCPcopy Index your code
hub / github.com/numpy/numpy / test_keepdims_out

Method test_keepdims_out

numpy/lib/tests/test_function_base.py:3783–3796  ·  view source on GitHub ↗
(self, q, axis)

Source from the content-addressed store, hash-verified

3781 ]
3782 )
3783 def test_keepdims_out(self, q, axis):
3784 d = np.ones((3, 5, 7, 11))
3785 if axis is None:
3786 shape_out = (1,) * d.ndim
3787 else:
3788 axis_norm = normalize_axis_tuple(axis, d.ndim)
3789 shape_out = tuple(
3790 1 if i in axis_norm else d.shape[i] for i in range(d.ndim))
3791 shape_out = np.shape(q) + shape_out
3792
3793 out = np.empty(shape_out)
3794 result = np.percentile(d, q, axis=axis, keepdims=True, out=out)
3795 assert result is out
3796 assert_equal(result.shape, shape_out)
3797
3798 def test_out(self):
3799 o = np.zeros((4,))

Callers

nothing calls this directly

Calls 3

normalize_axis_tupleFunction · 0.90
assert_equalFunction · 0.90
shapeMethod · 0.45

Tested by

no test coverage detected