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

Get results as pandas dataframe? #128

Open
JohannesWiesner opened this issue Aug 29, 2023 · 0 comments
Open

Get results as pandas dataframe? #128

JohannesWiesner opened this issue Aug 29, 2023 · 0 comments

Comments

@JohannesWiesner
Copy link

After running apply_and_annotate it would come in handy, if one could obtain the results as a pandas dataframe (like in pingouin). Right now I do this manually by doing something like (not a MRE, just to give you an intution!):

_, results = annotator.apply_and_annotate()

# extract results as data frame
results_pretty = []

for result in results:
    group_1 = result.data.group1
    group_2 = result.data.group2
    stat_value = result.data.stat_value
    pvalue = result.data.pvalue
    receptor = group_1[0]
    sig = result.text
    results_pretty.append((receptor,stat_value,pvalue,sig))
    
results_pretty = pd.DataFrame(results_pretty,columns=['receptor','U','p','sig'])
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