Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to derive the difference in layer intervals in wells?

$
0
0
wells = [    [[0, 4, 'soil'], [4, 8, 'clay']],    [[0, 4, 'soil'], [4, 16, 'sand']]]layers = ('soil', 'clay', 'sand')

i need to write code that will show the difference in depth:

the logic is as follows:

'soil' is in the first and second lists, so we write the list [-4, -4] into the results list.

'clay' is only in the first list, we write [-4, 0], because the final interval 'clay' (8) minus the final interval of the previous interval in this list 'soil' (4) = -4, and in the second well ' clay 'no, so we write 0.

'sand' is only in the second list, write [0, -8], because 'sand' is only in the second list, which means the first number is 0, and the ending interval 'sand' (16) minus the ending interval of the previous interval in this list 'soil' (4) = -8

the result should be like this, it is bound to the list of layers layers: [[-4, -4], [-4, 0], [0, -8]]


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>