summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorTim Leslie <tim.leslie@gmail.com>2007-01-08 03:43:54 +0000
committerTim Leslie <tim.leslie@gmail.com>2007-01-08 03:43:54 +0000
commit2e832de49f69d26eb7c8d133e45f9b9d99f7a3a6 (patch)
tree3ccd7e10623a97a145640a344998b02ec43c5a0f /numpy
parent099247b5d7a88339d0e159c434905cf69540cc85 (diff)
downloadnumpy-2e832de49f69d26eb7c8d133e45f9b9d99f7a3a6.tar.gz
add a docstring to nan_to_num. closes #406
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/type_check.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
index ec6159123..1571c2e6c 100644
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -104,10 +104,14 @@ def _getmaxmin(t):
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: