diff options
author | Mark Wiebe <mwwiebe@gmail.com> | 2011-08-16 16:54:16 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:26:55 -0600 |
commit | 9194b3af704df71aa9b1ff2f53f169848d0f9dc7 (patch) | |
tree | 1e6624032156dfa190e1adba79cc76e5700f19ce /numpy/core/shape_base.py | |
parent | 99a21efff4b1f2292dc370c7c9c7c58f10385f2a (diff) | |
download | numpy-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.py | 7 |
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) |