DataFrame/numelems - Maple Programming Help

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

DataFrame/numelems

return the number of elements in a DataFrame

DataFrame/lowerbound

return the index of the first element in a DataFrame

DataFrame/upperbound

return the index of the last element in a DataFrame

 Calling Sequence numelems( df ) lowerbound( df ) lowerbound( df, dim ) upperbound( df ) upperbound( df, dim )

Parameters

 df - a DataFrame object dim - a positive integer (1 or 2)

Description

 • The numelems( df ) command returns the number of elements in the DataFrame df. This is defined to be the number of individual data items in the DataFrame df, not the number of columns of df.
 • The lowerbound( df, dim ) command returns the index, which is always equal to 1, of the first element of the DataFrame df in dimension dim, which must be either 1 or 2.
 • The upperbound( df, dim ) command returns the index of the last element of the DataFrame df in dimension dim, which must be either 1 or 2. If dim is equal to 1, then the number of rows of df is returned. If dim is equal to 2, then the number of columns of df is returned.
 • Note that, for a DataFrame df, numelems( df ) is equal to upperbound( df, 1 ) * upperbound( df, 2 ), which is just the product of the numbers of rows and columns of df.

Examples

 > $\mathrm{df}≔\mathrm{DataFrame}\left(⟨⟨⟨1|2|3⟩,⟨4|5|6⟩⟩⟩\right)$
 ${\mathrm{df}}{≔}\left[\begin{array}{cccc}{}& {1}& {2}& {3}\\ {1}& {1}& {2}& {3}\\ {2}& {4}& {5}& {6}\end{array}\right]$ (1)
 > $\mathrm{numelems}\left(\mathrm{df}\right)$
 ${6}$ (2)
 > $\mathrm{lowerbound}\left(\mathrm{df}\right)$
 ${1}{,}{1}$ (3)
 > $\mathrm{upperbound}\left(\mathrm{df},1\right)$
 ${2}$ (4)
 > $\mathrm{upperbound}\left(\mathrm{df},2\right)$
 ${3}$ (5)

Compatibility

 • The DataFrame/numelems, DataFrame/lowerbound and DataFrame/upperbound commands were introduced in Maple 2016.