import numpy as np
# Define X and Y arrays
X = np.array([1, 2, 3])
Y = np.array([4, 5, 6])
# Define a lambda function to compute the Cauchy kernel
kernel = lambda x, y: 1 / (x - y)
# Compute the Cauchy matrix using np.apply_along_axis() and the kernel function
Cauchy = np.apply_along_axis(kernel, 0, Y, X[:, np.newaxis])
print("Cauchy matrix:")
print(Cauchy)