| 314 | assert_equal(a_copy[0, 0], 10) |
| 315 | |
| 316 | def test_order(self): |
| 317 | # It turns out that people rely on np.copy() preserving order by |
| 318 | # default; changing this broke scikit-learn: |
| 319 | # github.com/scikit-learn/scikit-learn/commit/7842748 |
| 320 | a = np.array([[1, 2], [3, 4]]) |
| 321 | assert_(a.flags.c_contiguous) |
| 322 | assert_(not a.flags.f_contiguous) |
| 323 | a_fort = np.array([[1, 2], [3, 4]], order="F") |
| 324 | assert_(not a_fort.flags.c_contiguous) |
| 325 | assert_(a_fort.flags.f_contiguous) |
| 326 | a_copy = np.copy(a) |
| 327 | assert_(a_copy.flags.c_contiguous) |
| 328 | assert_(not a_copy.flags.f_contiguous) |
| 329 | a_fort_copy = np.copy(a_fort) |
| 330 | assert_(not a_fort_copy.flags.c_contiguous) |
| 331 | assert_(a_fort_copy.flags.f_contiguous) |
| 332 | |
| 333 | def test_subok(self): |
| 334 | mx = ma.ones(5) |