I have been following this tutorial https://james-brennan.github.io/posts/fast_gridding_geopandas/ in order to create a grid on a geographical area and to assign labels to each point.
I was curious whether there is a known algorithm and implementation that can further split or merge this grid so that the overall sample density per grid box is balanced.