DataFrame/Datatypes - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

DataFrame/Datatypes

obtain datatypes for all columns of a DataFrame

 Calling Sequence Datatypes(DF)

Parameters

 DF - a DataFrame object

Description

 • The Datatypes command returns the list of data types of the columns of a DataFrame.

Examples

Consider some sales data for houses.

 > $\mathrm{prices}≔\mathrm{DataSeries}\left(⟨123000,241000,215000⟩,'\mathrm{datatype}'={'\mathrm{float}'}_{8}\right)$
 ${\mathrm{prices}}{≔}\left[\begin{array}{cc}{1}& {123000.}\\ {2}& {241000.}\\ {3}& {215000.}\end{array}\right]$ (1)
 > $\mathrm{nr_bedrooms}≔\mathrm{DataSeries}\left(⟨1,2,2⟩,'\mathrm{datatype}'={'\mathrm{integer}'}_{1}\right)$
 ${\mathrm{nr_bedrooms}}{≔}\left[\begin{array}{cc}{1}& {1}\\ {2}& {2}\\ {3}& {2}\end{array}\right]$ (2)
 > $\mathrm{has_swimming_pool}≔\mathrm{DataSeries}\left(⟨\mathrm{false},\mathrm{true},\mathrm{false}⟩,'\mathrm{datatype}'='\mathrm{truefalse}'\right)$
 ${\mathrm{has_swimming_pool}}{≔}\left[\begin{array}{cc}{1}& {\mathrm{false}}\\ {2}& {\mathrm{true}}\\ {3}& {\mathrm{false}}\end{array}\right]$ (3)
 > $\mathrm{house_sales}≔\mathrm{DataFrame}\left(\mathrm{prices},\mathrm{nr_bedrooms},\mathrm{has_swimming_pool},\mathrm{columns}=\left[\mathrm{Prices},\mathrm{Nr of Bedrooms},\mathrm{Swimming Pool?}\right]\right)$
 ${\mathrm{house_sales}}{≔}\left[\begin{array}{cccc}{}& {\mathrm{Prices}}& {\mathrm{Nr of Bedrooms}}& {\mathrm{Swimming Pool?}}\\ {1}& {123000.}& {1}& {\mathrm{false}}\\ {2}& {241000.}& {2}& {\mathrm{true}}\\ {3}& {215000.}& {2}& {\mathrm{false}}\end{array}\right]$ (4)

You can get the data types for the three columns with the Datatypes command.

 > $\mathrm{Datatypes}\left(\mathrm{house_sales}\right)$
 $\left[{{\mathrm{float}}}_{{8}}{,}{{\mathrm{integer}}}_{{1}}{,}{\mathrm{truefalse}}\right]$ (5)

Compatibility

 • The DataFrame/Datatypes command was introduced in Maple 2016.
 • For more information on Maple 2016 changes, see Updates in Maple 2016.

 See Also