MCPcopy
hub / github.com/pandas-dev/pandas / test_take_axis_0

Method test_take_axis_0

pandas/tests/test_take.py:216–225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 tm.assert_almost_equal(result, expected)
215
216 def test_take_axis_0(self):
217 arr = np.arange(12).reshape(4, 3)
218 result = algos.take(arr, [0, -1])
219 expected = np.array([[0, 1, 2], [9, 10, 11]])
220 tm.assert_numpy_array_equal(result, expected)
221
222 # allow_fill=True
223 result = algos.take(arr, [0, -1], allow_fill=True, fill_value=0)
224 expected = np.array([[0, 1, 2], [0, 0, 0]])
225 tm.assert_numpy_array_equal(result, expected)
226
227 def test_take_axis_1(self):
228 arr = np.arange(12).reshape(4, 3)

Callers

nothing calls this directly

Calls 3

reshapeMethod · 0.45
takeMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected