verify/dataframe
verify a relation between two DataFrame objects
Calling Sequence
Parameters
Description
Examples
verify(expr1, expr2, dataframe)
verify(expr1, expr2, dataframe(ver, opt)
expr1, expr2
-
anything
ver
(optional) verification to use for the entries of the DataFrame objects
opt
(optional) equation(s) of the form labelverification = lver or columnlabelverification = cver or rowlabelverification = rver, where lver, cver, and rver are verifications
The verify(expr1, expr2, dataframe) command returns true if expr1 and expr2 are both DataFrame objects, and their labels and entries are the same and occur in the same order.
The verify(expr1, expr2, dataframe(ver)) command returns true if expr1 and expr2 are both DataFrame objects, and their labels are the same and occur in the same order, and each entry of expr1 is in the relation specified by ver with the corresponding entry of expr2.
The verify(expr1, expr2, dataframe(columnlabelverification=cver)) command returns true if expr1 and expr2 are both DataFrame objects, and their entries and row labels are the same and occur in the same order, and each column label of expr1 is in the relation specified by cver with the corresponding column label of expr2. Similar if the rowlabelverification = rver is specified. If labelverification = lver is specified, then lver is used for both row and column labels. The rowlabelverification and columnlabelverification options override labelverification if more than one is specified.
The verify(expr1, expr2, dataframe(ver, labelverification=lver)) command returns true if expr1 and expr2 are both DataFrame objects, and each label of expr1 is in the relation specified by lver with the corresponding label of expr2, and each entry of expr1 is in the relation specified by ver with the corresponding entry of expr2. This generalizes in the obvious way if columnlabelverification and/or rowlabelverification are specified.
The relation specified as dataframe(...) is symmetric if all verifications given as options are symmetric. This is vacuously the case if no optional arguments are included.
df1≔DataFrame⁡1.,2.,3.,4.,columns=A,B,rows=a,b
df1≔ABa1.3.b2.4.
df2≔DataFrame⁡1.01,2.,3.01,3.99,columns=A,B,rows=a,b
df2≔ABa1.013.01b2.3.99
df3≔DataFrame⁡3.,4.,1.,2.,columns=A,B,rows=b,a
df3≔ABb3.1.a4.2.
df4≔DataFrame⁡1.,2.,3.,4.,columns=C,D,rows=a,b
df4≔CDa1.3.b2.4.
df1 and df1 have the same entries and labels.
verify⁡df1,df1,dataframe
true
df1 and df2 have different entries.
verify⁡df1,df2,dataframe
false
However, they are pairwise in the relation float(2, digits=3) (see verify/float).
verify⁡df1,df2,dataframe⁡float⁡2,digits=3
While df1 and df3 map the same labels to the same values, they are ordered differently (in particular, the rows are swapped). The verify/dataframe command has no facility to recognize this.
verify⁡df1,df3,dataframe
df1 and df4 have the same entries, but different column labels. We specify columnlabelverification = true (see verify/true) so that the labels compare pairwise successfully.
verify⁡df1,df4,dataframe⁡columnlabelverification=true
See Also
DataFrame
DataSeries
verify
verify/dataseries
Download Help Document