-
Notifications
You must be signed in to change notification settings - Fork 18
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
tab data format #12
Comments
xarray provides a very convenient format for this type of data. if you pass a pandas dataframe with an appropriate multiindexed dataframe as input everything works out nicely: tab=pyfas.tab.Tab("PVTtable.tab") columns=tab.data["Property"].values series={} new_p=[] for p in tab.metadata['p_array'][0]: index=zip(new_p, new_t) #creates a list of tuples which can be used in a multiindex df=pd.DataFrame(series, index=index) #creates a dataframe from the tab data with pressure and temperature as index The dataarray will have pressure and temperature as dimensions, and each column in the dataframe as a variable. The datarray allows you to do things like fast linear interpolation (e.g. da.interp(T=50, P=[50, 60, 70])["LIQUID DENSITY"]) which is extremely useful especially when comparing tables with different spacing between input parameters. |
thanks for the suggestion, it looks very interesting. Also here if you have the possibility a PR would be quite useful since you know |
Has this issue been addressed with #23? |
Yes, it was
Cheers
Il giorno mer 26 apr 2023 alle ore 15:18 daniel-brett <
***@***.***> ha scritto:
… Has this issue been addressed with #23
<#23>?
—
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD2WTVRC6D2XNHTBUU7YNI3XDEOC3ANCNFSM4CQ5NGUA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
the tab.data dataframe is difficult to handle (properties as index), its structure should be changed
The text was updated successfully, but these errors were encountered: