Skip to content
Browse files

STY assorted tweaks

  • Loading branch information...
1 parent 753f6c4 commit 7f5b70038d059f65547e9cad8a51fea47251cd47 @VSTeam VSTeam committed Feb 7, 2012
Showing with 35 additions and 20 deletions.
  1. +35 −20 la/flarry.py
View
55 la/flarry.py
@@ -1792,11 +1792,15 @@ def lrange(*args, **kwargs):
`step` apart if such a keyword argument is used), labeled either by
integers or by the labels supplied.
+ See Also
+ --------
+ empty, ones, zeros
+
Examples
--------
- A basic, 1d arange using the 'dtype' argument:
+ A basic, 1d lrange using the 'dtype' argument:
- >>> la.arange(5, dtype='f4')
+ >>> la.lrange(5, dtype='f4')
label_0
0
1
@@ -1806,8 +1810,8 @@ def lrange(*args, **kwargs):
x
array([0.0, 1.0, 2.0, 3.0, 4.0], dtype=np.float32)
- A multi-dimensional arange:
- >>> la.arange(2,3,3)
+ A multi-dimensional lrange:
+ >>> la.lrange(2,3,3)
label_0
0
1
@@ -1830,7 +1834,7 @@ def lrange(*args, **kwargs):
Using the 'label' keword:
- >>> la.arange(label=[['a', 'b']])
+ >>> la.lrange(label=[['a', 'b']])
label_0
a
b
@@ -1891,9 +1895,13 @@ def empty(shape=None, label=None, dtype=None, order='C'):
a ``(d1, ..., dn)``-shaped larry of ones, labeled either by
integers or by the labels supplied.
+ See Also
+ --------
+ zeros, ones, lrange
+
Examples
--------
- A basic, 1d arange using the 'dtype' argument:
+ A basic, 1d larry using the 'dtype' argument:
>>> la.empty(5, dtype='i4')
label_0
@@ -1906,6 +1914,7 @@ def empty(shape=None, label=None, dtype=None, order='C'):
array([0, 0, 0, -7, 987], dtype=np.int32)
A multi-dimensional larry:
+
>>> la.empty(2,3,3)
label_0
0
@@ -1928,7 +1937,7 @@ def empty(shape=None, label=None, dtype=None, order='C'):
Using the 'label' argument:
- >>> la.arange(label=[['a', 'b']])
+ >>> la.empty(label=[['a', 'b']])
label_0
a
b
@@ -1950,8 +1959,6 @@ def empty(shape=None, label=None, dtype=None, order='C'):
data = np.empty(shape, dtype, order)
return larry(data, label)
-
-
def ones(shape=None, label=None, dtype=None, order='C'):
"""
Makes a larry of all ones.
@@ -1979,9 +1986,13 @@ def ones(shape=None, label=None, dtype=None, order='C'):
a ``(d1, ..., dn)``-shaped larry of ones, labeled either by
integers or by the labels supplied.
+ See Also
+ --------
+ empty, zeros, lrange
+
Examples
--------
- A basic, 1d arange using the 'dtype' argument:
+ A basic, 1d larry using the 'dtype' argument:
>>> la.ones(5, dtype='i4')
label_0
@@ -1993,8 +2004,9 @@ def ones(shape=None, label=None, dtype=None, order='C'):
x
array([1, 1, 1, 1, 1], dtype=np.int32)
- A multi-dimensional arange:
- >>> la.arange(2,3,3)
+ A multi-dimensional larry:
+
+ >>> la.ones(2,3,3)
label_0
0
1
@@ -2017,7 +2029,7 @@ def ones(shape=None, label=None, dtype=None, order='C'):
Using the 'label' argument:
- >>> la.arange(label=[['a', 'b']])
+ >>> la.ones(label=[['a', 'b']])
label_0
a
b
@@ -2049,19 +2061,22 @@ def zeros(shape=None, label=None, dtype=None, order='C'):
order : {'C', 'F'}, optional
Whether to store multidimensional data in C- or Fortran-contiguous
(row- or column-wise) order in memory.
-
Returns
-------
lar : larry
a ``(d1, ..., dn)``-shaped larry of zeros, labeled either by
integers or by the labels supplied.
+ See Also
+ --------
+ empty, ones, lrange
+
Examples
--------
- A basic, 1d arange using the 'dtype' argument:
+ A basic, 1d larry using the 'dtype' argument:
- >>> la.ones(5, dtype='i4')
+ >>> la.zeros(5, dtype='i4')
label_0
0
1
@@ -2071,8 +2086,9 @@ def zeros(shape=None, label=None, dtype=None, order='C'):
x
array([0, 0, 0, 0, 0], dtype=np.int32)
- A multi-dimensional arange:
- >>> la.arange(2,3,3)
+ A multi-dimensional larry:
+
+ >>> la.zeros(2,3,3)
label_0
0
1
@@ -2095,7 +2111,7 @@ def zeros(shape=None, label=None, dtype=None, order='C'):
Using the 'label' argument:
- >>> la.arange(label=[['a', 'b']])
+ >>> la.ones(label=[['a', 'b']])
label_0
a
b
@@ -2106,4 +2122,3 @@ def zeros(shape=None, label=None, dtype=None, order='C'):
lar = empty(shape, label, dtype, order)
lar.x.fill(0)
return lar
-

0 comments on commit 7f5b700

Please sign in to comment.
Something went wrong with that request. Please try again.