def test_insert_2():
    x = np.array([1, 2, 3])
    y = np.insert(x, 0, 4)
    z = nw.insert(x, 0, 4)
    assert_almost_equal(y, z)
예제 #2
0
def test_insert_2():
    x = np.array([1, 2, 3])
    y = np.insert(x, 0, 4)
    z = nw.insert(x, 0, 4)
    assert_almost_equal(y, z)
def test_insert_1():
    x = np.array([1, 2, 3]) * PhysicalQuantity(1, "m")
    y = nw.insert(x, 0, PhysicalQuantity(4, "m"))
    assert_almost_equal(y.value, np.array([4, 1, 2, 3]))
예제 #4
0
def test_insert_1():
    x = np.array([1, 2, 3]) * PhysicalQuantity(1, 'm')
    y = nw.insert(x, 0, PhysicalQuantity(4, 'm'))
    assert_almost_equal(y.value, np.array([4, 1, 2, 3]))