Example #1
0
def test_fromstring_split4():
    s = "1\n 23 \t 4"
    obs = utils.fromstring_split(s, dtype=int)
    exp = np.array([1, 23, 4])
    assert_array_equal(obs, exp)
Example #2
0
def test_fromstring_split2():
    s = "1-2.3-4"
    obs = utils.fromstring_split(s, sep='-')
    exp = np.fromstring(s, sep="-")
    assert_array_equal(obs, exp)
Example #3
0
def test_fromstring_split3():
    s = "1,2.3,4"
    obs = utils.fromstring_split(s, sep=',')
    exp = np.fromstring(s, sep=",")
    assert_array_equal(obs, exp)
Example #4
0
def test_fromstring_split1():
    s = "1 2.3 4"
    obs = utils.fromstring_split(s)
    exp = np.fromstring(s, sep=" ")
    assert_array_equal(obs, exp)
Example #5
0
def test_fromstring_split4():
    s = "1\n 23 \t 4"
    obs = utils.fromstring_split(s, dtype=int)
    exp = np.array([1, 23, 4])
    assert_array_equal(obs, exp)
Example #6
0
def test_fromstring_split3():
    s = "1,2.3,4"
    obs = utils.fromstring_split(s, sep=',')
    exp = np.fromstring(s, sep=",")
    assert_array_equal(obs, exp)
Example #7
0
def test_fromstring_split2():
    s = "1-2.3-4"
    obs = utils.fromstring_split(s, sep='-')
    exp = np.fromstring(s, sep="-")
    assert_array_equal(obs, exp)
Example #8
0
def test_fromstring_split1():
    s = "1 2.3 4"
    obs = utils.fromstring_split(s)
    exp = np.fromstring(s, sep=" ")
    assert_array_equal(obs, exp)