Hello,
Perhaps combining the methods in the link below with transforming your x and y variables via rankdata of scipy would be the way to go: