DataSeries/Datatype
obtain the data type of a DataSeries
Calling Sequence
Parameters
Description
Examples
Compatibility
Datatype(ds)
ds
-
a DataSeries object
The Datatype command returns the data type of a DataSeries object.
The data type determines the values that can be stored in the data series. This is similar to the datatype option of an rtable.
Trying to set an entry of a DataSeries to a value that is not of the specified data type leads to an error.
The data type can be set using the datatype option in the DataSeries constructor call.
If no data type is specified in the constructor call, Maple uses the data type of the data argument if that is an rtable or DataSeries, or type anything otherwise.
If you want to store floating point data in a DataSeries, it will be advantageous to set the data type to float[8]. This uses less memory than the alternatives, and it can yield speed-ups in computations.
If you want to store true-or-false data in a DataSeries, it will be advantageous to set the data type to truefalse or truefalseFAIL. (FAIL is the third Boolean constant in Maple, signifying unknown or undetermined truth values.) This yields small speed-ups when used in DataSeries indexing or DataFrame indexing.
The default data type is anything.
ds1≔DataSeries⁡1,2,3
ds1≔112233
Datatype⁡ds1
anything
v1≔Vector⁡2.,3.
v1≔2.3.
ds2≔DataSeries⁡v1
ds2≔12.23.
Datatype⁡ds2
You can override the default in the DataSeries constructor.
ds3≔DataSeries⁡v1,datatype=float8
ds3≔12.23.
Datatype⁡ds3
float8
Alternatively, you can make sure that the data defining the DataSeries already has a specified data type.
v2≔Vector⁡2.,3.,datatype=float8
v2≔2.3.
ds4≔DataSeries⁡v2
ds4≔12.23.
Datatype⁡ds4
The DataSeries/Datatype command was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
See Also
Array
DataSeries
DataSeries/Constructor
Download Help Document