pass variable length argument to mstats.kruskalwallis
i solved using 

def kruskawallis_test(column):
    k_test=train.loc[:,[column,'SalePrice']]
    x=pd.pivot_table(k_test,index=k_test.index, values='SalePrice',columns=column)

    for i in range(x.shape[1]):
        var[i]=x.iloc[:,i]
        var[i]=var[i][~var[i].isnull()].tolist()

#     s=""
#     for i in range(x.shape[1]):
#         s=s+'var{}'.format(i)+','

    m=()
    for i in range(x.shape[1]):
        m=m+(var[i],)


    args=(m)


    H, pval = mstats.kruskalwallis(*args)

    return pval



i did
m=()
    for i in range(x.shape[1]):
        m=m+(var[i],)

args=(m)


by adding as many vars[i] in wanted to pass as argument of an empty tupple which i later passed to

mstats.kruskalwallis(*args)


*args helped mr pass variable length parameter.

please reply if you can suggest a better way.