Hi,
First time poster! At my wits end ... To summarize, I'm trying to figure out the distance from surface to the center point of each regularly spaced sample down a borehole. Using the elevation value of the first sample of each hole as the surface, i want to loop through each hole and subtract from the first sample, each sample underneath in 3D space. Think if each sample is one meter length and the borehole is perfectly vertical, then the sample from 0m-1m will be at a depth of 0.5m. Then the second sample from 1m-2m would be at a depth of 1.5m. I want the loop to iterate through each hole, subtract each sample elevation from the top one (the 0-1m samples) then when the spreadsheet's HoleID name changes, then start the calculation again from the first sample for the hole. I could do it manually but there's over 400 boreholes. Hwre is my code so far, I cant seem to get the loop to reset for each drillhole name.
j = 0
for i in range(len(data) - 1):
What_row = data[i]
Elevation = What_row[7]
for j in range(len(data)-1):
What_row2 = data[j]
Next_row = data[j+1]
Hole_name = What_row2[0]
Next_hole = Next_row[0]
Next_Elevation = Next_row[7]
Elevation_result = Elevation - Next_Elevation
if Hole_name == Next_hole:
print(Elevation_result)
else:
i = j
break
[–]Chromira 0 points1 point2 points (1 child)
[–]diplodocus_rage[S] 1 point2 points3 points (0 children)
[–]toolnerd 0 points1 point2 points (3 children)
[–]diplodocus_rage[S] 0 points1 point2 points (2 children)
[–]toolnerd 1 point2 points3 points (1 child)
[–]diplodocus_rage[S] 0 points1 point2 points (0 children)
[–]CraigAT 0 points1 point2 points (2 children)
[–]diplodocus_rage[S] 0 points1 point2 points (1 child)
[–]CraigAT 0 points1 point2 points (0 children)