|
Calling Sequence
|
|
Append( df1, df2, opts )
|
|
Parameters
|
|
df1
|
-
|
: a DataFrame object
|
df2
|
-
|
: a DataFrame or DataSeries object, a list, or a Vector
|
opts
|
-
|
: (optional) an option of the form mode = m, where m is one of row or rows or column or columns or merge or overwrite, and/or an option of the form label = L
|
|
|
|
|
Description
|
|
•
|
The Append( df1, df2 ) command appends the DataFrame or DataSeries object df2 to the DataFrame df1, and returns the newly constructed DataFrame. It does not modify df1.
|
•
|
By specifying the option or (the two are equivalent), you instruct the Append command to append df2 as new rows. In this mode, if df2 is a DataFrame, df1 and df2 must have disjoint row labels. Column labels may be shared, and common columns will be aligned. If df2 is a DataSeries, then its labels will be aligned with the column labels of df1. If df2 is a list or a Vector, then its entries will form the new row in the same order as in df2 itself.
|
|
This mode is the default if df2 is a DataFrame.
|
•
|
By specifying the option or (the two are equivalent), the Append command is made to work in column mode. In this mode, if df2 is a DataFrame, then df1 and df2 must have disjoint column labels, and row labels will be aligned. If df2 is a DataSeries object, it will be added as a new column, and its labels will be aligned with the row labels of df1. If df2 is a list or a Vector, then its entries will form the new column in the same order as in df2 itself.
|
|
This mode is the default if df2 is a DataSeries, a list, or a Vector.
|
•
|
By specifying the option or , you select a mode that allows for overlap between both row and column labels. With , those values will come from df1; by specifying , they come from df2. (In the case of , the order of labels in the result will be based on the order in df2; this is different from all other modes, where it is based on the order in df1.) These modes can only be used if df2 is a DataFrame object.
|
•
|
If df2 is a DataSeries, then the label for the new row (in row mode) or column (in column mode) is, by default, an arbitrary positive integer. If the label option is specified, its value is used instead.
|
|
If df2 is a list or a Vector, then the same rules apply. Also, the number of entries of df2 must be the same as the number of rows (in column mode) or columns (in row mode) of df1.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (2) |
| (3) |
|
|
Compatibility
|
|
•
|
The DataFrame/Append command was introduced in Maple 2016.
|
|
|
|