def test_binify(self, splicing_data): from flotilla.compute.infotheory import binify test_binned = splicing_data.binify(splicing_data.data) true_binned = binify(splicing_data.data, splicing_data.bins) true_binned = true_binned.dropna(how='all', axis=1) pdt.assert_frame_equal(test_binned, true_binned)
def test_binify(bins, df1): from flotilla.compute.infotheory import bin_range_strings, binify binned = binify(df1, bins) true_binned = df1.apply(lambda x: pd.Series(np.histogram(x, bins=bins)[0])) true_binned.index = bin_range_strings(bins) true_binned = true_binned / true_binned.sum().astype(float) pdt.assert_frame_equal(binned, true_binned)
def test_binify(self, splicing): from flotilla.compute.infotheory import binify test_binned = splicing.binify(splicing.data) true_binned = binify(splicing.data, splicing.bins) true_binned = true_binned.dropna(how='all', axis=1) pdt.assert_frame_equal(test_binned, true_binned)
def q(df2, bins): from flotilla.compute.infotheory import binify return binify(df2, bins)