In [1]:
import numpy as np
In [2]:
a1 = np.ones((2, 3), int)
print(a1)
In [3]:
a2 = np.full((2, 3), 2)
print(a2)
In [4]:
print(np.hstack([a1, a2]))
In [5]:
print(np.concatenate([a1, a2], 1))
In [6]:
a1 = np.ones(3, int)
print(a1)
In [7]:
a2 = np.full(3, 2)
print(a2)
In [8]:
print(np.hstack([a1, a2]))
In [9]:
print(np.concatenate([a1, a2], 0))
In [10]:
a1 = np.ones((2, 3), int)
print(a1)
In [11]:
a2 = np.full(2, 2)
print(a2)
In [12]:
# print(np.hstack([a1, a2]))
# ValueError: all the input arrays must have same number of dimensions