コード例 #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]]))
コード例 #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]]))
コード例 #3
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]]))
コード例 #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]]))
コード例 #5
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]]))