diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-03-28 18:33:21 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2014-03-28 18:33:21 -0600 |
commit | bce5bfbce602f4687ab3b01803bcb23820e7572c (patch) | |
tree | 947d20a207479ad4347514703fbc2027987acf24 /numpy/lib/tests/test_io.py | |
parent | 7b0d0754833468b960c9dd1c8b903ad30508eb70 (diff) | |
parent | aff43c0cb10796de7d6dfcc23bc27607ad2aacba (diff) | |
download | numpy-bce5bfbce602f4687ab3b01803bcb23820e7572c.tar.gz |
Merge pull request #3830 from jarondl/recfromcsv
MAINT (API?): organize npyio.recfromcsv defaults
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index a8b578097..418386e35 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -1572,6 +1572,14 @@ M 33 21.99 dtype=[('a', np.int), ('b', np.int)]) self.assertTrue(isinstance(test, np.recarray)) assert_equal(test, control) + # + data = TextIO('A,B\n0,1\n2,3') + dtype = [('a', np.int), ('b', np.float)] + test = np.recfromcsv(data, missing_values='N/A', dtype=dtype) + control = np.array([(0, 1), (2, 3)], + dtype=dtype) + self.assertTrue(isinstance(test, np.recarray)) + assert_equal(test, control) def test_gft_using_filename(self): # Test that we can load data from a filename as well as a file object |