Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/d/r/dragnet-HEAD/dragnet/data_processing.py   dragnet(Download)
                # count of extracted blocks in each bin
                h = Histogram1DFast(bins, 0, 1)
                h.update_counts(block_percent, extracted_flag)
                extracted_counts = h.bin_count
 
                if c == 'content':  # token count same for content, comments
                    h = Histogram1DFast(bins, 0, 1)
                    h.update_counts(block_percent, overall_token_count)
                    token_count = h.bin_count
                    block_length_vs_block_percent[datum_number, :] = token_count.astype(np.float) / total_counts

src/m/o/mozsci-HEAD/test/test_histogram.py   mozsci(Download)
        xc = np.array([1.5, 2.5, 8.3])
        cc = np.array([10, 5, 22])
        h.update_counts(xc, cc)
        self.assertTrue((h.bin_count == np.array([3, 10, 5, 1, 0, 0, 0, 0, 23, 2])).all())
 
    def test_stratified_sample(self):
        hist = histogram.Histogram1DFast(5, 0, 5)
        hist.update_counts(np.array([0.5, 1.5, 2.5, 3.5, 4.5]),
                           np.array([5e6, 1e6, 1e4, 1e3, 2]))