-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include curve unit in LASFile.df() column names #434
Comments
Thanks @issimo007 - that's a great suggestion for a feature! It's not available at the moment. For now you could achieve what you want with this code instead of def las_to_df_with_units(las):
column_mapper = {
c.mnemonic: f"{c.mnemonic} ({c.unit})"
for c in las.curves
}
return (
las.df()
.reset_index()
.rename(columns=column_mapper)
.set_index(list(column_mapper.values())[0])
)
import lasio.examples
las = lasio.examples.open("sample.las")
df = las_to_df_with_units(las)
print(df)
|
Thank you Kent! I couldn't figure out how to access the units once imported into lasio. All the best, Mauro. |
kinverarity1
changed the title
Data frame header with both Mnemonic and Unit
Obtain as pd.DataFrame with mnemonic and unit in column name
Apr 7, 2021
kinverarity1
changed the title
Obtain as pd.DataFrame with mnemonic and unit in column name
Include curve unit in LASFile.df() column names
Apr 9, 2021
This could be added to the LASFile.df method as a keyword argument e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I tried looking around all day but couldn't find a way to use the "las.df()" command in a way that would generate a dataframe header that includes the "mnemonic (unit)". If anyone has a suggestion it is greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: