Skip to content
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

From dataframe #972

Open
mortonjt opened this issue Jun 14, 2024 · 0 comments
Open

From dataframe #972

mortonjt opened this issue Jun 14, 2024 · 0 comments

Comments

@mortonjt
Copy link
Contributor

One of the most common conversions to biom tables is from pandas data frames. Thus, having a Table.from_dataframe command would be a strong utility. As a first pass, the following can be done

@staticmethod
def from_dataframe(self, df):
    """ pd.DataFrame with rows as samples and features as columns. """
    return biom.Table(df.values.T, df.columns, df.index)

I find myself copying / pasting this command quite often. So having this embedded within biom would be low hanging fruit, but slightly ease analysis effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant