Datatype - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


DataSeries/Datatype

obtain the data type of a DataSeries

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Datatype(ds)

Parameters

ds

-

a DataSeries object

Description

• 

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.

Examples

The default data type is anything.

> 

ds1≔DataSeries⁡1,2,3

ds1≔112233

(1)
> 

Datatype⁡ds1

anything

(2)
> 

v1≔Vector⁡2.,3.

v1≔2.3.

(3)
> 

ds2≔DataSeries⁡v1

ds2≔12.23.

(4)
> 

Datatype⁡ds2

anything

(5)

You can override the default in the DataSeries constructor.

> 

ds3≔DataSeries⁡v1,datatype=float8

ds3≔12.23.

(6)
> 

Datatype⁡ds3

float8

(7)

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.

(8)
> 

ds4≔DataSeries⁡v2

ds4≔12.23.

(9)
> 

Datatype⁡ds4

float8

(10)

Compatibility

• 

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