summaryrefslogtreecommitdiff
path: root/numpy/numarray/functions.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-10 21:07:31 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-10 21:07:31 +0000
commit056a264e3445674172d5dc44a89d28a1c1891312 (patch)
tree44faeaf44883128fe4e7e496f9cc761256135d1f /numpy/numarray/functions.py
parent7451ebe97776507e769f2bf8f5f448aaa4c43305 (diff)
downloadnumpy-056a264e3445674172d5dc44a89d28a1c1891312.tar.gz
Finished up numpy.numarray.alter_code1
Diffstat (limited to 'numpy/numarray/functions.py')
-rw-r--r--numpy/numarray/functions.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py
index 73f3f80c9..c990fe7e9 100644
--- a/numpy/numarray/functions.py
+++ b/numpy/numarray/functions.py
@@ -33,7 +33,8 @@ __all__ += ['vdot', 'dot', 'matrixmultiply', 'ravel', 'indices',
'repeat', 'reshape', 'resize', 'round', 'searchsorted',
'shape', 'size', 'sometrue', 'sort', 'swapaxes', 'take',
'tcode', 'tname', 'tensormultiply', 'trace', 'transpose',
- 'types', 'value', 'cumsum', 'cumproduct', 'nonzero'
+ 'types', 'value', 'cumsum', 'cumproduct', 'nonzero', 'newobj',
+ 'togglebyteorder'
]
import copy, copy_reg, types
@@ -444,3 +445,11 @@ def argmax(x, axis=-1):
def argmin(x, axis=-1):
return N.argmin(x, axis)
+def newobj(self, type):
+ if type is None:
+ return N.empty_like(self)
+ else:
+ return N.empty(self.shape, type)
+
+def togglebyteorder(self):
+ self.dtype=self.dtype.newbyteorder()