summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric/functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/oldnumeric/functions.py')
-rw-r--r--numpy/oldnumeric/functions.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/oldnumeric/functions.py b/numpy/oldnumeric/functions.py
index e295c11bd..7d6d8abfa 100644
--- a/numpy/oldnumeric/functions.py
+++ b/numpy/oldnumeric/functions.py
@@ -6,7 +6,7 @@ import numpy.core.numeric as nn
from typeconv import convtypecode, convtypecode2
__all__ = ['take', 'repeat', 'sum', 'product', 'sometrue', 'alltrue',
- 'cumsum', 'cumproduct', 'compress',
+ 'cumsum', 'cumproduct', 'compress', 'fromfunction',
'ones', 'empty', 'identity', 'zeros', 'array', 'asarray',
'nonzero', 'reshape', 'arange', 'fromstring', 'ravel', 'trace',
'indices', 'where','sarray','cross_product', 'argmax', 'argmin',
@@ -44,7 +44,10 @@ def argmin(x, axis=-1):
def compress(condition, m, axis=-1):
return N.compress(condition, m, axis)
-
+
+def fromfunction(args, dimensions):
+ return N.fromfunction(args, dimensions, dtype=int)
+
def ones(shape, typecode='l', savespace=0, dtype=None):
"""ones(shape, dtype=int) returns an array of the given
dimensions which is initialized to all ones.