Exemple #1
0
def test_numpy_deser_from_json_alpha():
    arr = _NumpyDeserializer(dtype="U5")(
        io.BytesIO(b'[["hello",2,3],\n[4,5,6]]'), "application/json")
    assert np.array_equal(arr, np.array([["hello", 2, 3], [4, 5, 6]]))
Exemple #2
0
def test_numpy_deser_from_csv_alpha():
    arr = _NumpyDeserializer(dtype="U5")(io.BytesIO(b"hello,2,3\n4,5,6"),
                                         "text/csv")
    assert np.array_equal(arr, np.array([["hello", 2, 3], [4, 5, 6]]))
def test_numpy_deser_from_json_alpha():
    arr = _NumpyDeserializer(dtype='U5')(io.BytesIO(b'[["hello",2,3],\n[4,5,6]]'), 'application/json')
    assert np.array_equal(arr, np.array([['hello', 2, 3], [4, 5, 6]]))
Exemple #4
0
def test_numpy_deser_from_csv_alpha():
    arr = _NumpyDeserializer(dtype='U5')(io.BytesIO(b'hello,2,3\n4,5,6'), 'text/csv')
    assert np.array_equal(arr, np.array([['hello', 2, 3], [4, 5, 6]]))
def test_numpy_deser_from_csv_alpha():
    arr = _NumpyDeserializer(dtype='U5')(io.BytesIO(b'hello,2,3\n4,5,6'), 'text/csv')
    assert np.array_equal(arr, np.array([['hello', 2, 3], [4, 5, 6]]))