I have a plot of n number of points in a scatter graph. I want to split the plot into a grid of squares of x length and then assign each point in my graph a certain square from the grid I just made. How would I go about doing this in Python?
The code for the graph is this:
diagram = pos_table.plot.scatter('x', 'y', c = 'purple', s = 2)
which results in:
How would I split this into squares and then count the number of points in each square? Thanks