diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-04 18:47:25 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-04 18:47:25 +0000 |
commit | a9046559ee562323b483ffbb80eb4b4d0cb11d36 (patch) | |
tree | d6875105a0c2999d512f853886ae975030016bc0 /numpy/core/numeric.py | |
parent | 7ffd787c0702925a985fedfc0c988059a77c2b61 (diff) | |
download | numpy-a9046559ee562323b483ffbb80eb4b4d0cb11d36.tar.gz |
Convert so that axis arguments are consistent for methods and functions. Place functions for which this changes the Numeric default into oldnumeric.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 166a2d5cc..252ba70cd 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -323,7 +323,6 @@ set_string_function = multiarray.set_string_function set_string_function(array_str, 0) set_string_function(array_repr, 1) - little_endian = (sys.byteorder == 'little') def indices(dimensions, dtype=int): @@ -337,7 +336,7 @@ def indices(dimensions, dtype=int): return array(lst) def fromfunction(function, dimensions, **kwargs): - """fromfunction(function, dimensions) returns an array constructed by + """fromfunction(function, dimensions, dtype=int) returns an array constructed by calling function on a tuple of number grids. The function should accept as many arguments as there are dimensions which is a list of numbers indicating the length of the desired output for each axis. @@ -345,7 +344,8 @@ def fromfunction(function, dimensions, **kwargs): The function can also accept keyword arguments which will be passed in as well. """ - args = indices(dimensions) + dtype = kwargs.get('dtype', int) + args = indices(dimensions,dtype=dtype) return function(*args,**kwargs) def isscalar(num): |