MCPcopy Create free account
hub / github.com/numpy/numpy / _zeros

Method _zeros

numpy/core/tests/test_multiarray.py:1737–1744  ·  view source on GitHub ↗
(shape, dtype=str)

Source from the content-addressed store, hash-verified

1735class TestZeroSizeFlexible:
1736 @staticmethod
1737 def _zeros(shape, dtype=str):
1738 dtype = np.dtype(dtype)
1739 if dtype == np.void:
1740 return np.zeros(shape, dtype=(dtype, 0))
1741
1742 # not constructable directly
1743 dtype = np.dtype([('x', dtype, 0)])
1744 return np.zeros(shape, dtype=dtype)['x']
1745
1746 def test_create(self):
1747 zs = self._zeros(10, bytes)

Callers 6

test_createMethod · 0.95
_test_sort_partitionMethod · 0.95
test_resizeMethod · 0.95
test_viewMethod · 0.95
test_dumpsMethod · 0.95
test_pickleMethod · 0.95

Calls 1

dtypeMethod · 0.45

Tested by

no test coverage detected