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

Online Help

All Products    Maple    MapleSim


Overview of DataSeries

 

Description

Indexing

Examples

Description

• 

A DataSeries is a one-dimensional data container, similar to a one-dimensional Array, but whose entries can be referenced by "labels", as well as by position.

• 

A related two-dimensional data container, known as a DataFrame is also available.

Indexing

• 

You can access the elements of a DataSeries similar to the way in which you access Array elements, by indexing the DataSeries by position. If ds is a DataSeries, then ds[ i ] evaluates to the ith element of ds. However, the elements of a DataSeries are also associated with symbolic names, and you can use these names to refer to DataSeries elements as well.

ds := DataSeries( [ sin( x ), cos( x ), tan( x ) ], 'labels' = [ 's', 'c', 't' ] );

(1)

ds[ 2 ];

(2)

ds[ 'c' ];

(3)
• 

To select a range of entries in a DataSeries, returning the result as a DataSeries, use a range of indices or labels.

ds[ 1 .. 2 ];

(4)

ds[ 'c' .. 't' ];

(5)
• 

Note that indices and labels can be used together:

ds[ 'c' .. -1 ];

(6)
• 

You can select non-contiguous entries by enclosing the desired indices in a list.

ds[ [ 's', 't' ] ];

(7)
• 

One particular application for this kind of index is to re-order the given DataSeries.

ds2 := ds[ [ 2, 3, 1 ] ];

(8)

Examples

(9)

(10)

(11)

(12)

(13)

ds >~ 4;

(14)

ds[ ds >~ 4 ];

(15)

Hourly temperatures reported by the BlackBerry Weather App for Waterloo, Ontario on October 27/28 2015.

Compute the average temperature over this 24-hour period.

(16)

(17)

DataSeries objects can be converted to an Array, Vector, Matrix, table, list, or set:

(18)

Converting a DataSeries to a set only shows the unique elements:

(19)

Converting to a table is the only conversion that attempts to maintain information on labels:

(20)

See Also

DataFrame

DataSeries/Constructor

 


Download Help Document