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

Online Help

All Products    Maple    MapleSim


DataFrame/ColumnLabels

obtain column labels of a DataFrame

DataFrame/RowLabels

obtain row labels of a DataFrame

DataFrame/SubsColumnLabel

create a DataFrame with a different column label

DataFrame/SubsRowLabel

create a DataFrame with a different row label

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ColumnLabels(DF)

ColumnLabels(DF, i)

SubsColumnLabel(DF, i, label)

RowLabels(DF)

RowLabels(DF, i)

SubsRowLabel(DF, i, label)

Parameters

DF

-

a DataFrame object

i

-

a nonzero integer or valid row or column label

label

-

a new label

Description

• 

The ColumnLabels command returns the list of column labels for a DataFrame object, or a single column label. A single label is specified by its position.

• 

The RowLabels command returns the list of row labels for a DataFrame object, or a single row label. A single label is specified by its position.

• 

The SubsColumnLabel command creates a DataFrame object with a different column label.

• 

The SubsRowLabel command creates a DataFrame object with a different row label.

• 

Note: the SubsColumnLabel and SubsRowLabel commands do not modify the given DataFrame object DF - they just return new DataFrame objects. See the Examples section below.

• 

If i is a negative integer, it specifies the position counting from the end. For example, -2 specifies the label before last.

Examples

> 

df≔DataFrame⁡5,6,8,8,9,1,9,6,0,2,5,9,columns=A,B,C,D,rows=a,b,c

df≔ABCDa5892b6965c8109

(1)
> 

ColumnLabels⁡df

A,B,C,D

(2)
> 

RowLabels⁡df

a,b,c

(3)
> 

ColumnLabels⁡df,2

B

(4)
> 

RowLabels⁡df,−1

c

(5)

The statements below does not modify df.

> 

df2≔SubsColumnLabel⁡df,3,X

df2≔ABXDa5892b6965c8109

(6)
> 

ColumnLabels⁡df

A,B,C,D

(7)
> 

ColumnLabels⁡df2

A,B,X,D

(8)
> 

SubsRowLabel⁡df,1,z

ABCDz5892b6965c8109

(9)
> 

SubsRowLabel⁡df,a,S

ABCDS5892b6965c8109

(10)

We can make the change apply to df by assigning the result to df.

> 

df≔SubsColumnLabel⁡df,3,X

df≔ABXDa5892b6965c8109

(11)
> 

df≔SubsRowLabel⁡df,1,z

df≔ABXDz5892b6965c8109

(12)
> 

ColumnLabels⁡df

A,B,X,D

(13)
> 

RowLabels⁡df

z,b,c

(14)

Compatibility

• 

The DataFrame/ColumnLabels, DataFrame/RowLabels, DataFrame/SubsColumnLabel and DataFrame/SubsRowLabel commands were introduced in Maple 2016.

• 

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

See Also

DataFrame

DataFrame/Constructor

DataFrame/indexing

DataSeries/Labels