Return the matrix as a (possibly nested) list. See `ndarray.tolist` for full documentation. See Also -------- ndarray.tolist Examples -------- >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3],
(self)
| 268 | # Necessary because base-class tolist expects dimension |
| 269 | # reduction by x[0] |
| 270 | def tolist(self): |
| 271 | """ |
| 272 | Return the matrix as a (possibly nested) list. |
| 273 | |
| 274 | See `ndarray.tolist` for full documentation. |
| 275 | |
| 276 | See Also |
| 277 | -------- |
| 278 | ndarray.tolist |
| 279 | |
| 280 | Examples |
| 281 | -------- |
| 282 | >>> x = np.matrix(np.arange(12).reshape((3,4))); x |
| 283 | matrix([[ 0, 1, 2, 3], |
| 284 | [ 4, 5, 6, 7], |
| 285 | [ 8, 9, 10, 11]]) |
| 286 | >>> x.tolist() |
| 287 | [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] |
| 288 | |
| 289 | """ |
| 290 | return self.__array__().tolist() |
| 291 | |
| 292 | # To preserve orientation of result... |
| 293 | def sum(self, axis=None, dtype=None, out=None): |