[Numpy-svn] r3496 - trunk/numpy/lib

numpy-svn at scipy.org numpy-svn at scipy.org
Sun Jan 7 21:43:58 CST 2007


Author: timl
Date: 2007-01-07 21:43:54 -0600 (Sun, 07 Jan 2007)
New Revision: 3496

Modified:
   trunk/numpy/lib/type_check.py
Log:
add a docstring to nan_to_num. closes #406

Modified: trunk/numpy/lib/type_check.py
===================================================================
--- trunk/numpy/lib/type_check.py	2007-01-08 02:22:12 UTC (rev 3495)
+++ trunk/numpy/lib/type_check.py	2007-01-08 03:43:54 UTC (rev 3496)
@@ -104,10 +104,14 @@
     return f.max, f.min
 
 def nan_to_num(x):
-    # mapping:
-    #    NaN -> 0
-    #    Inf -> limits.double_max
-    #   -Inf -> limits.double_min
+    """
+    Replaces NaN's with 0 and infinities with large numbers
+
+    The following mappings are applied:
+        NaN -> 0
+        Inf -> limits.double_max
+       -Inf -> limits.double_min
+    """
     try:
         t = x.dtype.type
     except AttributeError:



More information about the Numpy-svn mailing list