| 262 | assert_equal(a_copy[0, 0], 10) |
| 263 | |
| 264 | def test_order(self): |
| 265 | # It turns out that people rely on np.copy() preserving order by |
| 266 | # default; changing this broke scikit-learn: |
| 267 | # github.com/scikit-learn/scikit-learn/commit/7842748cf777412c506a8c0ed28090711d3a3783 # noqa |
| 268 | a = np.array([[1, 2], [3, 4]]) |
| 269 | assert_(a.flags.c_contiguous) |
| 270 | assert_(not a.flags.f_contiguous) |
| 271 | a_fort = np.array([[1, 2], [3, 4]], order="F") |
| 272 | assert_(not a_fort.flags.c_contiguous) |
| 273 | assert_(a_fort.flags.f_contiguous) |
| 274 | a_copy = np.copy(a) |
| 275 | assert_(a_copy.flags.c_contiguous) |
| 276 | assert_(not a_copy.flags.f_contiguous) |
| 277 | a_fort_copy = np.copy(a_fort) |
| 278 | assert_(not a_fort_copy.flags.c_contiguous) |
| 279 | assert_(a_fort_copy.flags.f_contiguous) |
| 280 | |
| 281 | def test_subok(self): |
| 282 | mx = ma.ones(5) |