larray.compare¶
-
larray.
compare
(*args, **kwargs)[source]¶ Opens a new comparator window, comparing arrays or sessions.
- Parameters
- *argsArrays or Sessions
Arrays or sessions to compare.
- titlestr, optional
Title for the window. Defaults to ‘’.
- nameslist of str, optional
Names for arrays or sessions being compared. Defaults to the name of the first objects found in the caller namespace which correspond to the passed objects.
- depthint, optional
Stack depth where to look for variables. Defaults to 0 (where this function was called).
- display_caller_info: bool, optional
Whether or not to display the filename and line number where the Editor has been called. Defaults to True.
- rtolfloat or int, optional
The relative tolerance parameter (see Notes). Defaults to 0.
- atolfloat or int, optional
The absolute tolerance parameter (see Notes). Defaults to 0.
- nans_equalboolean, optional
Whether or not to consider NaN values at the same positions in the two arrays as equal. By default, an array containing NaN values is never equal to another array, even if that other array also contains NaN values at the same positions. The reason is that a NaN value is different from anything, including itself. Defaults to True.
Notes
For finite values, the following equation is used to test whether two values are equal:
absolute(array1 - array2) <= (atol + rtol * absolute(array2))
Examples
>>> a1 = ndtest(3) >>> a2 = ndtest(3) + 1 >>> compare(a1, a2, title='first comparison') >>> compare(a1 + 1, a2, title='second comparison', names=['a1+1', 'a2'])