Permalink
Browse files

DOC: wiki merge, matrlixlib and some ndarray methods.

  • Loading branch information...
1 parent 843446b commit ba22c4aa642d19417971178bb9092303b4d95b52 @rgommers rgommers committed Aug 1, 2010
Showing with 30 additions and 28 deletions.
  1. +17 −15 numpy/add_newdocs.py
  2. +1 −0 numpy/matrixlib/__init__.py
  3. +12 −13 numpy/matrixlib/defmatrix.py
View
@@ -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
@@ -1,3 +1,4 @@
+"""Sub-package containing the matrix class and related functions."""
from defmatrix import *
__all__ = defmatrix.__all__
@@ -196,23 +196,22 @@ class matrix(N.ndarray):
"""
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.
See Also
--------
@@ -1009,9 +1008,9 @@ def bmat(obj, ldict=None, gdict=None):
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
-------

0 comments on commit ba22c4a

Please sign in to comment.