Skip to content

Commit ec739af

Browse files
committed
fix #335 : Standardize nan to NaN in all docstrings. Keep nan when printing values. (same as Numpy).
1 parent 2d746f5 commit ec739af

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

larray/core/array.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ def to_series(self, name=None, dropna=False):
11131113
b2 5.0
11141114
Name: my_name, dtype: float64
11151115
1116-
Drop nan values
1116+
Drop NaN values
11171117
11181118
>>> arr['b1'] = nan
11191119
>>> arr
@@ -5139,9 +5139,9 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
51395139
atol : float or int, optional
51405140
The absolute tolerance parameter (see Notes). Defaults to 0.
51415141
nans_equal : boolean, optional
5142-
Whether or not to consider nan values at the same positions in the two arrays as equal.
5143-
By default, an array containing nan values is never equal to another array, even if that other array
5144-
also contains nan values at the same positions. The reason is that a nan value is different from
5142+
Whether or not to consider NaN values at the same positions in the two arrays as equal.
5143+
By default, an array containing NaN values is never equal to another array, even if that other array
5144+
also contains NaN values at the same positions. The reason is that a NaN value is different from
51455145
*anything*, including itself. Defaults to False.
51465146
check_axes : boolean, optional
51475147
Whether or not to check that the set of axes and their order is the same on both sides. Defaults to False.
@@ -5201,7 +5201,7 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
52015201
>>> arr2.equals(arr1, rtol=0.01)
52025202
True
52035203
5204-
Arrays with nan values
5204+
Arrays with NaN values
52055205
52065206
>>> arr1 = ndtest((2, 3), dtype=float)
52075207
>>> arr1['a1', 'b1'] = nan
@@ -5210,9 +5210,9 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
52105210
a0 0.0 1.0 2.0
52115211
a1 3.0 nan 5.0
52125212
>>> arr2 = arr1.copy()
5213-
>>> # By default, an array containing nan values is never equal to another array,
5214-
>>> # even if that other array also contains nan values at the same positions.
5215-
>>> # The reason is that a nan value is different from *anything*, including itself.
5213+
>>> # By default, an array containing NaN values is never equal to another array,
5214+
>>> # even if that other array also contains NaN values at the same positions.
5215+
>>> # The reason is that a NaN value is different from *anything*, including itself.
52165216
>>> arr2.equals(arr1)
52175217
False
52185218
>>> # set flag nans_equal to True to overwrite this behavior
@@ -5271,16 +5271,16 @@ def eq(self, other, rtol=0, atol=0, nans_equal=False):
52715271
atol : float or int, optional
52725272
The absolute tolerance parameter (see Notes). Defaults to 0.
52735273
nans_equal : boolean, optional
5274-
Whether or not to consider nan values at the same positions in the two arrays as equal.
5275-
By default, an array containing nan values is never equal to another array, even if that other array
5276-
also contains nan values at the same positions. The reason is that a nan value is different from
5274+
Whether or not to consider Nan values at the same positions in the two arrays as equal.
5275+
By default, an array containing NaN values is never equal to another array, even if that other array
5276+
also contains NaN values at the same positions. The reason is that a NaN value is different from
52775277
*anything*, including itself. Defaults to False.
52785278
52795279
Returns
52805280
-------
52815281
LArray
52825282
Boolean array where each cell tells whether corresponding elements of self and other are equal
5283-
within a tolerance range if given. If nans_equal=True, corresponding elements with nan values
5283+
within a tolerance range if given. If nans_equal=True, corresponding elements with NaN values
52845284
will be considered as equal.
52855285
52865286
See Also

larray/core/ufuncs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def wrapper(*args, **kwargs):
150150
Notes
151151
-----
152152
The maximum is equivalent to ``where(x1 >= x2, x1, x2)`` when
153-
neither x1 nor x2 are nans, but it is faster.
153+
neither x1 nor x2 are NaNs, but it is faster.
154154
155155
Examples
156156
--------

0 commit comments

Comments
 (0)