Skip to content

Commit ecbb3c7

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

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

larray/core/array.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ def to_series(self, name=None, dropna=False):
12111211
b2 5.0
12121212
Name: my_name, dtype: float64
12131213
1214-
Drop nan values
1214+
Drop NaN values
12151215
12161216
>>> arr['b1'] = nan
12171217
>>> arr
@@ -5615,9 +5615,9 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
56155615
atol : float or int, optional
56165616
The absolute tolerance parameter (see Notes). Defaults to 0.
56175617
nans_equal : boolean, optional
5618-
Whether or not to consider nan values at the same positions in the two arrays as equal.
5619-
By default, an array containing nan values is never equal to another array, even if that other array
5620-
also contains nan values at the same positions. The reason is that a nan value is different from
5618+
Whether or not to consider NaN values at the same positions in the two arrays as equal.
5619+
By default, an array containing NaN values is never equal to another array, even if that other array
5620+
also contains NaN values at the same positions. The reason is that a NaN value is different from
56215621
*anything*, including itself. Defaults to False.
56225622
check_axes : boolean, optional
56235623
Whether or not to check that the set of axes and their order is the same on both sides. Defaults to False.
@@ -5677,7 +5677,7 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
56775677
>>> arr2.equals(arr1, rtol=0.01)
56785678
True
56795679
5680-
Arrays with nan values
5680+
Arrays with NaN values
56815681
56825682
>>> arr1 = ndtest((2, 3), dtype=float)
56835683
>>> arr1['a1', 'b1'] = nan
@@ -5686,9 +5686,9 @@ def equals(self, other, rtol=0, atol=0, nans_equal=False, check_axes=False):
56865686
a0 0.0 1.0 2.0
56875687
a1 3.0 nan 5.0
56885688
>>> arr2 = arr1.copy()
5689-
>>> # By default, an array containing nan values is never equal to another array,
5690-
>>> # even if that other array also contains nan values at the same positions.
5691-
>>> # The reason is that a nan value is different from *anything*, including itself.
5689+
>>> # By default, an array containing NaN values is never equal to another array,
5690+
>>> # even if that other array also contains NaN values at the same positions.
5691+
>>> # The reason is that a NaN value is different from *anything*, including itself.
56925692
>>> arr2.equals(arr1)
56935693
False
56945694
>>> # set flag nans_equal to True to overwrite this behavior
@@ -5747,16 +5747,16 @@ def eq(self, other, rtol=0, atol=0, nans_equal=False):
57475747
atol : float or int, optional
57485748
The absolute tolerance parameter (see Notes). Defaults to 0.
57495749
nans_equal : boolean, optional
5750-
Whether or not to consider nan values at the same positions in the two arrays as equal.
5751-
By default, an array containing nan values is never equal to another array, even if that other array
5752-
also contains nan values at the same positions. The reason is that a nan value is different from
5750+
Whether or not to consider Nan values at the same positions in the two arrays as equal.
5751+
By default, an array containing NaN values is never equal to another array, even if that other array
5752+
also contains NaN values at the same positions. The reason is that a NaN value is different from
57535753
*anything*, including itself. Defaults to False.
57545754
57555755
Returns
57565756
-------
57575757
LArray
57585758
Boolean array where each cell tells whether corresponding elements of self and other are equal
5759-
within a tolerance range if given. If nans_equal=True, corresponding elements with nan values
5759+
within a tolerance range if given. If nans_equal=True, corresponding elements with NaN values
57605760
will be considered as equal.
57615761
57625762
See Also

larray/core/ufuncs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def broadcastify(func):
199199
Notes
200200
-----
201201
The maximum is equivalent to ``where(x1 >= x2, x1, x2)`` when
202-
neither x1 nor x2 are nans, but it is faster.
202+
neither x1 nor x2 are NaNs, but it is faster.
203203
204204
Examples
205205
--------

0 commit comments

Comments
 (0)