I found an interesting article here published on 31 Mar 2024, in which a new correlation coefficient has been introduced. As I tested, it works quite well with non-linear relationships (I also tested a quadratic function). The Python implementation is found here.
Below is the code:
x=np.linspace(-3.14,3.14, 100) y= x**2 + np.random.random(len(x)) print(np.round(pearsonr(x, y),4)) # => [-0.0065 0.9485] print(np.round(xicor(x, y),4)) # => [0.8611 0. ] x=np.linspace(-3.14,3.14, 100) y= x**2 + np.random.random(len(x)) print(np.round(pearsonr(x, y),4)) # => [-0.0065 0.9485] print(np.round(xicor(x, y),4)) # => [0.8611 0. ] As can be seen, the xicor() output is much closer to 1. If you remove the random noise, the output will be [0.9408 0. ].
The images below are have been reported by the author.

