<jupyter_start><jupyter_text>酒精产量<jupyter_code>df = pd.read_csv("sorghum/ethanol_prod.csv")
display(df)
def one_way(column):
    display(df.keys()[column])
    df1 = pd.DataFrame(np.zeros([4,6], np.float32), columns=[str(x+1) for x in range(6)])
    i = 0
    # 每列每4个元素属于一个品种
    for c in range(6):
        for r in range(4):
            df1.iloc[r, c] = df.iloc[c*4 + r,column]
    display(df1)

    mx = pd.DataFrame(np.zeros([6,6], np.float32), index=df1.keys(), columns=df1.keys())
    for k1 in df1.keys():
        for k2 in df1.keys():
            Fv, pv = stats.f_oneway(df1[k1], df1[k2])
            mx[k1][k2] = pv
    display(mx)
    display('p <= 0.05:')
    display(mx<=0.05)
    display('p <= 0.01:')
    display(mx<=0.01)
one_way(0)
one_way(1)
one_way(2)
one_way(3)<jupyter_output><empty_output><jupyter_text>ethanol vs weight loss<jupyter_code>df_ethanol = pd.read_csv("sorghum/ethanol_prod.csv")

df = pd.read_csv("sorghum/weight_loss.csv")
df = df.loc[:, 'Var 1_72h':'Var 6_144h']
df = df.apply(lambda x: x.astype(str).str.replace(',','.').astype(float))
df
avg_weight_loss = df.mean(axis=0)
avg_72 = avg_weight_loss.loc['Var 1_72h':'Var 6_72h']
avg_144 = avg_weight_loss.loc['Var 1_144h':'Var 6_144h']
display(avg_72)
display(avg_144)
def avg_ethanol(column):
    display(df_ethanol.keys()[column])
    df1 = pd.DataFrame(np.zeros([4,6], np.float32), columns=[str(x+1) for x in range(6)])
    i = 0
    # 每列每4个元素属于一个品种
    for c in range(6):
        for r in range(4):
            df1.iloc[r, c] = df_ethanol.iloc[c*4 + r,column]
    display(df1)
    avg = df1.mean(axis=0)
    display(avg)
    ethanol_weight_loss = pd.DataFrame({'ethanol': avg.values, 'weight_loss': avg_72.values if column==0 else avg_144.values})
    # 相关系数，显著性区别
    stat = stats.pearsonr(ethanol_weight_loss['ethanol'], ethanol_weight_loss['weight_loss'])
    display(stat)
    sns.regplot(x='ethanol', y='weight_loss', data=ethanol_weight_loss)
avg_ethanol(0)
avg_ethanol(1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17384769539078157, 'fraction_numerical': 0.05110220440881764, 'mean_word_length': 4.094387755102041, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '564121', 'license': 'MIT', 'n_tokens_mistral': 931, 'n_tokens_neox': 870, 'n_words': 137, 'path': 'correlation/ethanol_prod.ipynb', 'repo_name': 'dyonghan/statistics', 'size': '1996'}