definitely possible. the exact approach may vary - e.g. what packages you use/are ready to use, etc.
for example, using pandas
for example, using pandas
import pandas data = [(123, 'RH', 'a', 'b'), (123, 'RH', 'x', 'y'), (234, 'RH', 'a', 'c')] df = pandas.DataFrame(data, columns=['HOLEID', 'PROJECT', 'name', 'value']) pivot = df.pivot_table(index=('HOLEID', 'PROJECT'), columns=('name'), values=['value'], aggfunc=lambda x: x) print(pivot)
Output:name a x
HOLEID PROJECT
123 RH b y
234 RH c NaN
Of course you can always iterate over data and construct appropriate data structure yourself
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs