I'm using Python 2.7 and couldn't find an answer to my question.
I have 3 lists (x and y coordinantes and the radius of detected circles):
XSum = [1316, 1324, 1330, 1344, 1356, 1344, 1356, 1308, 1322, 1310, 1336, 1934]
YSum = [960, 952, 972, 954, 964, 970, 948, 928, 940, 950, 984, 1080]
RSum = [379, 375, 355, 352, 340, 347, 338, 348, 361, 342, 342, 286]
I have to find elements in XSum which are not between 675 and 1350 (Index 4, 6 and 11). Elements with the index have to be removed from all three lists.
XSum = [1316, 1324, 1330, 1344, **1356**, 1344, **1356**, 1308, 1322, 1310, 1336, **1934**]
YSum = [960, 952, 972, 954, **964**, 970, **948**, 928, 940, 950, 984, **1080**]
RSum = [379, 375, 355, 352, **340**, 347, **338**, 348, 361, 342, 342, **286**]
After first removal of index which are out of range:
XSum2 = [1316, 1324, 1330, 1344, 1344, 1308, 1322, 1310, 1336]
YSum2 = [960, 952, 972, 954, 970, 928, 940, 950, 984]
RSum2 = [379, 375, 355, 352, 347, 348, 361, 342, 342]
The next step is to find elements in YSum which are not between 940 and 980 and removed the detected index from all three lists (Index 9).
XSum2 = [1316, 1324, 1330, 1344, 1344, 1308, 1322, 1310, **1336**]
YSum2 = [960, 952, 972, 954, 970, 928, 940, 950, **984**]
RSum2 = [379, 375, 355, 352, 347, 348, 361, 342, **342**]
The resulting list should look like:
XSum_Result = [1316, 1324, 1330, 1344, 1344, 1308, 1322, 1310]
YSum_Result = [960, 952, 972, 954, 970, 928, 940, 950]
RSum_Result = [379, 375, 355, 352, 347, 348, 361, 342]
I think it should be an easy task, but I just couldn't figure it out how to remove by index from the other lists.
thank you all for the help