bib-paper/scripts/investigate_flowrate_difference.py
2025-09-28 16:03:18 +02:00

29 lines
769 B
Python

from scipy.stats import mannwhitneyu
import pandas as pd
import numpy as np
filename_left = "res/flowrate_left.csv"
filename_right = "res/flowrate_right.csv"
filename_both = "res/flowrate_both.csv"
def main():
df_left = pd.read_csv(filename_left)
flowrate_left = np.array(df_left["flowrate"])
df_right = pd.read_csv(filename_right)
flowrate_right = np.array(df_right["flowrate"])
df_both = pd.read_csv(filename_both)
flowrate_both = np.array(df_both["flowrate"])
U_lr, p_lr = mannwhitneyu(flowrate_left, flowrate_both, method="exact")
U_rb, p_rb = mannwhitneyu(flowrate_right, flowrate_both, method="exact")
print(f"Left-Right: p = {p_lr}")
print(f"Right-Both: p = {p_rb}")
if __name__ == "__main__":
main()