How to do Friedman test and post--hoc test on Python? I know that Python's SciPy library has the function for the Friedman test
But, it is not enough as I need more information for posthoc test.
So, how I do Friedman test and post-hoc test entirely on Python?
 A: You pretty much have to write the code for the test. There's no one function churns out everything like in R or SAS. Place your values in a data.frame :
from scipy.stats import friedmanchisquare, wilcoxon
import numpy as np
import pandas as pd
import itertools

np.random.seed(0)
df = pd.DataFrame(np.random.randint(0,10,(100,3),),columns=['var1','var2','var3'])

Then apply the friedman:
f_test = friedmanchisquare(df['var1'],df['var2'],df['var3'])
f_res = pd.DataFrame({'test':'Friedman','statistic':f_test[0],'pvalue':f_test[0]},index=[0])

Run the pairwise wilcoxon using itertools:
wilc_test = [wilcoxon(df[i],df[j]) for i,j in itertools.combinations(df.columns,2)]    
w_res = pd.DataFrame(wilc_test)
w_res['test'] = ["wilcoxon " + i+" vs "+j for i,j in itertools.combinations(df.columns,2)]

Put together the results:
pd.concat([f_res,w_res])

    test    statistic   pvalue
0   Friedman    0.348066    0.348066
0   wilcoxon var1 vs var2   1894.500000 0.790878
1   wilcoxon var1 vs var3   1817.500000 0.682058
2   wilcoxon var2 vs var3   1866.000000 0.838556

