映射并使用 (X, Y)、(X,Z) 和 (Y,Z) 对以及关联的 X、Y 或 Z 坐标

2024-06-10

我有一个清单清单nLedgers- 3D 点云:

[nodeID, X, Y, Z]

具有多行。有些节点会有相同的X and Y坐标和不同Z协调。

我想首先确定不同的Z具有相同坐标的X and Y坐标。 那么同样对于X,最后为Y.

然后,使用那些(X,Y), (X,Z) or (Y,Z)成对和不同Z, Yor X我想改变的级别x and y第二个列表的坐标(nodes).

变更应遵守以下规定:

1) For x,y,z in `nodes`, if x=X and y=Y and Z level 1 <=z< Z level 2:
   change x and y coordinates between consecutive `Z` levels, for each pair of `(X,Y)` coordinates.

2) For x,y,z in `nodes`, if x=X and Y level 1 <=y< Y level 2:
   change x coordinates between consecutive `Y` levels, for each pair of `(Y,Z)` coordinates.

3) For x,y,z in `nodes`, if y=Y and X level 1 <=x< X level 2:
   change y coordinates between consecutive `X` levels, for each pair of `(X,Z)` coordinates.

任何帮助表示赞赏。

根据之前的帖子,我有以下代码:

from ast import literal_eval
nLedgers=[[literal_eval(x) for x in item] for item in nLedgers] #transform list of strings to list of floats
nodes=[[literal_eval(x) for x in item] for item in nodes]

NewNodesCoord = []
dirX=1 #integer that changes the direction (X,Y) of the vector to change the x and y coordinates
dirY=1-dirX
newy1=0 #float that stores the new y coordinate at x=X1 and z=Z 
newy2=0 #float that stores the new y coordinate at x=X2 (X2>X1) and z=Z 
newx1=0 #float that stores the new x coordinate at y=Y1 and z=Z 
newx2=0 #float that stores the new x coordinate at y=Y2 (Y2>Y1) and z=Z 

from collections import defaultdict
dic1=defaultdict(list) #dictionary of X and Y pairs
dic2=defaultdict(list) #dictionary of X and Z pairs
dic3=defaultdict(list) #dictionary of Y and Z pairs

for id,x,y,z in nLedgers:
    dic1[(x,y)].append((id,z))
for key in dic1:
    dic1[key].sort( key=lambda x:float(x[1]) )

for id,x,y,z in nLedgers:
    dic2[(x,z)].append((id,y))
for key in dic2:
    dic2[key].sort( key=lambda x:float(x[1]) )
#print dic2

for id,x,y,z in nLedgers:
    dic3[(y,z)].append((id,x))
for key in dic2:
    dic3[key].sort( key=lambda x:float(x[1]) )
#print dic3

newNodes=[] #list with changed coordinates
for i,row in enumerate(nodes): #same X,Y, different Z
    id,x,y,z=row
    z_levels=[item[1] for item in dic1[(x,y)]]
    for k,l in zip(z_levels,z_levels[1:]):
        if k<=z<l:
            nodes[i][1]=x+((l-k)/400*sin(pi*(z-k)/l)+max(z_levels)/800*(z/max(z_levels)))*dirX
            nodes[i][2]=y+((l-k)/400*sin(pi*(z-k)/l)+max(z_levels)/800*(z/max(z_levels)))*dirY
            nodes[i][3]=z
            newNodes.append([nodes[i][0], nodes[i][1], nodes[i][2], nodes[i][3]])
#           break 

for i,row in enumerate(nodes):  #same X, different Y
    id,x,y,z=row
    y_levels=[item[1] for item in dic2[(x,z)]]
    z_levels=[item[1] for item in dic1[(x,y)]]
    for k,l in zip(y_levels,y_levels[1:]):
        if x==dic2.keys()[0][0] and k<y<l:
            for m,n in zip(z_levels,z_levels[1:]):
                if m==z and y==k:
                    newx1=x+((n-m)/400*sin(pi*(z-m)/n)+max(z_levels)/800*(z/max(z_levels)))*dirX
                if m==z and y==l:
                    newx2=x+(n-m)/400*sin(pi*(z-m)/n)+max(z_levels)/800*(z/max(z_levels))   
            nodes[i][1]=x+(y-k)*(newx2-newx1)/(l-k)+newx1
            nodes[i][2]=y
            nodes[i][3]=z
            newNodes.append([nodes[i][0], nodes[i][1], nodes[i][2], nodes[i][3]])

for i,row in enumerate(nodes):#same Y, different X
    id,x,y,z=row
    x_levels=[item[1] for item in dic3[(y,z)]]
    z_levels=[item[1] for item in dic1[(x,y)]]
    for k,l in zip(x_levels,x_levels[1:]):
#        print dic3.keys()[0][0]
        if y==dic3.keys()[0][0] and k<x<l: #same X, different Y
            for m,n in zip(z_levels,z_levels[1:]):
                if m==z and y==k:
                    newy1=y+((n-m)/400*sin(pi*(z-m)/n)+max(z_levels)/800*(z/max(z_levels)))*dirY
                if m==z and y==l:
                    newy2=y+((n-m)/400*sin(pi*(z-m)/n)+max(z_levels)/800*(z/max(z_levels)))*dirY  
            nodes[i][1]=x
            nodes[i][2]=y+(y-k)*(newy2-newy1)/(l-k)+newy1
            nodes[i][3]=z
            newNodes.append([nodes[i][0], nodes[i][1], nodes[i][2], nodes[i][3]])

第一个更改有效(X、Y 对),其他两个无效。我有一个问题dic2.keys()[0][0]。我想循环 dic2 的键并将第一个键的值与 x 进行比较。


