Hi Bastian,
On Sat, Apr 17, 2010 at 11:20 PM, Bastian Weber
<[email protected]> wrote:
<SNIP>
> (Where should I have looked in the documentation to find out by myself?,
> Maybe there are more useful hints.)
The numpy() method you are referring to is in the file
SAGE_ROOT/devel/sage-main/sage/matrix/matrix_real_double_dense.pyx
Unfortunately, at the moment that file is not in the reference manual
[1] so you can't find documentation for numpy() in the reference
manual. However, you could still get the relevant documentation as
demonstrated in the following command line transcript. Notice that the
question mark "?" means to get the documentation of the relevant
method, function, or class.
[mv...@sage ~]$ sage
----------------------------------------------------------------------
| Sage Version 4.3.5, Release Date: 2010-03-28 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: m = matrix()
sage: m.numpy?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in method numpy of
sage.matrix.matrix_integer_dense.Matrix_integer_dense object at
0x8fa320>
Namespace: Interactive
Definition: m.numpy(self, dtype=None)
Docstring:
Return the Numpy matrix associated to this matrix.
INPUT:
* ``dtype`` - The desired data-type for the array. If not given,
then the type will be determined as the minimum type required to
hold the objects in the sequence.
EXAMPLES:
sage: a = matrix(3,range(12))
sage: a.numpy()
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
sage: a.numpy('f')
array([[ 0., 1., 2., 3.],
[ 4., 5., 6., 7.],
[ 8., 9., 10., 11.]], dtype=float32)
sage: a.numpy('d')
array([[ 0., 1., 2., 3.],
[ 4., 5., 6., 7.],
[ 8., 9., 10., 11.]])
sage: a.numpy('B')
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]], dtype=uint8)
Type ``numpy.typecodes`` for a list of the possible typecodes:
sage: import numpy
sage: sorted(numpy.typecodes.items())
[('All', '?bhilqpBHILQPfdgFDGSUVO'), ('AllFloat', 'fdgFDG'),
('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex',
'FDG'), ('Float', 'fdg'), ('Integer', 'bhilqp'), ('UnsignedInteger',
'BHILQP')]
Class Docstring:
<attribute '__doc__' of 'builtin_function_or_method' objects>
[1] http://www.sagemath.org/doc/reference/
--
Regards
Minh Van Nguyen
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org