summaryrefslogtreecommitdiff
path: root/numpy/core/shape_base.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-08-16 16:54:16 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-08-27 07:26:55 -0600
commit9194b3af704df71aa9b1ff2f53f169848d0f9dc7 (patch)
tree1e6624032156dfa190e1adba79cc76e5700f19ce /numpy/core/shape_base.py
parent99a21efff4b1f2292dc370c7c9c7c58f10385f2a (diff)
downloadnumpy-9194b3af704df71aa9b1ff2f53f169848d0f9dc7.tar.gz
ENH: missingdata: Rewrite PyArray_Concatenate to work with NA masks
It should also have less memory usage for heterogeneous inputs, because it no longer makes extra copies in that case.
Diffstat (limited to 'numpy/core/shape_base.py')
-rw-r--r--numpy/core/shape_base.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py
index 93de19299..8a4c80e27 100644
--- a/numpy/core/shape_base.py
+++ b/numpy/core/shape_base.py
@@ -267,5 +267,10 @@ def hstack(tup):
[3, 4]])
"""
- return _nx.concatenate(map(atleast_1d,tup),1)
+ arrs = map(atleast_1d,tup)
+ # As a special case, dimension 0 of 1-dimensional arrays is "horizontal"
+ if arrs[0].ndim == 1:
+ return _nx.concatenate(arrs, 0)
+ else:
+ return _nx.concatenate(arrs, 1)