Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TableXYZ_Processing_3D
#1
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.
Reply
#2
Your description is very difficult to follow, and you never asked a question.  If you are looking for someone to write the code for you, you need to post it in the "Jobs" section, otherwise you need to post the code you've written so far and any error Traceback reports.  Knowing what type of file you're dealing with would be helpful. Is it a plain csv file, an excel type file, a database?  A small sample of the file would also be useful.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020