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

Method _create_data

numpy/ma/tests/test_core.py:4099–4129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4097
4098class TestMaskedArrayMathMethods:
4099 def _create_data(self):
4100 # Base data definition.
4101 x = np.array([8.375, 7.545, 8.828, 8.5, 1.757, 5.928,
4102 8.43, 7.78, 9.865, 5.878, 8.979, 4.732,
4103 3.012, 6.022, 5.095, 3.116, 5.238, 3.957,
4104 6.04, 9.63, 7.712, 3.382, 4.489, 6.479,
4105 7.189, 9.645, 5.395, 4.961, 9.894, 2.893,
4106 7.357, 9.828, 6.272, 3.758, 6.693, 0.993])
4107 X = x.reshape(6, 6)
4108 XX = x.reshape(3, 2, 2, 3)
4109
4110 m = np.array([0, 1, 0, 1, 0, 0,
4111 1, 0, 1, 1, 0, 1,
4112 0, 0, 0, 1, 0, 1,
4113 0, 0, 0, 1, 1, 1,
4114 1, 0, 0, 1, 0, 0,
4115 0, 0, 1, 0, 1, 0])
4116 mx = array(data=x, mask=m)
4117 mX = array(data=X, mask=m.reshape(X.shape))
4118 mXX = array(data=XX, mask=m.reshape(XX.shape))
4119
4120 m2 = np.array([1, 1, 0, 1, 0, 0,
4121 1, 1, 1, 1, 0, 1,
4122 0, 0, 1, 1, 0, 1,
4123 0, 0, 0, 1, 1, 1,
4124 1, 0, 0, 1, 1, 0,
4125 0, 0, 1, 0, 1, 1])
4126 m2x = array(data=x, mask=m2)
4127 m2X = array(data=X, mask=m2.reshape(X.shape))
4128 m2XX = array(data=XX, mask=m2.reshape(XX.shape))
4129 return x, X, XX, m, mx, mX, mXX, m2x, m2X, m2XX
4130
4131 def test_cumsumprod(self):
4132 # Tests cumsum & cumprod on MaskedArrays.

Callers 5

test_cumsumprodMethod · 0.95
test_ptpMethod · 0.95
test_traceMethod · 0.95
test_dotMethod · 0.95
test_varstdMethod · 0.95

Calls 2

arrayFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected