def check_pickle(obj): fh =StringIO() cPickle.dump(obj, fh) plen = fh.pos fh.seek(0,0) res = cPickle.load(fh) fh.close() return res, plen
6.0 2 2 8 7.0 2 2 9 9.0 2 2 10 10.0 2 3 1 8.0 2 3 2 12.0 2 3 3 3.0 2 3 4 7.0 2 3 5 15.0 2 3 6 4.0 2 3 7 9.0 2 3 8 6.0 2 3 9 1.0 2 3 10 """) kidney_table.seek(0) kidney_table = read_csv(kidney_table, sep="\s+", engine='python').astype(int) class TestAnovaLM(object): @classmethod def setup_class(cls): # kidney data taken from JT's course # don't know the license cls.data = kidney_table cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight)', data=cls.data).fit() def test_results(self): Df = np.array([1, 2, 2, 54]) sum_sq = np.array([2.339693, 16.97129, 0.6356584, 28.9892])
6.0 2 2 8 7.0 2 2 9 9.0 2 2 10 10.0 2 3 1 8.0 2 3 2 12.0 2 3 3 3.0 2 3 4 7.0 2 3 5 15.0 2 3 6 4.0 2 3 7 9.0 2 3 8 6.0 2 3 9 1.0 2 3 10 """) kidney_table.seek(0) kidney_table = read_csv(kidney_table, sep="\s+", engine='python').astype(int) class TestAnovaLM(object): @classmethod def setup_class(cls): # kidney data taken from JT's course # don't know the license cls.data = kidney_table cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight)', data=cls.data).fit() def test_results(self): Df = np.array([1, 2, 2, 54]) sum_sq = np.array([2.339693, 16.97129, 0.6356584, 28.9892]) mean_sq = np.array([2.339693, 8.485645, 0.3178292, 0.536837])