Your ROOT_URL in app.ini is https://git.hpc.odu.edu/ but you are visiting https://git.wahab.hpc.odu.edu/wirawan0/wpylib/commit/32b3580687cb4d898007ae52cfa1c38281a68837?style=split&whitespace=ignore-all You should set ROOT_URL correctly, otherwise the web may not work correctly.

* Added array_tools.array_vstack.

master
Wirawan Purwanto 10 years ago
parent f9cdb33e32
commit 32b3580687
  1. 24
      array_tools.py

@ -61,3 +61,27 @@ def array_hstack(arrays):
return hstack(stk) return hstack(stk)
def array_vstack(arrays):
"""Creates a 2D array by vertically stacking many arrays together
(along the array's first dimension).
Each of the input arrays can be a 1D or 2D array.
This function is similar to numpy.vstack.
"""
from numpy import asarray, vstack
stk = []
for a1 in arrays:
a = asarray(a1)
dim = len(a.shape)
if dim == 1:
a = a.reshape((1,len(a)))
elif dim == 2:
pass
else:
raise ValueError, "Won't take 3D, 4D, ... arrays"
stk.append(a)
return vstack(stk)

Loading…
Cancel
Save