#
import numpy as np


a = np.array([1, 1, 1])
b = np.array([2, 2, 2])
# 合并
c = np.vstack((a, b))
print(c)
print(a.shape, b.shape, c.shape)
# 合并
d = np.hstack((a, b))
print(d)
# 转置行
print(a[np.newaxis, :])
# 转置列
print(a[:, np.newaxis])

m = a[:, np.newaxis]
n = b[:, np.newaxis]
x = np.hstack((m, n))
print(x)

y = np.concatenate((a, b, b, a), axis=0)
y1 = np.concatenate((m, n, n, m), axis=1)
print(y, y1)

ebf8bbbf2d91b248b7d9a5cb4f23a66ac178a1a0
<mask token>

<mask token>
print(c)
print(a.shape, b.shape, c.shape)
<mask token>
print(d)
print(a[np.newaxis, :])
print(a[:, np.newaxis])
<mask token>
print(x)
<mask token>
print(y, y1)

<mask token>
a = np.array([1, 1, 1])
b = np.array([2, 2, 2])
c = np.vstack((a, b))
print(c)
print(a.shape, b.shape, c.shape)
d = np.hstack((a, b))
print(d)
print(a[np.newaxis, :])
print(a[:, np.newaxis])
m = a[:, np.newaxis]
n = b[:, np.newaxis]
x = np.hstack((m, n))
print(x)
y = np.concatenate((a, b, b, a), axis=0)
y1 = np.concatenate((m, n, n, m), axis=1)
print(y, y1)

import numpy as np
a = np.array([1, 1, 1])
b = np.array([2, 2, 2])
c = np.vstack((a, b))
print(c)
print(a.shape, b.shape, c.shape)
d = np.hstack((a, b))
print(d)
print(a[np.newaxis, :])
print(a[:, np.newaxis])
m = a[:, np.newaxis]
n = b[:, np.newaxis]
x = np.hstack((m, n))
print(x)
y = np.concatenate((a, b, b, a), axis=0)
y1 = np.concatenate((m, n, n, m), axis=1)
print(y, y1)

#
import numpy as np


a = np.array([1, 1, 1])
b = np.array([2, 2, 2])
# 合并
c = np.vstack((a, b))
print(c)
print(a.shape, b.shape, c.shape)
# 合并
d = np.hstack((a, b))
print(d)
# 转置行
print(a[np.newaxis, :])
# 转置列
print(a[:, np.newaxis])

m = a[:, np.newaxis]
n = b[:, np.newaxis]
x = np.hstack((m, n))
print(x)

y = np.concatenate((a, b, b, a), axis=0)
y1 = np.concatenate((m, n, n, m), axis=1)
print(y, y1)
