(self)
| 358 | assert_equal(np.matrix_transpose(arr), tgt) |
| 359 | |
| 360 | def test_var(self): |
| 361 | A = [[1, 2, 3], [4, 5, 6]] |
| 362 | assert_almost_equal(np.var(A), 2.9166666666666665) |
| 363 | assert_almost_equal(np.var(A, 0), np.array([2.25, 2.25, 2.25])) |
| 364 | assert_almost_equal(np.var(A, 1), np.array([0.66666667, 0.66666667])) |
| 365 | |
| 366 | with warnings.catch_warnings(record=True) as w: |
| 367 | warnings.filterwarnings('always', '', RuntimeWarning) |
| 368 | assert_(np.isnan(np.var([]))) |
| 369 | assert_(w[0].category is RuntimeWarning) |
| 370 | |
| 371 | B = np.array([None, 0]) |
| 372 | B[0] = 1j |
| 373 | assert_almost_equal(np.var(B), 0.25) |
| 374 | |
| 375 | def test_std_with_mean_keyword(self): |
| 376 | # Setting the seed to make the test reproducible |
nothing calls this directly
no test coverage detected