from collections import defaultdict
data1=[['173', '0.', '0.', '0.'], ['183', '1000.', '0.', '0.'], ['184', '0.', '1000.', '0.'], ['194', '1000.', '1000.', '0.'], ['195', '0.', '0.', '1000.'], ['205', '1000.', '0.', '1000.'], ['206', '0.', '1000.', '1000.'], ['216', '1000.', '1000.', '1000.'], ['217', '0.', '0.', '2000.'], ['227', '1000.', '0.', '2000.'], ['228', '0.', '1000.', '2000.'], ['238', '1000.', '1000.', '2000.'], ['239', '0.', '0.', '3000.'], ['249', '1000.', '0.', '3000.'], ['250', '0.', '1000.', '3000.'], ['260', '1000.', '1000.', '3000.'], ['261', '0.', '0.', '4000.'], ['271', '1000.', '0.', '4000.'], ['272', '0.', '1000.', '4000.'], ['282', '1000.', '1000.', '4000.'], ['283', '0.', '0.', '0.'], ['293', '0.', '1000.', '0.'], ['294', '1000.', '0.', '0.'], ['304', '1000.', '1000.', '0.'], ['305', '0.', '0.', '1000.'], ['315', '0.', '1000.', '1000.'], ['316', '1000.', '0.', '1000.'], ['326', '1000.', '1000.', '1000.'], ['327', '0.', '0.', '2000.'], ['337', '0.', '1000.', '2000.'], ['338', '1000.', '0.', '2000.'], ['348', '1000.', '1000.', '2000.'], ['349', '0.', '0.', '3000.'], ['359', '0.', '1000.', '3000.'], ['360', '1000.', '0.', '3000.'], ['370', '1000.', '1000.', '3000.'], ['371', '0.', '0.', '4000.'], ['381', '0.', '1000.', '4000.'], ['382', '1000.', '0.', '4000.'], ['392', '1000.', '1000.', '4000.'], ['436', '-1000.', '0.', '0.'], ['446', '0.', '0.', '0.'], ['447', '-1000.', '1000.', '0.'], ['457', '0.', '1000.', '0.'], ['458', '-1000.', '1000.', '1000.'], ['468', '0.', '1000.', '1000.'], ['469', '-1000.', '1000.', '2000.'], ['479', '0.', '1000.', '2000.'], ['480', '-1000.', '1000.', '3000.'], ['490', '0.', '1000.', '3000.'], ['491', '-1000.', '0.', '0.'], ['501', '-1000.', '1000.', '0.'], ['502', '-1000.', '1000.', '4000.'], ['512', '0.', '1000.', '4000.'], ['513', '-1000.', '0.', '1000.'], ['523', '0.', '0.', '1000.'], ['524', '-1000.', '0.', '2000.'], ['534', '0.', '0.', '2000.'], ['535', '-1000.', '0.', '3000.'], ['545', '0.', '0.', '3000.'], ['546', '-1000.', '0.', '4000.'], ['556', '0.', '0.', '4000.'], ['557', '-1000.', '0.', '1000.'], ['567', '-1000.', '1000.', '1000.'], ['568', '-1000.', '0.', '3000.'], ['578', '-1000.', '1000.', '3000.'], ['579', '-1000.', '0.', '2000.'], ['589', '-1000.', '1000.', '2000.'], ['590', '-1000.', '0.', '4000.'], ['600', '-1000.', '1000.', '4000.'], ['687', '0.', '2000.', '0.'], ['697', '1000.', '2000.', '0.'], ['698', '0.', '2000.', '1000.'], ['708', '1000.', '2000.', '1000.'], ['709', '0.', '2000.', '2000.'], ['719', '1000.', '2000.', '2000.'], ['720', '0.', '2000.', '3000.'], ['730', '1000.', '2000.', '3000.'], ['731', '0.', '2000.', '4000.'], ['741', '1000.', '2000.', '4000.'], ['742', '0.', '1000.', '0.'], ['752', '0.', '2000.', '0.'], ['753', '1000.', '1000.', '1000.'], ['763', '1000.', '2000.', '1000.'], ['764', '1000.', '1000.', '3000.'], ['774', '1000.', '2000.', '3000.'], ['775', '1000.', '1000.', '0.'], ['785', '1000.', '2000.', '0.'], ['786', '1000.', '1000.', '2000.'], ['796', '1000.', '2000.', '2000.'], ['797', '1000.', '1000.', '4000.'], ['807', '1000.', '2000.', '4000.'], ['808', '-1000.', '1000.', '0.'], ['818', '-1000.', '2000.', '0.'], ['819', '0.', '1000.', '1000.'], ['829', '0.', '2000.', '1000.'], ['830', '0.', '1000.', '2000.'], ['840', '0.', '2000.', '2000.'], ['841', '0.', '1000.', '3000.'], ['851', '0.', '2000.', '3000.'], ['852', '0.', '1000.', '4000.'], ['862', '0.', '2000.', '4000.'], ['863', '-1000.', '2000.', '0.'], ['873', '0.', '2000.', '0.'], ['874', '-1000.', '2000.', '1000.'], ['884', '0.', '2000.', '1000.'], ['885', '-1000.', '2000.', '2000.'], ['895', '0.', '2000.', '2000.'], ['896', '-1000.', '2000.', '3000.'], ['906', '0.', '2000.', '3000.'], ['907', '-1000.', '2000.', '4000.'], ['917', '0.', '2000.', '4000.'], ['918', '-1000.', '1000.', '1000.'], ['928', '-1000.', '2000.', '1000.'], ['929', '-1000.', '1000.', '3000.'], ['939', '-1000.', '2000.', '3000.'], ['940', '-1000.', '1000.', '2000.'], ['950', '-1000.', '2000.', '2000.'], ['951', '-1000.', '1000.', '4000.'], ['961', '-1000.', '2000.', '4000.']]
data2=[['1', '0.', '0.', '-100.'], ['2', '0.', '0.', '0.'], ['3', '0.', '0.', '4000.'], ['4', '0.', '0.', '4100.'], ['5', '0.', '0.', '100.'], ['6', '0.', '0.', '200.'], ['7', '0.', '0.', '300.'], ['8', '0.', '0.', '400.'], ['9', '0.', '0.', '500.'], ['10', '0.', '0.', '600.'], ['11', '0.', '0.', '700.'], ['12', '0.', '0.', '800.'], ['13', '0.', '0.', '900.'], ['14', '0.', '0.', '1000.'], ['15', '0.', '0.', '1100.'], ['16', '0.', '0.', '1200.'], ['17', '0.', '0.', '1300.'], ['18', '0.', '0.', '1400.'], ['19', '0.', '0.', '1500.'], ['20', '0.', '0.', '1600.'], ['21', '0.', '0.', '1700.'], ['22', '0.', '0.', '1800.'], ['23', '0.', '0.', '1900.'], ['24', '0.', '0.', '2000.'], ['25', '0.', '0.', '2100.'], ['26', '0.', '0.', '2200.'], ['27', '0.', '0.', '2300.'], ['28', '0.', '0.', '2400.'], ['29', '0.', '0.', '2500.'], ['30', '0.', '0.', '2600.'], ['31', '0.', '0.', '2700.'], ['32', '0.', '0.', '2800.'], ['33', '0.', '0.', '2900.'], ['34', '0.', '0.', '3000.'], ['35', '0.', '0.', '3100.'], ['36', '0.', '0.', '3200.'], ['37', '0.', '0.', '3300.'], ['38', '0.', '0.', '3400.'], ['39', '0.', '0.', '3500.'], ['40', '0.', '0.', '3600.'], ['41', '0.', '0.', '3700.'], ['42', '0.', '0.', '3800.'], ['43', '0.', '0.', '3900.'], ['44', '0.', '1000.', '-100.'], ['45', '0.', '1000.', '0.'], ['46', '0.', '1000.', '4000.'], ['47', '0.', '1000.', '4100.'], ['48', '0.', '1000.', '100.'], ['49', '0.', '1000.', '200.'], ['50', '0.', '1000.', '300.'], ['51', '0.', '1000.', '400.'], ['52', '0.', '1000.', '500.'], ['53', '0.', '1000.', '600.'], ['54', '0.', '1000.', '700.'], ['55', '0.', '1000.', '800.'], ['56', '0.', '1000.', '900.'], ['57', '0.', '1000.', '1000.'], ['58', '0.', '1000.', '1100.'], ['59', '0.', '1000.', '1200.'], ['60', '0.', '1000.', '1300.'], ['61', '0.', '1000.', '1400.'], ['62', '0.', '1000.', '1500.'], ['63', '0.', '1000.', '1600.'], ['64', '0.', '1000.', '1700.'], ['65', '0.', '1000.', '1800.'], ['66', '0.', '1000.', '1900.'], ['67', '0.', '1000.', '2000.'], ['68', '0.', '1000.', '2100.'], ['69', '0.', '1000.', '2200.'], ['70', '0.', '1000.', '2300.'], ['71', '0.', '1000.', '2400.'], ['72', '0.', '1000.', '2500.'], ['73', '0.', '1000.', '2600.'], ['74', '0.', '1000.', '2700.'], ['75', '0.', '1000.', '2800.'], ['76', '0.', '1000.', '2900.'], ['77', '0.', '1000.', '3000.'], ['78', '0.', '1000.', '3100.'], ['79', '0.', '1000.', '3200.'], ['80', '0.', '1000.', '3300.'], ['81', '0.', '1000.', '3400.'], ['82', '0.', '1000.', '3500.'], ['83', '0.', '1000.', '3600.'], ['84', '0.', '1000.', '3700.'], ['85', '0.', '1000.', '3800.'], ['86', '0.', '1000.', '3900.'], ['87', '1000.', '0.', '-100.'], ['88', '1000.', '0.', '0.'], ['89', '1000.', '0.', '4000.'], ['90', '1000.', '0.', '4100.'], ['91', '1000.', '0.', '100.'], ['92', '1000.', '0.', '200.'], ['93', '1000.', '0.', '300.'], ['94', '1000.', '0.', '400.'], ['95', '1000.', '0.', '500.'], ['96', '1000.', '0.', '600.'], ['97', '1000.', '0.', '700.'], ['98', '1000.', '0.', '800.'], ['99', '1000.', '0.', '900.'], ['100', '1000.', '0.', '1000.'], ['101', '1000.', '0.', '1100.'], ['102', '1000.', '0.', '1200.'], ['103', '1000.', '0.', '1300.'], ['104', '1000.', '0.', '1400.'], ['105', '1000.', '0.', '1500.'], ['106', '1000.', '0.', '1600.'], ['107', '1000.', '0.', '1700.'], ['108', '1000.', '0.', '1800.'], ['109', '1000.', '0.', '1900.'], ['110', '1000.', '0.', '2000.'], ['111', '1000.', '0.', '2100.'], ['112', '1000.', '0.', '2200.'], ['113', '1000.', '0.', '2300.'], ['114', '1000.', '0.', '2400.'], ['115', '1000.', '0.', '2500.'], ['116', '1000.', '0.', '2600.'], ['117', '1000.', '0.', '2700.'], ['118', '1000.', '0.', '2800.'], ['119', '1000.', '0.', '2900.'], ['120', '1000.', '0.', '3000.'], ['121', '1000.', '0.', '3100.'], ['122', '1000.', '0.', '3200.'], ['123', '1000.', '0.', '3300.'], ['124', '1000.', '0.', '3400.'], ['125', '1000.', '0.', '3500.'], ['126', '1000.', '0.', '3600.'], ['127', '1000.', '0.', '3700.'], ['128', '1000.', '0.', '3800.'], ['129', '1000.', '0.', '3900.'], ['130', '1000.', '1000.', '-100.'], ['131', '1000.', '1000.', '0.'], ['132', '1000.', '1000.', '4000.'], ['133', '1000.', '1000.', '4100.'], ['134', '1000.', '1000.', '100.'], ['135', '1000.', '1000.', '200.'], ['136', '1000.', '1000.', '300.'], ['137', '1000.', '1000.', '400.'], ['138', '1000.', '1000.', '500.'], ['139', '1000.', '1000.', '600.'], ['140', '1000.', '1000.', '700.'], ['141', '1000.', '1000.', '800.'], ['142', '1000.', '1000.', '900.'], ['143', '1000.', '1000.', '1000.'], ['144', '1000.', '1000.', '1100.'], ['145', '1000.', '1000.', '1200.'], ['146', '1000.', '1000.', '1300.'], ['147', '1000.', '1000.', '1400.'], ['148', '1000.', '1000.', '1500.'], ['149', '1000.', '1000.', '1600.'], ['150', '1000.', '1000.', '1700.'], ['151', '1000.', '1000.', '1800.'], ['152', '1000.', '1000.', '1900.'], ['153', '1000.', '1000.', '2000.'], ['154', '1000.', '1000.', '2100.'], ['155', '1000.', '1000.', '2200.'], ['156', '1000.', '1000.', '2300.'], ['157', '1000.', '1000.', '2400.'], ['158', '1000.', '1000.', '2500.'], ['159', '1000.', '1000.', '2600.'], ['160', '1000.', '1000.', '2700.'], ['161', '1000.', '1000.', '2800.'], ['162', '1000.', '1000.', '2900.'], ['163', '1000.', '1000.', '3000.'], ['164', '1000.', '1000.', '3100.'], ['165', '1000.', '1000.', '3200.'], ['166', '1000.', '1000.', '3300.'], ['167', '1000.', '1000.', '3400.'], ['168', '1000.', '1000.', '3500.'], ['169', '1000.', '1000.', '3600.'], ['170', '1000.', '1000.', '3700.'], ['171', '1000.', '1000.', '3800.'], ['172', '1000.', '1000.', '3900.'], ['173', '0.', '0.', '0.'], ['174', '100.', '0.', '0.'], ['175', '200.', '0.', '0.'], ['176', '300.', '0.', '0.'], ['177', '400.', '0.', '0.'], ['178', '500.', '0.', '0.'], ['179', '600.', '0.', '0.'], ['180', '700.', '0.', '0.'], ['181', '800.', '0.', '0.'], ['182', '900.', '0.', '0.'], ['183', '1000.', '0.', '0.'], ['184', '0.', '1000.', '0.'], ['185', '100.', '1000.', '0.'], ['186', '200.', '1000.', '0.'], ['187', '300.', '1000.', '0.'], ['188', '400.', '1000.', '0.'], ['189', '500.', '1000.', '0.'], ['190', '600.', '1000.', '0.'], ['191', '700.', '1000.', '0.'], ['192', '800.', '1000.', '0.'], ['193', '900.', '1000.', '0.'], ['194', '1000.', '1000.', '0.'], ['195', '0.', '0.', '1000.'], ['196', '100.', '0.', '1000.'], ['197', '200.', '0.', '1000.'], ['198', '300.', '0.', '1000.'], ['199', '400.', '0.', '1000.'], ['200', '500.', '0.', '1000.'], ['201', '600.', '0.', '1000.'], ['202', '700.', '0.', '1000.'], ['203', '800.', '0.', '1000.'], ['204', '900.', '0.', '1000.'], ['205', '1000.', '0.', '1000.'], ['206', '0.', '1000.', '1000.'], ['207', '100.', '1000.', '1000.'], ['208', '200.', '1000.', '1000.'], ['209', '300.', '1000.', '1000.'], ['210', '400.', '1000.', '1000.'], ['211', '500.', '1000.', '1000.'], ['212', '600.', '1000.', '1000.'], ['213', '700.', '1000.', '1000.'], ['214', '800.', '1000.', '1000.'], ['215', '900.', '1000.', '1000.'], ['216', '1000.', '1000.', '1000.'], ['217', '0.', '0.', '2000.'], ['218', '100.', '0.', '2000.'], ['219', '200.', '0.', '2000.'], ['220', '300.', '0.', '2000.'], ['221', '400.', '0.', '2000.'], ['222', '500.', '0.', '2000.'], ['223', '600.', '0.', '2000.'], ['224', '700.', '0.', '2000.'], ['225', '800.', '0.', '2000.'], ['226', '900.', '0.', '2000.'], ['227', '1000.', '0.', '2000.'], ['228', '0.', '1000.', '2000.'], ['229', '100.', '1000.', '2000.'], ['230', '200.', '1000.', '2000.'], ['231', '300.', '1000.', '2000.'], ['232', '400.', '1000.', '2000.'], ['233', '500.', '1000.', '2000.'], ['234', '600.', '1000.', '2000.'], ['235', '700.', '1000.', '2000.'], ['236', '800.', '1000.', '2000.'], ['237', '900.', '1000.', '2000.'], ['238', '1000.', '1000.', '2000.'], ['239', '0.', '0.', '3000.'], ['240', '100.', '0.', '3000.'], ['241', '200.', '0.', '3000.'], ['242', '300.', '0.', '3000.'], ['243', '400.', '0.', '3000.'], ['244', '500.', '0.', '3000.'], ['245', '600.', '0.', '3000.'], ['246', '700.', '0.', '3000.'], ['247', '800.', '0.', '3000.'], ['248', '900.', '0.', '3000.'], ['249', '1000.', '0.', '3000.'], ['250', '0.', '1000.', '3000.'], ['251', '100.', '1000.', '3000.'], ['252', '200.', '1000.', '3000.'], ['253', '300.', '1000.', '3000.'], ['254', '400.', '1000.', '3000.'], ['255', '500.', '1000.', '3000.'], ['256', '600.', '1000.', '3000.'], ['257', '700.', '1000.', '3000.'], ['258', '800.', '1000.', '3000.'], ['259', '900.', '1000.', '3000.'], ['260', '1000.', '1000.', '3000.'], ['261', '0.', '0.', '4000.'], ['262', '100.', '0.', '4000.'], ['263', '200.', '0.', '4000.'], ['264', '300.', '0.', '4000.'], ['265', '400.', '0.', '4000.'], ['266', '500.', '0.', '4000.'], ['267', '600.', '0.', '4000.'], ['268', '700.', '0.', '4000.'], ['269', '800.', '0.', '4000.'], ['270', '900.', '0.', '4000.'], ['271', '1000.', '0.', '4000.'], ['272', '0.', '1000.', '4000.'], ['273', '100.', '1000.', '4000.'], ['274', '200.', '1000.', '4000.'], ['275', '300.', '1000.', '4000.'], ['276', '400.', '1000.', '4000.'], ['277', '500.', '1000.', '4000.'], ['278', '600.', '1000.', '4000.'], ['279', '700.', '1000.', '4000.'], ['280', '800.', '1000.', '4000.'], ['281', '900.', '1000.', '4000.'], ['282', '1000.', '1000.', '4000.'], ['283', '0.', '0.', '0.'], ['284', '0.', '100.', '0.'], ['285', '0.', '200.', '0.'], ['286', '0.', '300.', '0.'], ['287', '0.', '400.', '0.'], ['288', '0.', '500.', '0.'], ['289', '0.', '600.', '0.'], ['290', '0.', '700.', '0.'], ['291', '0.', '800.', '0.'], ['292', '0.', '900.', '0.'], ['293', '0.', '1000.', '0.'], ['294', '1000.', '0.', '0.'], ['295', '1000.', '100.', '0.'], ['296', '1000.', '200.', '0.'], ['297', '1000.', '300.', '0.'], ['298', '1000.', '400.', '0.'], ['299', '1000.', '500.', '0.'], ['300', '1000.', '600.', '0.'], ['301', '1000.', '700.', '0.'], ['302', '1000.', '800.', '0.'], ['303', '1000.', '900.', '0.'], ['304', '1000.', '1000.', '0.'], ['305', '0.', '0.', '1000.'], ['306', '0.', '100.', '1000.'], ['307', '0.', '200.', '1000.'], ['308', '0.', '300.', '1000.'], ['309', '0.', '400.', '1000.'], ['310', '0.', '500.', '1000.'], ['311', '0.', '600.', '1000.'], ['312', '0.', '700.', '1000.'], ['313', '0.', '800.', '1000.'], ['314', '0.', '900.', '1000.'], ['315', '0.', '1000.', '1000.'], ['316', '1000.', '0.', '1000.'], ['317', '1000.', '100.', '1000.'], ['318', '1000.', '200.', '1000.'], ['319', '1000.', '300.', '1000.'], ['320', '1000.', '400.', '1000.'], ['321', '1000.', '500.', '1000.'], ['322', '1000.', '600.', '1000.'], ['323', '1000.', '700.', '1000.'], ['324', '1000.', '800.', '1000.'], ['325', '1000.', '900.', '1000.'], ['326', '1000.', '1000.', '1000.'], ['327', '0.', '0.', '2000.'], ['328', '0.', '100.', '2000.'], ['329', '0.', '200.', '2000.'], ['330', '0.', '300.', '2000.'], ['331', '0.', '400.', '2000.'], ['332', '0.', '500.', '2000.'], ['333', '0.', '600.', '2000.'], ['334', '0.', '700.', '2000.'], ['335', '0.', '800.', '2000.'], ['336', '0.', '900.', '2000.'], ['337', '0.', '1000.', '2000.'], ['338', '1000.', '0.', '2000.'], ['339', '1000.', '100.', '2000.'], ['340', '1000.', '200.', '2000.'], ['341', '1000.', '300.', '2000.'], ['342', '1000.', '400.', '2000.'], ['343', '1000.', '500.', '2000.'], ['344', '1000.', '600.', '2000.'], ['345', '1000.', '700.', '2000.'], ['346', '1000.', '800.', '2000.'], ['347', '1000.', '900.', '2000.'], ['348', '1000.', '1000.', '2000.'], ['349', '0.', '0.', '3000.'], ['350', '0.', '100.', '3000.'], ['351', '0.', '200.', '3000.'], ['352', '0.', '300.', '3000.'], ['353', '0.', '400.', '3000.'], ['354', '0.', '500.', '3000.'], ['355', '0.', '600.', '3000.'], ['356', '0.', '700.', '3000.'], ['357', '0.', '800.', '3000.'], ['358', '0.', '900.', '3000.'], ['359', '0.', '1000.', '3000.'], ['360', '1000.', '0.', '3000.'], ['361', '1000.', '100.', '3000.'], ['362', '1000.', '200.', '3000.'], ['363', '1000.', '300.', '3000.'], ['364', '1000.', '400.', '3000.'], ['365', '1000.', '500.', '3000.'], ['366', '1000.', '600.', '3000.'], ['367', '1000.', '700.', '3000.'], ['368', '1000.', '800.', '3000.'], ['369', '1000.', '900.', '3000.'], ['370', '1000.', '1000.', '3000.'], ['371', '0.', '0.', '4000.'], ['372', '0.', '100.', '4000.'], ['373', '0.', '200.', '4000.'], ['374', '0.', '300.', '4000.'], ['375', '0.', '400.', '4000.'], ['376', '0.', '500.', '4000.'], ['377', '0.', '600.', '4000.'], ['378', '0.', '700.', '4000.'], ['379', '0.', '800.', '4000.'], ['380', '0.', '900.', '4000.'], ['381', '0.', '1000.', '4000.'], ['382', '1000.', '0.', '4000.'], ['383', '1000.', '100.', '4000.'], ['384', '1000.', '200.', '4000.'], ['385', '1000.', '300.', '4000.'], ['386', '1000.', '400.', '4000.'], ['387', '1000.', '500.', '4000.'], ['388', '1000.', '600.', '4000.'], ['389', '1000.', '700.', '4000.'], ['390', '1000.', '800.', '4000.'], ['391', '1000.', '900.', '4000.'], ['392', '1000.', '1000.', '4000.'], ['393', '-1000.', '0.', '-100.'], ['394', '-1000.', '0.', '0.'], ['395', '-1000.', '0.', '4000.'], ['396', '-1000.', '0.', '4100.'], ['397', '-1000.', '0.', '100.'], ['398', '-1000.', '0.', '200.'], ['399', '-1000.', '0.', '300.'], ['400', '-1000.', '0.', '400.'], ['401', '-1000.', '0.', '500.'], ['402', '-1000.', '0.', '600.'], ['403', '-1000.', '0.', '700.'], ['404', '-1000.', '0.', '800.'], ['405', '-1000.', '0.', '900.'], ['406', '-1000.', '0.', '1000.'], ['407', '-1000.', '0.', '1100.'], ['408', '-1000.', '0.', '1200.'], ['409', '-1000.', '0.', '1300.'], ['410', '-1000.', '0.', '1400.'], ['411', '-1000.', '0.', '1500.'], ['412', '-1000.', '0.', '1600.'], ['413', '-1000.', '0.', '1700.'], ['414', '-1000.', '0.', '1800.'], ['415', '-1000.', '0.', '1900.'], ['416', '-1000.', '0.', '2000.'], ['417', '-1000.', '0.', '2100.'], ['418', '-1000.', '0.', '2200.'], ['419', '-1000.', '0.', '2300.'], ['420', '-1000.', '0.', '2400.'], ['421', '-1000.', '0.', '2500.'], ['422', '-1000.', '0.', '2600.'], ['423', '-1000.', '0.', '2700.'], ['424', '-1000.', '0.', '2800.'], ['425', '-1000.', '0.', '2900.'], ['426', '-1000.', '0.', '3000.'], ['427', '-1000.', '0.', '3100.'], ['428', '-1000.', '0.', '3200.'], ['429', '-1000.', '0.', '3300.'], ['430', '-1000.', '0.', '3400.'], ['431', '-1000.', '0.', '3500.'], ['432', '-1000.', '0.', '3600.'], ['433', '-1000.', '0.', '3700.'], ['434', '-1000.', '0.', '3800.'], ['435', '-1000.', '0.', '3900.'], ['436', '-1000.', '0.', '0.'], ['437', '-900.', '0.', '0.'], ['438', '-800.', '0.', '0.'], ['439', '-700.', '0.', '0.'], ['440', '-600.', '0.', '0.'], ['441', '-500.', '0.', '0.'], ['442', '-400.', '0.', '0.'], ['443', '-300.', '0.', '0.'], ['444', '-200.', '0.', '0.'], ['445', '-100.', '0.', '0.'], ['446', '0.', '0.', '0.'], ['447', '-1000.', '1000.', '0.'], ['448', '-900.', '1000.', '0.'], ['449', '-800.', '1000.', '0.'], ['450', '-700.', '1000.', '0.'], ['451', '-600.', '1000.', '0.'], ['452', '-500.', '1000.', '0.'], ['453', '-400.', '1000.', '0.'], ['454', '-300.', '1000.', '0.'], ['455', '-200.', '1000.', '0.'], ['456', '-100.', '1000.', '0.'], ['457', '0.', '1000.', '0.'], ['458', '-1000.', '1000.', '1000.'], ['459', '-900.', '1000.', '1000.'], ['460', '-800.', '1000.', '1000.'], ['461', '-700.', '1000.', '1000.'], ['462', '-600.', '1000.', '1000.'], ['463', '-500.', '1000.', '1000.'], ['464', '-400.', '1000.', '1000.'], ['465', '-300.', '1000.', '1000.'], ['466', '-200.', '1000.', '1000.'], ['467', '-100.', '1000.', '1000.'], ['468', '0.', '1000.', '1000.'], ['469', '-1000.', '1000.', '2000.'], ['470', '-900.', '1000.', '2000.'], ['471', '-800.', '1000.', '2000.'], ['472', '-700.', '1000.', '2000.'], ['473', '-600.', '1000.', '2000.'], ['474', '-500.', '1000.', '2000.'], ['475', '-400.', '1000.', '2000.'], ['476', '-300.', '1000.', '2000.'], ['477', '-200.', '1000.', '2000.'], ['478', '-100.', '1000.', '2000.'], ['479', '0.', '1000.', '2000.'], ['480', '-1000.', '1000.', '3000.'], ['481', '-900.', '1000.', '3000.'], ['482', '-800.', '1000.', '3000.'], ['483', '-700.', '1000.', '3000.'], ['484', '-600.', '1000.', '3000.'], ['485', '-500.', '1000.', '3000.'], ['486', '-400.', '1000.', '3000.'], ['487', '-300.', '1000.', '3000.'], ['488', '-200.', '1000.', '3000.'], ['489', '-100.', '1000.', '3000.'], ['490', '0.', '1000.', '3000.'], ['491', '-1000.', '0.', '0.'], ['492', '-1000.', '100.', '0.'], ['493', '-1000.', '200.', '0.'], ['494', '-1000.', '300.', '0.'], ['495', '-1000.', '400.', '0.'], ['496', '-1000.', '500.', '0.'], ['497', '-1000.', '600.', '0.'], ['498', '-1000.', '700.', '0.'], ['499', '-1000.', '800.', '0.'], ['500', '-1000.', '900.', '0.'], ['501', '-1000.', '1000.', '0.'], ['502', '-1000.', '1000.', '4000.'], ['503', '-900.', '1000.', '4000.'], ['504', '-800.', '1000.', '4000.'], ['505', '-700.', '1000.', '4000.'], ['506', '-600.', '1000.', '4000.'], ['507', '-500.', '1000.', '4000.'], ['508', '-400.', '1000.', '4000.'], ['509', '-300.', '1000.', '4000.'], ['510', '-200.', '1000.', '4000.'], ['511', '-100.', '1000.', '4000.'], ['512', '0.', '1000.', '4000.'], ['513', '-1000.', '0.', '1000.'], ['514', '-900.', '0.', '1000.'], ['515', '-800.', '0.', '1000.'], ['516', '-700.', '0.', '1000.'], ['517', '-600.', '0.', '1000.'], ['518', '-500.', '0.', '1000.'], ['519', '-400.', '0.', '1000.'], ['520', '-300.', '0.', '1000.'], ['521', '-200.', '0.', '1000.'], ['522', '-100.', '0.', '1000.'], ['523', '0.', '0.', '1000.'], ['524', '-1000.', '0.', '2000.'], ['525', '-900.', '0.', '2000.'], ['526', '-800.', '0.', '2000.'], ['527', '-700.', '0.', '2000.'], ['528', '-600.', '0.', '2000.'], ['529', '-500.', '0.', '2000.'], ['530', '-400.', '0.', '2000.'], ['531', '-300.', '0.', '2000.'], ['532', '-200.', '0.', '2000.'], ['533', '-100.', '0.', '2000.'], ['534', '0.', '0.', '2000.'], ['535', '-1000.', '0.', '3000.'], ['536', '-900.', '0.', '3000.'], ['537', '-800.', '0.', '3000.'], ['538', '-700.', '0.', '3000.'], ['539', '-600.', '0.', '3000.'], ['540', '-500.', '0.', '3000.'], ['541', '-400.', '0.', '3000.'], ['542', '-300.', '0.', '3000.'], ['543', '-200.', '0.', '3000.'], ['544', '-100.', '0.', '3000.'], ['545', '0.', '0.', '3000.'], ['546', '-1000.', '0.', '4000.'], ['547', '-900.', '0.', '4000.'], ['548', '-800.', '0.', '4000.'], ['549', '-700.', '0.', '4000.'], ['550', '-600.', '0.', '4000.'], ['551', '-500.', '0.', '4000.'], ['552', '-400.', '0.', '4000.'], ['553', '-300.', '0.', '4000.'], ['554', '-200.', '0.', '4000.'], ['555', '-100.', '0.', '4000.'], ['556', '0.', '0.', '4000.'], ['557', '-1000.', '0.', '1000.'], ['558', '-1000.', '100.', '1000.'], ['559', '-1000.', '200.', '1000.'], ['560', '-1000.', '300.', '1000.'], ['561', '-1000.', '400.', '1000.'], ['562', '-1000.', '500.', '1000.'], ['563', '-1000.', '600.', '1000.'], ['564', '-1000.', '700.', '1000.'], ['565', '-1000.', '800.', '1000.'], ['566', '-1000.', '900.', '1000.'], ['567', '-1000.', '1000.', '1000.'], ['568', '-1000.', '0.', '3000.'], ['569', '-1000.', '100.', '3000.'], ['570', '-1000.', '200.', '3000.'], ['571', '-1000.', '300.', '3000.'], ['572', '-1000.', '400.', '3000.'], ['573', '-1000.', '500.', '3000.'], ['574', '-1000.', '600.', '3000.'], ['575', '-1000.', '700.', '3000.'], ['576', '-1000.', '800.', '3000.'], ['577', '-1000.', '900.', '3000.'], ['578', '-1000.', '1000.', '3000.'], ['579', '-1000.', '0.', '2000.'], ['580', '-1000.', '100.', '2000.'], ['581', '-1000.', '200.', '2000.'], ['582', '-1000.', '300.', '2000.'], ['583', '-1000.', '400.', '2000.'], ['584', '-1000.', '500.', '2000.'], ['585', '-1000.', '600.', '2000.'], ['586', '-1000.', '700.', '2000.'], ['587', '-1000.', '800.', '2000.'], ['588', '-1000.', '900.', '2000.'], ['589', '-1000.', '1000.', '2000.'], ['590', '-1000.', '0.', '4000.'], ['591', '-1000.', '100.', '4000.'], ['592', '-1000.', '200.', '4000.'], ['593', '-1000.', '300.', '4000.'], ['594', '-1000.', '400.', '4000.'], ['595', '-1000.', '500.', '4000.'], ['596', '-1000.', '600.', '4000.'], ['597', '-1000.', '700.', '4000.'], ['598', '-1000.', '800.', '4000.'], ['599', '-1000.', '900.', '4000.'], ['600', '-1000.', '1000.', '4000.'], ['601', '-1000.', '1000.', '-100.'], ['602', '-1000.', '1000.', '0.'], ['603', '-1000.', '1000.', '4000.'], ['604', '-1000.', '1000.', '4100.'], ['605', '-1000.', '1000.', '100.'], ['606', '-1000.', '1000.', '200.'], ['607', '-1000.', '1000.', '300.'], ['608', '-1000.', '1000.', '400.'], ['609', '-1000.', '1000.', '500.'], ['610', '-1000.', '1000.', '600.'], ['611', '-1000.', '1000.', '700.'], ['612', '-1000.', '1000.', '800.'], ['613', '-1000.', '1000.', '900.'], ['614', '-1000.', '1000.', '1000.'], ['615', '-1000.', '1000.', '1100.'], ['616', '-1000.', '1000.', '1200.'], ['617', '-1000.', '1000.', '1300.'], ['618', '-1000.', '1000.', '1400.'], ['619', '-1000.', '1000.', '1500.'], ['620', '-1000.', '1000.', '1600.'], ['621', '-1000.', '1000.', '1700.'], ['622', '-1000.', '1000.', '1800.'], ['623', '-1000.', '1000.', '1900.']]
dic1=defaultdict(list)

