| 1178 | assert_(type(dat.nonzero()[1]) is np.ndarray) |
| 1179 | |
| 1180 | def test_recarray_tolist(self): |
| 1181 | # Ticket #793, changeset r5215 |
| 1182 | # Comparisons fail for NaN, so we can't use random memory |
| 1183 | # for the test. |
| 1184 | buf = np.zeros(40, dtype=np.int8) |
| 1185 | a = np.recarray(2, formats="i4,f8,f8", names="id,x,y", buf=buf) |
| 1186 | b = a.tolist() |
| 1187 | assert_( a[0].tolist() == b[0]) |
| 1188 | assert_( a[1].tolist() == b[1]) |
| 1189 | |
| 1190 | def test_nonscalar_item_method(self): |
| 1191 | # Make sure that .item() fails graciously when it should |