使用python就是为了节约撸码的时间。
import numpy as np
from sklearn.datasets import load_iris
from sklearn.metrics.pairwise import rbf_kernel
import pandas as pd
from scipy.linalg import block_diag
a = np.array([1,2,3,4,5])
print(np.outer(a,a))
###验证
b = a.reshape(-1,1)
bT = b.T
print(b)
print(b@bT)