Skip to content

Commit

Permalink
rectify the test for numpy.typecodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Jun 24, 2024
1 parent 9ff008b commit 2092f81
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/sage/matrix/matrix1.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
Type ``numpy.typecodes`` for a list of the possible
typecodes::
sage: import numpy # needs numpy
sage: sorted(numpy.typecodes.items()) # needs numpy
sage: import numpy # needs numpy
sage: numpy.typecodes.items() # needs numpy # random
[('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
('UnsignedInteger', 'BHILQP')]
...
For instance, you can see possibilities for real floating point numbers::
sage: numpy.typecodes['Float'] # needs numpy
'efdg'
Alternatively, numpy automatically calls this function (via
the magic :meth:`__array__` method) to convert Sage matrices
Expand Down

0 comments on commit 2092f81

Please sign in to comment.