Recently I wanted to compare two sets of points and found the R package 'ks'. The function kde.test (a kernel density based global two-sample comparison test, not KS test) is what I need. For example
library(MASS)
data(crabs)
x1 <- crabs[crabs$sp=="B", c(4,6)]
x2 <- crabs[crabs$sp=="O", c(4,6)]
kt <- kde.test(x1=x1, x2=x2)
But unfortunately I'm not familiar in R and most of my work was done using Python, so it's hard to transfer my scripts to R. At the same time, the function of 'ks' (mainly kde.test) is important to my work. Does anyone know if there's a Python version of 'ks', or if there's a package with similar features in Python?