Example #1
0
def test_check_num_array_dict():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_({'a': 1, 'b': 2, 'c': 3, 'd': 4})
Example #2
0
def test_check_num_array_tuple():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_({1, 2, 3, 4})
Example #3
0
def test_check_num_array_Series_str():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_(pd.Series(['foo', 'baar', 'baz', 'hixks']))
Example #4
0
def test_check_num_array_npArray_str_num():
    assert ch._check_num_array_(np.array(['1', '2', '3', '4', '5', '6',
                                          '7'])).dtype == float
Example #5
0
def test_check_num_array_Series_int():
    assert ch._check_num_array_(pd.Series([1, 2, 3, 4, 5, 6, 7])).dtype == int
Example #6
0
def test_check_num_array_Series_str_num():
    assert ch._check_num_array_(pd.Series(['1', '2', '3', '4', '5', '6',
                                           '7'])).dtype == float
Example #7
0
def test_check_num_array_npArray_str():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_(np.array(['foo', 'baar', 'baz', 'hixks']))
Example #8
0
def test_check_num_array_Series_float():
    assert ch._check_num_array_(pd.Series([1, 2, 3, 4, 5.0, 6.3,
                                           .17])).dtype == float
Example #9
0
def test_check_num_array_npArray_float():
    assert ch._check_num_array_(np.array([1, 2, 3, 4, 5.0, 6.3,
                                          .17])).dtype == float
Example #10
0
def test_check_num_array_npArray_int():
    assert ch._check_num_array_(np.array([1, 2, 3, 4, 5, 6, 7])).dtype == int
Example #11
0
def test_check_num_array_list_of_float():
    assert ch._check_num_array_([1, 2, 3, 4, 5.0, 6.3, .17]).dtype == float
Example #12
0
def test_check_num_array_list_of_int():
    assert ch._check_num_array_([1, 2, 3, 4, 5, 6, 7]).dtype == float
Example #13
0
def test_check_num_array_list_of_str_num():
    assert ch._check_num_array_(['1', '2', '3', '4', '5', '6',
                                 '7']).dtype == float
Example #14
0
def test_check_num_array_list_str():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_(['foo', 'baar', 'baz', 'jinks'])
Example #15
0
def test_check_num_array_str():
    with pytest.raises(ValueError) as context:
        ch._check_num_array_('alocdwneceo;u')