Change datatype of DataSeries Entries - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

DataSeries/SubsDatatype

change the datatype of a data series

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

SubsDatatype( DS, newdatatype, options )

Parameters

DF

-

a DataSeries object

newdatatype

-

type; the new datatype for the data series

Options

• 

conversion : procedure; specifies a procedure to be mapped onto the elements in the given data series. This option is entered in the form conversion = procedure.

Description

• 

The SubsDatatype command changes the datatype of the entries in a DataSeries as well as the indicated datatype of the data series.

• 

If the conversion option is given, then the values in the DataSeries are converted by this conversion procedure. Otherwise, they are typically not modified, but there are exceptions. Internally, a new Array is constructed with the given datatype, and the current values are used to initialize this Array; this is the step where an automatic conversion could take place.

Examples

Consider some data on berries.

The individual DataSeries are displayed more compactly in a DataFrame:

(1)

You can get the data types for the columns with the Datatypes command.

(2)

(3)

You can change the datatype of the Energy data series to float:

(4)

This does not change the datatype in place. To permanently change the datatype:

(5)

(6)

When working with strings or name conversions, it may be necessary to supply an explicit  conversion for the values in the data series:

(7)

(8)

(9)

(10)

(11)

(12)

Compatibility

• 

The DataSeries/SubsDatatype command was introduced in Maple 2017.

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

DataFrame/Datatypes

DataFrame/SubsDatatype

DataSeries/Datatype

 


Download Help Document