DataSeries/Datatype - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : DataFrames and DataSeries : DataSeries Commands : DataSeries/Datatype

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.

ds1DataSeries1,2,3

ds1112233

(1)

Datatypeds1

anything

(2)

v1Vector2.,3.

v12.3.

(3)

ds2DataSeriesv1

ds212.23.

(4)

Datatypeds2

anything

(5)

You can override the default in the DataSeries constructor.

ds3DataSeriesv1,datatype=float8

ds312.23.

(6)

Datatypeds3

float8

(7)

Alternatively, you can make sure that the data defining the DataSeries already has a specified data type.

v2Vector2.,3.,datatype=float8

v22.3.

(8)

ds4DataSeriesv2

ds412.23.

(9)

Datatypeds4

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