|
Calling Sequence
|
|
DataFrame( L, opts )
DataFrame( ds1, ds2, ..., opts );
DataFrame( label1 = ds1, label2 = ds2, ..., opts );
DataFrame( T, opts );
|
|
Parameters
|
|
L
|
-
|
: {listlist,list(DataSeries),Array,Matrix,DataFrame,table} : input data
|
ds1, ds2, ...
|
-
|
: DataSeries : columns from existing DataSeries
|
label1, label2, ...
|
-
|
column labels to use
|
T
|
-
|
: table : data specification in table form
|
|
|
|
|
Options
|
|
•
|
rows : {list,Array,Vector}, labels to use for the rows of data
|
•
|
columns : {list,Array,Vector}, labels to use for the columns of data
|
•
|
datatypes : list(type), types for the columns of data
|
|
|
Description
|
|
•
|
The DataFrame constructor produces a DataFrame data container, from the input data in various forms.
|
•
|
The input data (L) may be a list of columns for the resulting DataFrame. The individual columns in L may be specified as lists, one-dimensional rtables (Arrays, Vectors), or DataSeries objects.
|
•
|
You can also specify the data as a two-dimensional rtable (Matrix or Array) L, in which case the rows and columns of L are used respectively as the rows and columns of data for the DataFrame.
|
•
|
A sequence ds1, ds2, ... of DataSeries objects may be passed, and these are used as the columns of the resulting DataFrame.
|
•
|
A sequence of equations of the form label = ds can be passed to simultaneously specify the columns of data, from the DataSeries ds, and corresponding column labels label.
|
•
|
If the input T is a table, then the indices of T are used as the column labels, while the entries of T are used as the data items for the corresponding columns. Note that in this case, there is no pre-determined order for the columns.
|
•
|
The input L may be an existing DataFrame, in which case you can use the constructor to produce a new DataFrame with different (compatible) data types, or to re-label the data items.
|
|
|
Examples
|
|
The numbers of elements in each column must be the same.
|
|
Compatibility
|
|
•
|
The DataFrame command was introduced in Maple 2016.
|
|
|
|