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

Method test_sum_axis_behavior

pandas/tests/frame/test_npfuncs.py:31–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

29 tm.assert_frame_equal(result, float_frame.apply(np.sqrt))
30
31 def test_sum_axis_behavior(self):
32 # GH#52042 df.sum(axis=None) now reduces over both axes, which gets
33 # called when we do np.sum(df)
34
35 arr = np.random.default_rng(2).standard_normal((4, 3))
36 df = DataFrame(arr)
37
38 res = np.sum(df)
39 expected = df.to_numpy().sum(axis=None)
40 assert res == expected
41
42 def test_np_ravel(self):
43 # GH26247

Callers

nothing calls this directly

Calls 3

to_numpyMethod · 0.95
DataFrameClass · 0.90
sumMethod · 0.45

Tested by

no test coverage detected