From f2e6d8e233d380133d8e3504272b3ed0554bfaa4 Mon Sep 17 00:00:00 2001 From: dhuard Date: Fri, 4 Apr 2008 20:13:24 +0000 Subject: Modified io._getconv to allow loading values stored as float as integers arrays. Added test to check the behavior as suggested in the comment from b. southey in ticket #623 --- numpy/lib/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/io.py') diff --git a/numpy/lib/io.py b/numpy/lib/io.py index bb4d254a8..235316c82 100644 --- a/numpy/lib/io.py +++ b/numpy/lib/io.py @@ -203,7 +203,7 @@ def _getconv(dtype): if issubclass(typ, np.bool_): return lambda x: bool(int(x)) if issubclass(typ, np.integer): - return int + return lambda x: int(float(x)) elif issubclass(typ, np.floating): return float elif issubclass(typ, np.complex): -- cgit v1.2.1