def imshow_anova_pairs(self, log=True, **kargs): N = len(self.df.columns) # could use a dataframe straight way ? res = np.ones((N, N)) for i, col1 in enumerate(self.df.columns): for j, col2 in enumerate(self.df.columns): d1 = self.df[col1] d2 = self.df[col2] F, P = scipy.stats.f_oneway(*[d1, d2]) res[i][j] = P df = pd.DataFrame(res, index=self.df.columns, columns=self.df.columns) #FIXME: may have na, which are set to 1 df = df.fillna(1) from biokit.viz import imshow if log == True: imshow(-np.log10(df), **kargs) else: imshow(df, **kargs) return df
def imshow_anova_pairs(self, log=True, **kargs): N = len(self.df.columns) # could use a dataframe straight way ? res = np.ones((N, N)) for i, col1 in enumerate(self.df.columns): for j, col2 in enumerate(self.df.columns): d1 = self.df[col1] d2 = self.df[col2] F, P = scipy.stats.f_oneway(*[d1, d2]) res[i][j] = P df = pd.DataFrame(res, index=self.df.columns, columns=self.df.columns) # FIXME: may have na, which are set to 1 df = df.fillna(1) from biokit.viz import imshow if log == True: imshow(-np.log10(df), **kargs) else: imshow(df, **kargs) return df
def test_viz_imshow(): from pandas import DataFrame df = DataFrame({'a':[1,2], 'b':[3,4]}) imshow(df)