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

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

dfDataFrame5,6,8,8,9,1,9,6,0,2,5,9,columns=A,B,C,D,rows=a,b,c

dfABCDa5892b6965c8109

(1)

ColumnLabelsdf

A,B,C,D

(2)

RowLabelsdf

a,b,c

(3)

ColumnLabelsdf,2

B

(4)

RowLabelsdf,1

c

(5)

The statements below does not modify df.

df2SubsColumnLabeldf,3,X

df2ABXDa5892b6965c8109

(6)

ColumnLabelsdf

A,B,C,D

(7)

ColumnLabelsdf2

A,B,X,D

(8)

SubsRowLabeldf,1,z

ABCDz5892b6965c8109

(9)

SubsRowLabeldf,a,S

ABCDS5892b6965c8109

(10)

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

dfSubsColumnLabeldf,3,X

dfABXDa5892b6965c8109

(11)

dfSubsRowLabeldf,1,z

dfABXDz5892b6965c8109

(12)

ColumnLabelsdf

A,B,X,D

(13)

RowLabelsdf

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