verify/dataframe - Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : verify/dataframe

verify/dataframe

verify a relation between two DataFrame objects

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

verify(expr1, expr2, dataframe)

verify(expr1, expr2, dataframe(ver, opt)

Parameters

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

Description

• 

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.

Examples

df1DataFrame1.,2.,3.,4.,columns=A,B,rows=a,b

df1ABa1.3.b2.4.

(1)

df2DataFrame1.01,2.,3.01,3.99,columns=A,B,rows=a,b

df2ABa1.013.01b2.3.99

(2)

df3DataFrame3.,4.,1.,2.,columns=A,B,rows=b,a

df3ABb3.1.a4.2.

(3)

df4DataFrame1.,2.,3.,4.,columns=C,D,rows=a,b

df4CDa1.3.b2.4.

(4)

df1 and df1 have the same entries and labels.

verifydf1,df1,dataframe

true

(5)

df1 and df2 have different entries.

verifydf1,df2,dataframe

false

(6)

However, they are pairwise in the relation float(2, digits=3) (see verify/float).

verifydf1,df2,dataframefloat2,digits=3

true

(7)

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.

verifydf1,df3,dataframe

false

(8)

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.

verifydf1,df4,dataframecolumnlabelverification=true

true

(9)

See Also

DataFrame

DataSeries

verify

verify/dataseries