def indexing_based(X, Y, Z):
    X_int = np.round(X * 10).astype(int)
Y_int = np.round(Y * 10).astype(int)
X_idx = X_int - X_int.min()
Y_idx = Y_int - Y_int.min()
out = np.zeros((Y_idx.max() + 1, X_idx.max() + 1))
out[Y_idx, X_idx] = Z
return out
Make 2D Numpy array from coordinates