# [Numpy-svn] r8585 - in branches/1.5.x/numpy: . matrixlib

numpy-svn@scip... numpy-svn@scip...
Sun Aug 1 06:22:14 CDT 2010

```Author: rgommers
Date: 2010-08-01 06:22:14 -0500 (Sun, 01 Aug 2010)
New Revision: 8585

Modified:
branches/1.5.x/numpy/matrixlib/__init__.py
branches/1.5.x/numpy/matrixlib/defmatrix.py
Log:
DOC: wiki merge, matrlixlib and some ndarray methods.

===================================================================
--- branches/1.5.x/numpy/add_newdocs.py	2010-08-01 11:21:57 UTC (rev 8584)
+++ branches/1.5.x/numpy/add_newdocs.py	2010-08-01 11:22:14 UTC (rev 8585)
@@ -2748,7 +2748,7 @@
"""
a.put(indices, values, mode='raise')

-    Set a.flat[n] = values[n] for all n in indices.
+    Set ``a.flat[n] = values[n]`` for all `n` in indices.

Refer to `numpy.put` for full documentation.

@@ -2942,7 +2942,7 @@
"""
a.round(decimals=0, out=None)

-    Return an array rounded a to the given number of decimals.
+    Return `a` with each element rounded to the given number of decimals.

Refer to `numpy.around` for full documentation.

@@ -3208,7 +3208,7 @@
"""
a.take(indices, axis=None, out=None, mode='raise')

-    Return an array formed from the elements of a at the given indices.
+    Return an array formed from the elements of `a` at the given indices.

Refer to `numpy.take` for full documentation.

@@ -3418,24 +3418,26 @@

Parameters
----------
-    dtype : data-type
-        Data-type descriptor of the returned view, e.g. float32 or int16.
-    type : python type
-        Type of the returned view, e.g. ndarray or matrix.
+    dtype : data-type, optional
+        Data-type descriptor of the returned view, e.g., float32 or int16.
+        The default, None, results in the view having the same data-type
+        as `a`.
+    type : Python type, optional
+        Type of the returned view, e.g., ndarray or matrix.  Again, the
+        default None results in type preservation.

-
Notes
-----
+    ``a.view()`` is used two different ways:

-    `a.view()` is used two different ways.
-
-    `a.view(some_dtype)` or `a.view(dtype=some_dtype)` constructs a view of
-    the array's memory with a different dtype. This can cause a
+    ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
+    of the array's memory with a different data-type.  This can cause a
reinterpretation of the bytes of memory.

-    `a.view(ndarray_subclass)`, or `a.view(type=ndarray_subclass)`, just
-    returns an instance of ndarray_subclass that looks at the same array (same
-    shape, dtype, etc.). This does not cause a reinterpretation of the memory.
+    ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
+    returns an instance of `ndarray_subclass` that looks at the same array
+    (same shape, dtype, etc.)  This does not cause a reinterpretation of the
+    memory.

Examples

Modified: branches/1.5.x/numpy/matrixlib/__init__.py
===================================================================
--- branches/1.5.x/numpy/matrixlib/__init__.py	2010-08-01 11:21:57 UTC (rev 8584)
+++ branches/1.5.x/numpy/matrixlib/__init__.py	2010-08-01 11:22:14 UTC (rev 8585)
@@ -1,3 +1,4 @@
+"""Sub-package containing the matrix class and related functions."""
from defmatrix import *

__all__ = defmatrix.__all__

Modified: branches/1.5.x/numpy/matrixlib/defmatrix.py
===================================================================
--- branches/1.5.x/numpy/matrixlib/defmatrix.py	2010-08-01 11:21:57 UTC (rev 8584)
+++ branches/1.5.x/numpy/matrixlib/defmatrix.py	2010-08-01 11:22:14 UTC (rev 8585)
@@ -196,23 +196,22 @@
"""
matrix(data, dtype=None, copy=True)

-    Returns a matrix from an array-like object, or from a string
-    of data.  A matrix is a specialized 2-d array that retains
-    its 2-d nature through operations.  It has certain special
-    operators, such as ``*`` (matrix multiplication) and
-    ``**`` (matrix power).
+    Returns a matrix from an array-like object, or from a string of data.
+    A matrix is a specialized 2-D array that retains its 2-D nature
+    through operations.  It has certain special operators, such as ``*``
+    (matrix multiplication) and ``**`` (matrix power).

Parameters
----------
data : array_like or string
-       If data is a string, the string is interpreted as a matrix
-       with commas or spaces separating columns, and semicolons
-       separating rows.
+       If `data` is a string, it is interpreted as a matrix with commas
+       or spaces separating columns, and semicolons separating rows.
dtype : data-type
Data-type of the output matrix.
copy : bool
-       If data is already an ndarray, then this flag determines whether
-       the data is copied, or whether a view is constructed.
+       If `data` is already an `ndarray`, then this flag determines
+       whether the data is copied (the default), or whether a view is
+       constructed.

--------
@@ -1009,9 +1008,9 @@

Parameters
----------
-    obj : string, sequence or array
-        Input data.  Variables names in the current scope may
-        be referenced, even if `obj` is a string.
+    obj : str or array_like
+        Input data.  Names of variables in the current scope may be
+        referenced, even if `obj` is a string.

Returns
-------

```