diff options
author | pierregm <pierregm@localhost> | 2009-10-14 19:43:00 +0000 |
---|---|---|
committer | pierregm <pierregm@localhost> | 2009-10-14 19:43:00 +0000 |
commit | 4b6137af35397b349c1eb651d044e0dd245901cc (patch) | |
tree | 1dee1844d7ab1ade4f16983d8d9582400a686452 /numpy/lib/tests/test__iotools.py | |
parent | bbe934c2cf3fb3faf7e6ff798b7518f9637917a1 (diff) | |
download | numpy-4b6137af35397b349c1eb651d044e0dd245901cc.tar.gz |
* _iotools.StringConverter
- prevents a `default` of 0 to be overwritten during initialization
- allows the `missing_values` to be a comma-separated string
* io.genfromtxt
- `usecols` can now be a single integer
- for `usecols` and `names` to list (for compatibility w/ Python 2.5)
- negative values in `usecols` are properly transformed to positive integers
- fixed `usecols` with named columns
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-rw-r--r-- | numpy/lib/tests/test__iotools.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py index ed0f4dc63..11ce4047b 100644 --- a/numpy/lib/tests/test__iotools.py +++ b/numpy/lib/tests/test__iotools.py @@ -191,7 +191,16 @@ class TestStringConverter(TestCase): converter.upgrade('3.14159265') assert_equal(converter.default, 0) assert_equal(converter.type, np.dtype(float)) - + # + def test_keep_default_zero(self): + "Check that we don't lose a default of 0" + converter = StringConverter(int, default=0, missing_values="N/A") + assert_equal(converter.default, 0) + # + def test_keep_missing_values(self): + "Check that we're not losing missing values" + converter = StringConverter(int, default=0, missing_values="N/A") + assert_equal(converter.missing_values, set(['', 'N/A'])) #------------------------------------------------------------------------------- |