 DataSeries/GetData - Maple Programming Help

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

DataSeries/GetData

get the plain data Array in a DataSeries

 Calling Sequence GetData(ds, c)

Parameters

 ds - a DataSeries object c - (optional) equation of the form copy = true or false

Description

 • The GetData command returns the Array from a DataSeries object that contains the actual data.
 • By default, GetData returns the data Array itself: if you modify the values in the returned Array, then the values in the DataSeries object will change. If you use the copy = true option, GetData returns a copy of this Array. You can shorten this option to just copy instead of copy = true. The default is copy = false.

Examples

 > $\mathrm{ds}≔\mathrm{DataSeries}\left(⟨1,2,3,4⟩,\mathrm{labels}=\left[A,B,C,\mathrm{D}\right]\right)$
 ${\mathrm{ds}}{≔}\left[\begin{array}{cc}{A}& {1}\\ {B}& {2}\\ {C}& {3}\\ {\mathrm{D}}& {4}\end{array}\right]$ (1)
 > $a≔\mathrm{GetData}\left(\mathrm{ds}\right)$
 ${a}{≔}\left[\begin{array}{cccc}{1}& {2}& {3}& {4}\end{array}\right]$ (2)

Modifying a will modify the data in ds.

 > $a\left[2\right]≔-2$
 ${{a}}_{{2}}{≔}{-2}$ (3)
 > $\mathrm{ds}$
 $\left[\begin{array}{cc}{A}& {1}\\ {B}& {-2}\\ {C}& {3}\\ {\mathrm{D}}& {4}\end{array}\right]$ (4)
 > $b≔\mathrm{GetData}\left(\mathrm{ds},'\mathrm{copy}'\right)$
 ${b}{≔}\left[\begin{array}{cccc}{1}& {-2}& {3}& {4}\end{array}\right]$ (5)

Modifying b will not modify the data in ds.

 > $b\left[3\right]≔-3$
 ${{b}}_{{3}}{≔}{-3}$ (6)
 > $\mathrm{ds}$
 $\left[\begin{array}{cc}{A}& {1}\\ {B}& {-2}\\ {C}& {3}\\ {\mathrm{D}}& {4}\end{array}\right]$ (7)

Compatibility

 • The DataSeries/GetData command was introduced in Maple 2016.