(self)
| 1421 | corrcoef(x, rowvar=False)) |
| 1422 | |
| 1423 | def test_1d_with_missing(self): |
| 1424 | # Test corrcoef 1 1D variable w/missing values |
| 1425 | x = self._create_data()[0] |
| 1426 | x[-1] = masked |
| 1427 | x -= x.mean() |
| 1428 | nx = x.compressed() |
| 1429 | assert_almost_equal(np.corrcoef(nx, rowvar=False), |
| 1430 | corrcoef(x, rowvar=False)) |
| 1431 | try: |
| 1432 | corrcoef(x, allow_masked=False) |
| 1433 | except ValueError: |
| 1434 | pass |
| 1435 | # 2 1D variables w/ missing values |
| 1436 | nx = x[1:-1] |
| 1437 | assert_almost_equal(np.corrcoef(nx, nx[::-1]), corrcoef(x, x[::-1])) |
| 1438 | assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False), |
| 1439 | corrcoef(x, x[::-1], rowvar=False)) |
| 1440 | |
| 1441 | def test_2d_with_missing(self): |
| 1442 | # Test corrcoef on 2D variable w/ missing value |
nothing calls this directly
no test coverage detected