How to iterate through python list, and then delete approximation elements

I have a list,list whose element is dict.
[{centre: (743), radius: 1105), radius: 41},
{centre: (743, 1106), radius: 48},
{centre: (899, 1443), radius: 48},
{centre: (900, 1442), radius: 40})]

this is a data structure about the center and radius of the circle. I want to remove a circle with a similar center (Abscissa difference of about + 3) (retain a smaller radius)

.
def takeXAxis(input):
    return input["centre"][0]


def sortCircles(circleDetails):
    circleDetails.sort(key=takeXAxis)


def removeClosedCircle(circleDetails):
    newCircleDetails = []
    for i in range(len(circleDetails)):
        j = i + 1
        for j in range(len(circleDetails)):
        ...
        

then I"m not very good at it. Can someone take a look at it for me?

Dec.28,2021

import itertools

my_list = [
    {'centre':(743,1105), 'radius': 41},
    {'centre':(743, 1106), 'radius': 48},
    {'centre':(899, 1443), 'radius': 48},
    {'centre':(900, 1442), 'radius': 40}
]

for a, b in itertools.combinations(my_list, 2):

    -sharp only need to do something if the diff is in range..
    if abs(a['centre'][0] - b['centre'][0]) <= 3:

        -sharp check the radius, if bigger, remove it, else remove the other.
        if a['radius'] > b['radius']:
            my_list.remove(a)
        else:
            my_list.remove(b)

print my_list

the question is not clear. If there is a circle xxxing1, then another xcircle 3 removes both the first two circles?
must the center of the circle be an integer?


li = [{'centre': (743, 1105), 'radius': 41},
      {'centre': (743, 1106), 'radius': 48},
      {'centre': (899, 1443), 'radius': 48},
      {'centre': (900, 1442), 'radius': 40}]

li_radius = sorted(li, key=lambda x: x['radius'])  -sharp radius
li_centre = sorted(li_radius, key=lambda x: x['centre'][0])  -sharp 

li_index = [i for i in range(1, len(li_centre)) if
            (li_centre[i]['centre'][0] - li_centre[i - 1]['centre'][0]) <= 3]  -sharp 
result = [li_centre[i] for i in range(len(li_centre)) if (i not in li_index)]  -sharp 
print(result)
Menu