for id,x,y,z in data1:
    dic1[(x,y)].append((id,z))

#sort
for key in dic1:
    dic1[key].sort( key=lambda x:float(x[1]) )

for i,row in enumerate(data2):
    id,x,y,z=row
    z_levels=[item[1] for item in dic1[(x,y)]]
    for k,l in zip(z_levels,z_levels[1:]):
       if k<=z<=l:
            #do something here 
            #data2[i][1]=None  #change x co-ordinate
            #data2[i][2]=None  #change y co-ordinate
            break
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

映射并使用 (X, Y)、(X,Z) 和 (Y,Z) 对以及关联的 X、Y 或 Z 坐标 的相关文章

随机推荐

  • 如何在Django中使用CreateView进行多个文件的上传?

    请帮我 我是 Django 新手 无法理解以下内容 我有 CreateView 的子类用于创建评论 我想创建一个项目 人们可以在其中留下评论并将文件 图像 附加到该评论中 人们应该可以在一张带有文本注释的表格上附加尽可能多的图像 我在互联网
  • 如何在 SwiftUI 中包装和使用 MarqueeLabel?

    我正在尝试在 SwiftUI 中向文本 歌曲名称 添加选取框效果 以便它在大于屏幕宽度时在屏幕上水平滚动 I know 跑马灯标签 https github com cbpowell MarqueeLabel可用于 UIKit 但我无法将其
  • ViewPager 显示 Fragment 时出现问题

    我正在尝试使用 ViewPager 获取包含三个选项卡的片段 最初 我使用 FragmentMgr 从 Activity 实例化片段 效果很好 当我使用 ViewPager 转换此导航时 此 Fragment 不再显示 MainActivi
  • 如何以编程方式将文件上传到网站?

    我必须将文件上传到服务器 该服务器仅公开带有文件上传按钮的 jsf 网页 通过 http 我必须自动化一个进程 作为java独立进程完成 该进程生成一个文件并将文件上传到服务器 遗憾的是 必须上传文件的服务器不提供FTP或SFTP 有没有办
  • 如何检测已更改的网页?

    在我的应用程序中 我使用 LWP 定期获取网页 无论如何 是否要检查两次连续提取之间网页是否在某些方面发生了变化 除了明确进行比较之外 是否有在较低协议层生成的任何签名 例如 CRC 可以提取并与旧签名进行比较以查看可能的更改 有两种可能的
  • Java中的重载方法[重复]

    这个问题在这里已经有答案了 必须满足哪些条件才能使两个方法正确地成为重载方法 两个方法是否至少必须在参数列表上有所不同 例如 public void A public void A int val 因此 仅更改返回类型和 或访问修饰符不会产
  • 如何在 GWT 中实现登录屏幕?

    我正在为后端应用程序编写一个小型 GWT 前端 我想知道 GWT 应用程序的最佳安全模型是什么 我正在考虑实现一种 RPC 方法 该方法从客户端网页接收用户密码的 MD5 然后将会话 ID 传回客户端页面 或失败代码 所有后续调用都将简单地
  • 参数验证最佳实践

    想象一下你有一个应用程序是某种前端您所有的业务逻辑 该前端有很多依赖的 DLL 并且这些 DLL 中的方法可能会在前端执行一次给定方法时重复相互调用 如果您的应用程序的用户不直接访问这些 DLL 您是否应该 1 冒着 小 性能下降的风险并验
  • 举例说明为什么不建议将图像存储在 CoreData 中?

    这个问题已经被问过很多次了 我读到很多用户都说不建议将图像存储在数据库中 特别是在 CoreData 中 他们似乎都忽略了他们这样做的原因 甚至苹果文档也声明了这一点 每个人都指向那个方向 每次讨论都以这样的方式结束 好吧 你可以 但存储路
  • 使用 kwargs 时如何转义 Python format() 中的冒号?

    我有一本想要打印的字典 其键中带有冒号 不幸的是 冒号字符用于格式化 所以我需要以某种方式转义它 例如 gt gt gt d hello world with colon moo gt gt gt hello format d world
  • 如何改变CSS切换开关的大小

    我正在为一个名为 elementor 的插件设计一个元素 这个项目实际上只是为了帮助我学习 WordPress 开发的功能 我正在制作一个 切换内容 滑块 可以在文本或预定义的 html 之间切换 我根据本指南使用了滑块 https www
  • 当手机进入待机状态(屏幕关闭状态)时,活动识别停止接收更新

    我在活动识别方面遇到一些问题 我已经在应用程序中实现了它 当设备屏幕打开时它工作正常 我的活动识别意图服务类中有一个日志条目 我可以看到它何时获得更新 所以 我知道当屏幕打开时它工作正常 但是 当手机进入待机状态 屏幕关闭 后 它会停止检测
  • Vim ":source %" 命令导致错误 (E499)

    Stack Overflow vim 用户大家好 我最近发现自己花了相当多的时间在学校的计算机科学实验室编写代码 我在无数的linux系统上配置过vim 从来没有遇到过这个错误 E499 Empty file name for or onl
  • 离子标签栏与主页按钮重叠(iPhone X - iOS 11)

    使用 iOS 11 和 iPhone X苹果指定 https developer apple com ios human interface guidelines overview iphone x 每个应用程序都应该位于 安全区域 由于虚
  • 内容处置:ASP.Net 中的内联 PDF 文件不起作用

    我正在尝试将带有标题的 PDF 文件返回到浏览器Content Dispostion inline就在我创建这个文件之后 浏览器的查看者无法打开它 文件没有损坏 如果我放入浏览器 查看器会正确显示文件 但我想一次性创建文件并检查用户对文件的
  • 支持链接方法的模拟对象

    我想知道是否有一种相当简洁的方法来模拟支持方法链接的对象 例如 数据库查询对象可能有一个如下所示的方法调用 result database gt select my table gt where array my field gt a va
  • 当通过 JS 事件加载新页面时,如何使 Selenium WebDriver 等待页面加载

    我正在致力于自动化一个网站 该网站有许多链接 可以通过 JS 事件加载新页面 基本上 有些元素是可点击的 点击其中一个会导致一些 JavaScript 运行 这会导致表单被提交并路由到新页面 现在 如果这些只是标准的 HTML 链接 那就没
  • ImportError:IDLE 中没有名为 matplotlib 的模块

    当我想在 IDLE 中导入 matplotlib 时 出现以下错误 ImportError No module named matplotlib 我使用mac 我的bash profile中python的PATH是 Setting PATH
  • 如何在 Haskell 中枚举递归数据类型?

    这篇博文 http lukepalmer wordpress com 2008 05 02 enumerating a context free language 对于如何使用 Omega monad 对角枚举任意语法有一个有趣的解释 他提
  • 映射并使用 (X, Y)、(X,Z) 和 (Y,Z) 对以及关联的 X、Y 或 Z 坐标

    我有一个清单清单nLedgers 3D 点云 nodeID X Y Z 具有多行 有些节点会有相同的X and Y坐标和不同Z协调 我想首先确定不同的Z具有相同坐标的X and Y坐标 那么同样对于X 最后为Y 然后 使用那些 X Y X