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

Method test_ragged_ndim_object

numpy/core/tests/test_multiarray.py:1144–1156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1142 return np.array(seq, dtype=object)
1143
1144 def test_ragged_ndim_object(self):
1145 # Lists of mismatching depths are treated as object arrays
1146 a = self._ragged_creation([[1], 2, 3])
1147 assert_equal(a.shape, (3,))
1148 assert_equal(a.dtype, object)
1149
1150 a = self._ragged_creation([1, [2], 3])
1151 assert_equal(a.shape, (3,))
1152 assert_equal(a.dtype, object)
1153
1154 a = self._ragged_creation([1, 2, [3]])
1155 assert_equal(a.shape, (3,))
1156 assert_equal(a.dtype, object)
1157
1158 def test_ragged_shape_object(self):
1159 # The ragged dimension of a list is turned into an object array

Callers

nothing calls this directly

Calls 2

_ragged_creationMethod · 0.95
assert_equalFunction · 0.90

Tested by

no test coverage detected