Ejemplo n.º 1
0
    def test_histogramdd_5(self):

        np.random.seed(8765)
        r = np.random.randint(10, 30, 300000)

        x = nptest.histogramdd(r.reshape(-1, 4),
                               bins=np.array([2, 2, 2, 2]),
                               range=[(15, 25), (15, 25), (15, 25), (15, 25)])
        print(x)

        x = nptest.histogramdd(r.reshape(-1, 4),
                               bins=np.array([2.0, 2.0, 2.0, 2.0]),
                               range=[(20, 20), (20, 20), (20, 20), (20, 20)])
        print(x)

        x = np.histogramdd(r.reshape(-1, 2),
                           bins=np.array([3, 3]),
                           density=True,
                           range=[(15, 25), (15, 25)])
        print(x)

        x = np.histogramdd(r.reshape(-1, 3),
                           bins=np.array([4, 4, 4]),
                           density=False,
                           range=[(15, 25), (15, 25), (15, 25)])
        print(x)
Ejemplo n.º 2
0
    def test_histogramdd_4(self):

        np.random.seed(8765)
        r = np.random.randint(10, 30, 300000)

        x = nptest.histogramdd(r.reshape(-1, 4),
                               bins=3,
                               range=[(15, 25), (15, 25), (15, 25), (15, 25)])
        print(x)

        print("")
        print("*******************")
        print("")

        x = nptest.histogramdd(r.reshape(-1, 2),
                               bins=2,
                               normed=True,
                               range=[(15, 25), (15, 25)])
        print(x)
Ejemplo n.º 3
0
    def test_histogramdd_3(self):

        np.random.seed(8765)
        r = np.random.randint(10, 30, 300000)

        weights = np.arange(300000 / 4, dtype=np.float64)
        weights.fill(0.5)

        x = nptest.histogramdd(r.reshape(-1, 4),
                               bins=[2, 2, 2, 2],
                               range=[(15, 25), (15, 25), (15, 25), (15, 25)],
                               weights=weights)
        print(x)
Ejemplo n.º 4
0
    def test_histogramdd_1(self):

        np.random.seed(8765)
        r = np.random.randint(10, 30, 3000)

        x = np.histogramdd(r.reshape(-1, 4), bins=[2, 2, 2, 2])
        print(x)

        x = nptest.histogramdd(r.reshape(-1, 4), bins=[2.0, 2.0, 2.0, 2.0])
        print(x)

        x = np.histogramdd(r.reshape(-1, 2), bins=[3, 3], density=True)
        print(x)

        x = np.histogramdd(r.reshape(-1, 3), bins=[4, 4, 4], density=False)
        print(x)