Equality(other, types=TypeMatch.IGNORED)
Source¶
Settings of the comparison of two Arrays or two Tables, used by Array.is_equal and Table.is_equal.
Two Arrays are equal when they have the same shape and the same values at each position. Two Tables are equal when they have the same columns, in the same order, with the same values. Two missing values at the same position are equal.
Added in version 0.1.0
Parameters:
-
other(Array | Table)The Array or the Table to compare with, of the same kind as the compared one.
-
types(TypeMatch, default:TypeMatch.IGNORED)Whether the types must also be the same. Only the values are compared by default.
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
Examples:
import numdaplot as ndp
integers = ndp.Array.from_list([1, 2])
decimals = ndp.Array.from_list([1.0, 2.0])
integers.is_equal(ndp.Equality(other=decimals, types=ndp.TypeMatch.STRICT))
# False