Hi everybody!
Firstly, many thanks to the ones who are gonna read this post.
I just registered on this forum because I have a question about a Python code. I'm a really beginner in coding but I need it, to develop a method reproducible with other data.
I have a table with LA_ID as Identification for each layer. These layer belongs to one object (called BH_Id). For example, the 20 first objects LA_ID_1 -> LA_ID_20) belong to the object "B1000").
I have one column called "QC".
Another column called "Thick_345": this column is supposed to receive the calculated value.
What I would like to do, is to subtract the Max of TopZ with the Min of the BotZ in each BH_ID, but only when QC is equivalent to "345" and when they are continues.
For example, for B1000, I would like to calculate the thickness from "LA_ID_7" to "LA_ID_18", then to calculate "LA_20 to LA_21" and this for all QC equivalent to 345.
Where the QC is not "345", then, calculated value can be "0". The expected result is:
-"LA_ID_7" to "LA_ID_18": 28.5 m
-"LA_20 to LA_21": 18.5 m
I work with Python v2.7.5
Attached is the csv file.
Many thanks for your help
Edit admin:
Next time don't post image use code tag,or a link to csv file.
Firstly, many thanks to the ones who are gonna read this post.
I just registered on this forum because I have a question about a Python code. I'm a really beginner in coding but I need it, to develop a method reproducible with other data.
I have a table with LA_ID as Identification for each layer. These layer belongs to one object (called BH_Id). For example, the 20 first objects LA_ID_1 -> LA_ID_20) belong to the object "B1000").
I have one column called "QC".
Another column called "Thick_345": this column is supposed to receive the calculated value.
What I would like to do, is to subtract the Max of TopZ with the Min of the BotZ in each BH_ID, but only when QC is equivalent to "345" and when they are continues.
For example, for B1000, I would like to calculate the thickness from "LA_ID_7" to "LA_ID_18", then to calculate "LA_20 to LA_21" and this for all QC equivalent to 345.
Where the QC is not "345", then, calculated value can be "0". The expected result is:
-"LA_ID_7" to "LA_ID_18": 28.5 m
-"LA_20 to LA_21": 18.5 m
I work with Python v2.7.5
Attached is the csv file.
Many thanks for your help
Edit admin:
Next time don't post image use code tag,or a link to csv file.