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

Method _create_data

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

Source from the content-addressed store, hash-verified

3294class TestMaskedArrayMethods:
3295 # Test class for miscellaneous MaskedArrays methods.
3296 def _create_data(self):
3297 # Base data definition.
3298 x = np.array([8.375, 7.545, 8.828, 8.5, 1.757, 5.928,
3299 8.43, 7.78, 9.865, 5.878, 8.979, 4.732,
3300 3.012, 6.022, 5.095, 3.116, 5.238, 3.957,
3301 6.04, 9.63, 7.712, 3.382, 4.489, 6.479,
3302 7.189, 9.645, 5.395, 4.961, 9.894, 2.893,
3303 7.357, 9.828, 6.272, 3.758, 6.693, 0.993])
3304 X = x.reshape(6, 6)
3305 XX = x.reshape(3, 2, 2, 3)
3306
3307 m = np.array([0, 1, 0, 1, 0, 0,
3308 1, 0, 1, 1, 0, 1,
3309 0, 0, 0, 1, 0, 1,
3310 0, 0, 0, 1, 1, 1,
3311 1, 0, 0, 1, 0, 0,
3312 0, 0, 1, 0, 1, 0])
3313 mx = array(data=x, mask=m)
3314 mX = array(data=X, mask=m.reshape(X.shape))
3315 mXX = array(data=XX, mask=m.reshape(XX.shape))
3316
3317 m2 = np.array([1, 1, 0, 1, 0, 0,
3318 1, 1, 1, 1, 0, 1,
3319 0, 0, 1, 1, 0, 1,
3320 0, 0, 0, 1, 1, 1,
3321 1, 0, 0, 1, 1, 0,
3322 0, 0, 1, 0, 1, 1])
3323 m2x = array(data=x, mask=m2)
3324 m2X = array(data=X, mask=m2.reshape(X.shape))
3325 m2XX = array(data=XX, mask=m2.reshape(XX.shape))
3326 return x, X, XX, m, mx, mX, mXX, m2x, m2X, m2XX
3327
3328 def test_generic_methods(self):
3329 # Tests some MaskedArray methods.

Callers 1

test_argmax_argminMethod · 0.95

Calls 2

arrayFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected