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

DataSets[Builtin][Reference]

 GetName
 obtain a short name of a reference
 GetIdentifier
 obtain the identifier for a reference
 GetDescription
 obtain a description of a reference
 GetElementNames
 obtain the row names of a reference
 CountRows
 obtain the number of rows of a reference
 obtain the column names of a reference
 GetData
 obtain the data of a reference

 Calling Sequence GetName(ref) GetDescription(ref) GetElementNames(ref) CountRows(ref) GetHeaders(ref) GetData(ref)

Parameters

 ref - reference to built-in data

GetName

 • Returns the name of the reference as a string. This is a short string description of the data set. If you create a subset of a data set by using indexing, the name may change if the result has only a single (non-name) column or a single row.

GetDescription

 • Returns a string description of the data set. If you create a subset of a data set by using indexing, the description may change if the result has only a single (non-name) column or a single row.

GetIdentifier

 • Returns the identifier of a reference as a string. This is a unique identifier that can be used to find this reference among the built-in data sets.

GetElementNames

 • Returns a list of strings which are the names of the rows in the reference. Each row name is unique in the containing data set. This command may be slow if used on the full GeoNames data set.

CountRows

 • Returns the total number of rows in the reference in a efficient manner.

 • Returns a list of strings which are the names of the columns in the reference. Each column name is unique in the containing data set.

GetData

 • Returns the reference as a Matrix, without the column headers and without the row names. This command will retrieve all metadata, which may be slow if used on a large data set.

Examples

 > $\mathrm{with}\left(\mathrm{DataSets}\right):$
 > $\mathrm{ref}≔\mathrm{Reference}\left("Builtin","Country"\right)$
 ${\mathrm{ref}}{≔}\left[\begin{array}{ccccc}{\mathrm{Country \left(Name\right)}}& {\mathrm{Currency Code}}& {\mathrm{2 Letter Country Code}}& {\dots }& {\mathrm{\left(57 more\right)}}\\ {\mathrm{Afghanistan}}& {"AFN"}& {"AF"}& {\dots }& {}\\ {\mathrm{Albania}}& {"ALL"}& {"AL"}& {\dots }& {}\\ {\mathrm{Algeria}}& {"DZD"}& {"DZ"}& {\dots }& {}\\ {⋮}& {⋮}& {⋮}& {\ddots }& {}\\ {\mathrm{\left(182 more\right)}}& {}& {}& {}& {}\end{array}\right]$ (1)
 > $\mathrm{GetIdentifier}\left(\mathrm{ref}\right)$
 ${"Country"}$ (2)
 > $\mathrm{GetName}\left(\mathrm{ref}\right)$
 ${"Country properties"}$ (3)
 > $\mathrm{GetDescription}\left(\mathrm{ref}\right)$
 ${"A table of country properties, containing immediate values for some properties and references to time series data \left(from Quandl\right) for others."}$ (4)
 > $\mathrm{GetElementNames}\left(\mathrm{ref}\right)$
 $\left[{"Afghanistan"}{,}{"Albania"}{,}{"Algeria"}{,}{"Angola"}{,}{"Antigua and Barbuda"}{,}{"Argentina"}{,}{"Armenia"}{,}{"Australia"}{,}{"Austria"}{,}{"Azerbaijan"}{,}{"Bahrain"}{,}{"Bangladesh"}{,}{"Barbados"}{,}{"Belarus"}{,}{"Belgium"}{,}{"Belize"}{,}{"Benin"}{,}{"Bhutan"}{,}{"Bolivia"}{,}{"Bosnia and Herzegovina"}{,}{"Botswana"}{,}{"Brazil"}{,}{"Brunei"}{,}{"Bulgaria"}{,}{"Burkina Faso"}{,}{"Burundi"}{,}{"Cabo Verde"}{,}{"Cambodia"}{,}{"Cameroon"}{,}{"Canada"}{,}{"Central African Republic"}{,}{"Chad"}{,}{"Chile"}{,}{"China"}{,}{"Colombia"}{,}{"Comoros"}{,}{"Congo"}{,}{"Congo-Brazzaville"}{,}{"Costa Rica"}{,}{"Croatia"}{,}{"Cuba"}{,}{"Cyprus"}{,}{"Czech Republic"}{,}{"Denmark"}{,}{"Djibouti"}{,}{"Dominica"}{,}{"Dominican Republic"}{,}{"Ecuador"}{,}{"Egypt"}{,}{"El Salvador"}{,}{"Equatorial Guinea"}{,}{"Eritrea"}{,}{"Estonia"}{,}{"Ethiopia"}{,}{"Fiji"}{,}{"Finland"}{,}{"France"}{,}{"Gabon"}{,}{"Gambia"}{,}{"Georgia"}{,}{"Germany"}{,}{"Ghana"}{,}{"Greece"}{,}{"Grenada"}{,}{"Guatemala"}{,}{"Guinea"}{,}{"Guinea-Bissau"}{,}{"Guyana"}{,}{"Haiti"}{,}{"Honduras"}{,}{"Hong Kong"}{,}{"Hungary"}{,}{"Iceland"}{,}{"India"}{,}{"Indonesia"}{,}{"Iran"}{,}{"Iraq"}{,}{"Ireland"}{,}{"Israel"}{,}{"Italy"}{,}{"Ivory Coast"}{,}{"Jamaica"}{,}{"Japan"}{,}{"Jordan"}{,}{"Kazakhstan"}{,}{"Kenya"}{,}{"Kiribati"}{,}{"Kosovo"}{,}{"Kuwait"}{,}{"Kyrgyzstan"}{,}{"Laos"}{,}{"Latvia"}{,}{"Lebanon"}{,}{"Lesotho"}{,}{"Liberia"}{,}{"Libya"}{,}{"Lithuania"}{,}{"Luxembourg"}{,}{"Macedonia"}{,}{"Madagascar"}{,}{"Malawi"}{,}{"Malaysia"}{,}{"Maldives"}{,}{"Mali"}{,}{"Malta"}{,}{"Mauritania"}{,}{"Mauritius"}{,}{"Mexico"}{,}{"Moldova"}{,}{"Mongolia"}{,}{"Montenegro"}{,}{"Morocco"}{,}{"Mozambique"}{,}{"Myanmar"}{,}{"Namibia"}{,}{"Nepal"}{,}{"Netherlands"}{,}{"New Zealand"}{,}{"Nicaragua"}{,}{"Niger"}{,}{"Nigeria"}{,}{"Norway"}{,}{"Oman"}{,}{"Pakistan"}{,}{"Panama"}{,}{"Papua New Guinea"}{,}{"Paraguay"}{,}{"Peru"}{,}{"Philippines"}{,}{"Poland"}{,}{"Portugal"}{,}{"Qatar"}{,}{"Romania"}{,}{"Russia"}{,}{"Rwanda"}{,}{"Saint Lucia"}{,}{"Samoa"}{,}{"Sao Tome and Principe"}{,}{"Saudi Arabia"}{,}{"Senegal"}{,}{"Serbia"}{,}{"Seychelles"}{,}{"Sierra Leone"}{,}{"Singapore"}{,}{"Slovakia"}{,}{"Slovenia"}{,}{"Solomon Islands"}{,}{"Somalia"}{,}{"South Africa"}{,}{"South Korea"}{,}{"South Sudan"}{,}{"Spain"}{,}{"Sri Lanka"}{,}{"Sudan"}{,}{"Suriname"}{,}{"Swaziland"}{,}{"Sweden"}{,}{"Switzerland"}{,}{"Syria"}{,}{"Taiwan"}{,}{"Tajikistan"}{,}{"Tanzania"}{,}{"Thailand"}{,}{"The Bahamas"}{,}{"Timor-Leste"}{,}{"Togo"}{,}{"Tonga"}{,}{"Trinidad and Tobago"}{,}{"Tunisia"}{,}{"Turkey"}{,}{"Turkmenistan"}{,}{"Tuvalu"}{,}{"UAE"}{,}{"UK"}{,}{"USA"}{,}{"Uganda"}{,}{"Ukraine"}{,}{"Uruguay"}{,}{"Uzbekistan"}{,}{"Vanuatu"}{,}{"Venezuela"}{,}{"Vietnam"}{,}{"Yemen"}{,}{"Zambia"}{,}{"Zimbabwe"}\right]$ (5)
 > $\mathrm{CountRows}\left(\mathrm{ref}\right)$
 ${185}$ (6)
 > $\mathrm{GetHeaders}\left(\mathrm{ref}\right)$
 $\left[{"Currency Code"}{,}{"2 Letter Country Code"}{,}{"Country Code for Internet Top-Level Domain"}{,}{"3 Letter Country Code"}{,}{"Heliports"}{,}{"Children under the age of 5 years underweight \left(%\right)"}{,}{"Military expenditures \left(% GDP\right)"}{,}{"Contraceptive prevalence rate \left(%\right)"}{,}{"Gross national saving \left(% GDP\right)"}{,}{"Public debt \left(% GDP\right)"}{,}{"Total renewable water resources"}{,}{"Health expenditures \left(% GDP\right)"}{,}{"Obesity - adult prevalence rate \left(%\right)"}{,}{"Hospital bed density / 1000 pop"}{,}{"Physicians density / 1000 pop"}{,}{"Education expenditures \left(% GDP\right)"}{,}{"Electricity - from other renewable sources \left(%\right)"}{,}{"Electricity - from fossil fuels \left(%\right)"}{,}{"Electricity - from nuclear fuels \left(%\right)"}{,}{"Electricity - from hydroelectric plants \left(%\right)"}{,}{"Crude oil - exports"}{,}{"Crude oil - imports"}{,}{"Crude oil - production"}{,}{"Refined petroleum products - exports"}{,}{"Carbon dioxide emissions from consumption of energy"}{,}{"Electricity - installed generating capacity"}{,}{"Refined petroleum products - production"}{,}{"Refined petroleum products - consumption"}{,}{"Refined petroleum products - imports"}{,}{"Natural gas - exports"}{,}{"Natural gas - imports"}{,}{"Natural gas - production"}{,}{"Natural gas - consumption"}{,}{"Natural gas - proved reserves"}{,}{"Crude oil - proved reserves"}{,}{"Electricity - exports"}{,}{"Taxes and other revenues \left(% GDP\right)"}{,}{"Electricity - imports"}{,}{"Telephones - mobile cellular"}{,}{"Budget surplus \left(+\right) or deficit \left(-\right) \left(% GDP\right)"}{,}{"Electricity - production"}{,}{"Electricity - consumption"}{,}{"Telephones - main lines in use"}{,}{"Net migration rate / 1000 pop / year"}{,}{"Industrial production growth rate \left(%\right)"}{,}{"Death rate / 1000 pop / year"}{,}{"Birth rate / 1000 pop / year"}{,}{"Unemployment rate \left(%\right)"}{,}{"Inflation rate \left(consumer prices\right) \left(% / year\right)"}{,}{"Total fertility rate \left(children / woman\right)"}{,}{"HIV/AIDS - adult prevalence rate"}{,}{"HIV/AIDS - deaths / year"}{,}{"Internet hosts"}{,}{"Population growth rate \left(% / year\right)"}{,}{"Labor force"}{,}{"Airports"}{,}{"Irrigated land"}{,}{"Land boundaries"}{,}{"Coastline"}\right]$ (7)
 > $\mathrm{GetData}\left(\mathrm{ref}\left[1..2,1..2\right]\right)$
 $\left[\begin{array}{cc}{"AFN"}& {"AF"}\\ {"ALL"}& {"AL"}\end{array}\right]$ (8)

Create a reference to the GeoNames data set.

 > $\mathrm{refg}≔\mathrm{Builtin}:-\mathrm{Reference}\left("Geonames"\right)$
 ${\mathrm{refg}}{≔}\left[\begin{array}{ccccc}{\mathrm{Geonames \left(GeoNamesid\right)}}& {\mathrm{Name}}& {\mathrm{Type}}& {\dots }& {\mathrm{\left(7 more\right)}}\\ {\mathrm{68}}& {\mathrm{Boneh-ye Mehdi}}& {"section of populated place"}& {\dots }& {}\\ {\mathrm{121}}& {\mathrm{Lab Sefid}}& {"locality"}& {\dots }& {}\\ {\mathrm{166}}& {\mathrm{Gorizi}}& {"locality"}& {\dots }& {}\\ {⋮}& {⋮}& {⋮}& {\ddots }& {}\\ {\mathrm{\left(1155858 more\right)}}& {}& {}& {}& {}\end{array}\right]$ (9)

Count the number of rows in the GeoNames data set:

 > $\mathrm{CountRows}\left(\mathrm{refg}\right)$
 ${1155861}$ (10)

Available data variables in the GeoNames data set include:

 > $\mathrm{GetHeaders}\left(\mathrm{refg}\right)$
 $\left[{"Name"}{,}{"Type"}{,}{"Latitude"}{,}{"Longitude"}{,}{"Country"}{,}{"Province/State/Region"}{,}{"City/County"}{,}{"Population"}{,}{"Time Zone"}\right]$ (11)

Search for Waterloo in Canada:

 > $\mathrm{Waterloo_Data}≔\mathrm{refg}\left[\left[\mathrm{Country}="Canada",\mathrm{Type}="populated place",1000<\mathrm{Population},\mathrm{Name}="Waterloo"\right]\right]$
 ${\mathrm{Waterloo_Data}}{≔}\left[\begin{array}{ccccc}{\mathrm{Geonames \left(GeoNamesid\right)}}& {\mathrm{Name}}& {\mathrm{Type}}& {\dots }& {\mathrm{\left(7 more\right)}}\\ {\mathrm{6176821}}& {\mathrm{Waterloo}}& {"populated place"}& {\dots }& {}\\ {\mathrm{6176823}}& {\mathrm{Waterloo}}& {"populated place"}& {\dots }& {}\end{array}\right]$ (12)

Return the all of the data from the search above:

 > $\mathrm{GetData}\left(\mathrm{Waterloo_Data}\right)$
 $\left[\begin{array}{ccccccccc}{"Waterloo"}& {"populated place"}& {45.3500799999999984}& {-72.5158200000000051}& {"Canada"}& {"Quebec"}& {"Monteregie"}& {4064}& {"America/Toronto"}\\ {"Waterloo"}& {"populated place"}& {43.4667999999999992}& {-80.5163900000000012}& {"Canada"}& {"Ontario"}& {\mathrm{undefined}}& {97475}& {"America/Toronto"}\end{array}\right]$ (13)

To return specific data, such as the Population:

 > $\mathrm{GetData}\left(\mathrm{Waterloo_Data}\left[..,\mathrm{Population}\right]\right)$
 $\left[\begin{array}{c}{4064}\\ {97475}\end{array}\right]$ (14)

Compatibility

 • The DataSets[Builtin][Reference][GetName], DataSets[Builtin][Reference][GetIdentifier], DataSets[Builtin][Reference][GetDescription], DataSets[Builtin][Reference][GetElementNames], DataSets[Builtin][Reference][CountRows], DataSets[Builtin][Reference][GetHeaders] and DataSets[Builtin][Reference][GetData] commands were introduced in Maple 2015.
 • For more information on Maple 2015 changes, see Updates in Maple 2015.