Open Leguark opened 3 years ago
@Leguark I'm just getting to know the striplog and Markov Chain object preferences and wondering if you can suggest how you'd clean up a log in the form of a pandas table with well, top, base, log. Based on @kwinkunks notebook it looks like a .GroupBy or .to_json might be the way to go.
Something like this, I suppose:
df.dropna(how='any').groupby('well')['log'].apply(lambda x: x.to_json(orient='records'))
From dict method
I have added a method to be able to pass directly a python dictionary. It is just a simplification of the method
from_csv
. Since I created the pull request someone else has created anotherfrom_dict
method. I just renamed my contribution tofrom_dict_advance
since it does more post processing.I am using this in subsurface to be able to first read a table with pandas, clean it and then converting the pandas dataframe to a valid dictionary that striplog understands.
Supporting integer as formation name
Component
objects with different integers was always comparing them as True.This is the test that needs all of the mention here: https://github.com/softwareunderground/subsurface/blob/6543c9924dcfd5d67068069f2a6fc1f9e17f5ef5/tests/test_io/test_welly_to_subsurface.py#L420