summaryrefslogtreecommitdiff
path: root/scipy/base/matrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-28 21:36:32 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-28 21:36:32 +0000
commita8240d84ad9317a8c6e08e45c5cabdb7b562b6f5 (patch)
tree62f1c40ab40d2b030181c5869a6279f8ab3171af /scipy/base/matrix.py
parentb60f3c5f424f20d6e7506db7a4f26dfc3c08fe2e (diff)
downloadnumpy-a8240d84ad9317a8c6e08e45c5cabdb7b562b6f5.tar.gz
Fixed mixed-type array scalar computation issues.
Diffstat (limited to 'scipy/base/matrix.py')
-rw-r--r--scipy/base/matrix.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scipy/base/matrix.py b/scipy/base/matrix.py
index 34a4673c8..56fcefb74 100644
--- a/scipy/base/matrix.py
+++ b/scipy/base/matrix.py
@@ -55,7 +55,8 @@ class matrix(N.ndarray):
return data.astype(dtype)
if dtype is None:
- dtype = N.float
+ if isinstance(data, N.ndarray):
+ dtype = data.dtype
intype = N.obj2dtype(dtype)
if isinstance(data, types.StringType):
@@ -79,7 +80,7 @@ class matrix(N.ndarray):
if not (fortran or arr.flags['CONTIGUOUS']):
arr = arr.copy()
- ret = N.ndarray.__new__(matrix, shape, intype, buffer=arr,
+ ret = N.ndarray.__new__(matrix, shape, arr.dtype, buffer=arr,
fortran=fortran,
swap=(not arr.flags['NOTSWAPPED']))
return ret;