text:
Definitions, data sources and methods
Product classifications
North American Product Classification System (NAPCS) Canada 2017 Version 2.0
Purpose of the classification
The underlying concepts
The classification structure and coding system
Relationship to other classifications
Summary of changes from NAPCS Canada 2017 Version 1.0 to NAPCS Canada 2017 Version 2.0
Product data in the Canadian statistical system
The methods for implementing the classification
The North American Product Classification System (NAPCS) Canada is a classification of products (goods and services) designed primarily for use in statistical programs. It is Statistics Canada's official standard for the collection, processing and dissemination of product statistics in its economic, business and trade statistics programs. This includes, for example, statistics on the value of exports and imports by type of product, the value of industry production and consumption by type of product, and industrial product price indices.
Statistical classifications are comprehensive structured lists of mutually exclusive categories. In practice, this means that there is always a category in the classification if the object falls within the scope of the classification, and that the object can be classified in only one category. The section titled "The underlying concepts" further discusses the object and scope of NAPCS Canada.
The structure of NAPCS Canada is hierarchical. This type of classification system enables the collection, analysis and publication of data at different levels of detail, in a standardized way. The section titled "The classification structure and coding system" discusses the structure of NAPCS Canada in greater detail.
The purpose of standard classifications is to support the integration of data obtained from multiple sources by organizing the documentation, collection, processing, presentation and analysis of data in a systematic manner. Classifications are essential elements of a coherent and efficient statistical system.
NAPCS Canada has been developed to support the integration of product statistics. NAPCS Canada 2017 was approved as the departmental standard on September 19, 2016. The next section provides an overview of the product statistics domain to give a sense of the potential applications of the classification.
The first version of NAPCS Canada, known as version 0.1, was published in 2007. It was the first in a series of developments to re-organize the system used to classify product data in Statistics Canada's business and trade statistics programs.
The development of the classification started a few years earlier as a joint project of the national statistical agencies of Canada, Mexico and the United States. The NAPCS project followed the adoption by the three countries of a common industry classification, the North American Industry Classification System (NAICS) in 1997. The purpose of the NAICS project was to develop a standard that allowed comparisons of industry data among the three participating countries. The development of NAPCS was meant to serve the same purpose but for product statistics.
In the beginning, the trilateral project focused on developing a classification of service products. At that time, the national statistical systems produced much less information for services than for goods, and the development of a detailed standard classification for service products was seen as a necessary first step towards improving that component of the statistical system.
The first version of NAPCS Canada was largely based on unpublished trilateral work. The scope of the classification was limited to the products (outputs) of selected service-producing industries. Though presented as provisional, parts of the classification had been tested and used to collect product data in selected annual service industry surveys.Footnote 1 The classification also provided a basis to define service products in the Input-Output Commodity Classification (IOCC).Footnote 2 The simultaneous integration of NAPCS Canada in the collection system and the economic accounts made a significant contribution towards improving the coherence of product data.
At the time, NAPCS Canada (version 0.1) was complemented by several specific purpose classifications for the collection and publication of statistics concerning the supply and use of goods. Some of these classifications had the status of departmental standards, for instance the Annual Survey of Manufactures (ASM) - List of Goods, the Canadian Export Classification (CEC) and the Customs Tariff (CT). Others were not published as standard classification systems, yet were instrumental in the collection of product data. This included, for example, the classifications used to collect and organize data on the production of agricultural and mining products, and the classifications used to produce raw material price indices (RMPI) and industrial product price indices (IPPI).
The main weakness of the multi-classification system was the lack of integration between them. They had been developed at different points in time, sometimes on the basis of different criteria, to serve different purposes.
In particular, the lack of comparability between data on the domestic production of goods and the exports and imports of those same goods was seen as a significant shortcoming. The second phase in the development of NAPCS Canada addressed that issue.
NAPCS Canada 2007 was published in 2011. The scope of NAPCS Canada 2007 was limited to the universe of tradable goods, and it therefore complemented version 0.1 of NAPCS Canada whose scope was limited to selected services.
NAPCS Canada 2007 consisted of groups (3 digits) and classes (5 digits). The class level was developed to integrate the classifications used for production and international merchandise trade statistics. The approaches to integrate these classifications into NAPCS Canada had to differ however, due to constraints in their implementation.
In the case of international merchandise trade classifications, the approach consisted of using concordances. The classifications of exports and imports - the Canadian Export Classification (CEC) and the Customs Tariff (CT) - are derived from the Harmonized Commodity Description and Coding System (HS), a mandatory international classification maintained by the World Customs Organization (WCO). The concordance was developed between the classes of NAPCS Canada 2007 (5 digits) and those of the CEC and CT. This approach allowed for the presentation of import and export statistics on the basis of the HS as required by international agreement and on the basis of NAPCS as required for coherence of production and trade statistics within the Canadian statistical system.
The systems used to classify the domestic production of goods on the other hand are developed and maintained by Statistics Canada. The intent was to integrate those classifications as well as those used for industrial producer prices indices (IPPI) and raw material price indices (RMPI) at a level below the class level in a future version of NAPCS Canada.
The 5-digit classes of NAPCS Canada 2007 were aggregated into 3-digit groups. The group level was designed to serve two purposes:
Provide analytical groupings to publish selected statistics.
Provide a basis to define higher level categories of alternate structures or variants. The first variant was for the presentation of export and import statistics. The new higher level categories replaced the summary import groups (SIG) and the summary export groups (SEG) that had been in use for several decades.
International merchandise trade statistics were first published on the basis of NAPCS in October 2012.
NAPCS 2007 represented an important step towards the greater harmonization of product statistics. In addition to providing a framework to integrate existing production and international trade statistics, it established an approach to further develop and complete the system. The approach was fully implemented in NAPCS Canada 2012 (version 1.0), published in 2013.
The main accomplishment of NAPCS Canada 2012 was to merge previous versions of NAPCS Canada and program-specific classificationsFootnote 3 into a single system covering all goods and services. The classification system was designed to accommodate the needs and constraints of several business and trade statistics programs. The design of the classification is discussed in more detail in the section titled "The classification structure and coding system".
In addition to a traditional standard hierarchical structure, NAPCS Canada 2012 embedded a system to create variants of the standard classification for programs that required a more detailed classification (extension variants), or a different aggregation structure to meet different analytical needs (regrouping variants). The design of variants is discussed in more detail in the section titled "Classification variants".
Two updates to NAPCS Canada 2012 (versions 1.1 and 1.2) have been released, both in 2015. The updates were meant to improve the relevance and coherence of the classification. The most significant change was the addition of definitions for all categories, introduced in version 1.2. At the lowest level of the classification, definitions include a descriptive text, as well as illustrative examples, inclusions and exclusions where necessary. This finalized the development of NAPCS Canada into a complete standard statistical classification.
What is now renamed NAPCS Canada 2017 Version 1.0 was released on February 15, 2017, which constituted the first revision of the classification and was coordinated with the revision of North American Industry Classification System (NAICS).
Although NAPCS Canada revisions are planned to occur every five years, Statistics Canada needs to respond to the legalization of cannabis by measuring various aspects of the introduction of cannabis in the Canadian economy and society. An important part of measuring the economy and society is using statistical classifications. It is common practice with classifications that they are updated and revised as new industries, products, occupations and educational programs are introduced into the Canadian economy and society. The revision of NAPCS Canada became necessary to respond to the legalization of cannabis for non-medical use, which brings new products on market that will have an immediate impact in the Canadian economy and society. The new cannabis legal framework is planned to officially take effect on October 17, 2018.
NAPCS Canada 2017 Version 2.0 is being released so that statistical programs are ready for the new cannabis legal framework, and that users of NAPCS Canada have access to an updated product classification. At the same time, other parts of the classification were updated based on the needs to clarify some of the products in the classification (see Summary of changes).
Statistical classifications are built around three basic concepts: the object classified or statistical unit, the scope or universe of the classification, and the criteria used to group statistical units in standard categories. In the case of NAPCS Canada, two of these concepts – the statistical unit and the scope of the classification - are modelled on concepts of the 2008 System of National Accounts (SNA).Footnote 4
The SNA provides the set of definitions, classifications and accounting rules to support the production of internationally comparable economic accounts. The concepts underlying the production account are particularly relevant for product classifications. They are described in detail in Chapter 6 (The production account) of the 2008 System of National Accounts (SNA) manual. The sections that follow provide a brief overview and relevant excerpts from it.
The statistical unit
The following are relevant excerpts from the 2008 SNA manual concerning the concept of product in economic accounts:
"Products are goods and services (including knowledge-capturing products) that result from a process of production." (paragraph 6.14)
"Goods are physical, produced objects for which a demand exists, over which ownership rights can be established and whose ownership can be transferred from one institutional unit to another by engaging in transactions on markets. They are in demand because they may be used to satisfy the needs or wants of households or the community or used to produce other goods or services." (paragraph 6.15)
"Services are the result of a production activity that changes the conditions of the consuming units, or facilitates the exchange of products or financial assets. These types of services may be described as change effecting services and margin services respectively. Change-effecting services are outputs produced to order and typically consist of changes in the conditions of the consuming units realized by the activities of producers at the demand of the consumers. Change-effecting services are not separate entities over which ownership rights can be established. They cannot be traded separately from their production. By the time their production is completed, they must have been provided to the consumers.... Margin services result when one institutional unit facilitates the change of ownership of goods, knowledge-capturing products, some services or financial assets between two other institutional units." (paragraphs 6.17 and 6.21)
"Knowledge-capturing products concern the provision, storage, communication and dissemination of information, advice and entertainment in such a way that the consuming unit can access the knowledge repeatedly ... Whether characterized as goods or services, these products possess the essential common characteristic that they can be produced by one unit and supplied to another, thus making possible division of labour and the emergence of markets." (paragraph 6.22)
From these excerpts, the following elements emerge as fundamental to identify products:
they are goods and services that result from production processes;
they are in demand to satisfy the needs of households or the community, or used to produce other goods or services;
they are produced by one unit and supplied to another; and
they are transacted (bought, sold, transferred or placed in inventory).
The use of these criteria in combination excludes services produced for own use by households.
As is often the case, there are exceptions to the rules. NAPCS Canada includes a few products that do not result from production processes, namely recovered products such as recycled paper and plastics and used merchandise. These products result from a consumption process rather than a production process. They are however in demand and their inclusion allows for the measurement of significant transactions in selected surveys that use NAPCS Canada.
The scope of the classification
The SNA concepts underlying the production accounts were also used to determine the scope of NAPCS Canada. It is modelled on one of the five elements that define the production boundaries of the SNA.
"The production of all goods or services that are supplied to units other than their producers, or intended to be so supplied, including the production of goods or services used up in the process of producing such goods or services". (paragraph 6.27a)
This concept embodies both market and non-market goods and services.
In addition to the production of goods or services supplied to units other than their producers, the production boundary of the SNA includes the production of selected products for final consumption or capital formation by their producers, as well as the production of housing services by owner occupiers. This type of production is generally known as own account production.
NAPCS Canada does not separately identify products produced on own account. The inclusion of own account production in the production boundary of the SNA is more a matter of accounting than a matter of classification. From a classification point of view, products produced on own account can be classified in the same manner as those produced for others. For example, housing services produced by owner occupiers could be classified with housing services produced for market. The relevant category of NAPCS is class 76411 – Residential rents.
The inclusion or exclusion of assets is an issue often raised in discussions of the scope of product classifications. NAPCS Canada is a product classification, not an asset classification. As is the case in the SNA, assets and products are classified using different classifications in the Canadian system.
That said, most assets begin their life cycle as products resulting from a production process. These products later become assets by virtue of their use as capital in a production process. These are known in the SNA as non-financial produced assets, and they are products in NAPCS Canada. For example, this would include machinery and software.
So called non-financial non-produced assets however are out of scope for NAPCS Canada. The SNA describes these assets as "consisting of three categories: natural resources; contracts, leases and licences; and purchased goodwill and marketing assets". Though the assets are not in scope for NAPCS because they are not produced, the services of these assets are in scope since they are produced. For example, the services of natural resources assets are covered by NAPCS 6511121 - Licensing of rights to explore for or exploit renewable and non-renewable resources and the services of franchise assets are covered by NAPCS 6511114 - Franchising agreements.
Financial assets are also out of scope for NAPCS Canada.
The universe of NAPCS Canada can be summarized as follows:
Out of scope
Non-financial, non-produced assets (except the services related to them)
In scope
Non-financial, produced assets (as products, not as assets)
Market goods, intangible goods and services
Non-market public goods and services
Recovered and used products (even if not the result of production)
The classification criteria
The classification criteria refer to the attribute(s) of the statistical unit used to create the most detailed categories of the classification and to group them into analytical aggregates. The attribute used to create the most detailed categories of a classification must be observable and verifiable in the context of a statistical operation, or it must be possible to derive the information from a set of observed characteristics.
Some classifications are built by the systematic application of one or more criterion. The National Occupational Classification (NOC) is a good example of such a system. The NOC uses two attributes of jobs: the ten broad occupational categories are based on skill type and the categories within are largely based on skill level. The North American Industry Classification System (NAICS) also defines its most detailed categories on the basis of a single criterion whenever feasible; establishments are grouped into industries according to the similarity in the production processes used to produce goods and services.
Other classifications use mixed criteria to create detailed categories and groupings. NAPCS Canada falls into this category, in part, as a result of the nature of the classification, and in part as a result of characteristics inherited from classification systems embedded into it.
The universe of products is very diverse. NAPCS Canada recognizes close to 3,000 categories of goods and services at its most detailed level (7-digit) to represent that diversity. In theory though, it could include several times that number of detailed categories, but such a classification would not be sustainable in a statistical system. One of the challenges in building such a system is to develop useful criteria to identify a manageable number of detailed categories. Because the universe of products is so diverse, it is not possible to use a single criterion.
The criteria most commonly used to identify products in NAPCS Canada, separately or in combination, are:
Physical characteristic of the product – For example, live animals are classified by species, ores and concentrates by type of metal or mineral deposit, and crude oil by density.
Stage of processing – For example, unwrought metal products are distinguished from basic and semi-finished metal products, and pulp and paper products are distinguished from converted paper products.
Technology or process – For example, cold-rolled steel products are distinguished from hot-rolled steel products, transportation services are distinguished by mode, and advertising space and time and broadcasting distribution services are classified by mode of delivery (in print, cable or satellite television, online (Internet), etc.).
Purpose or intended use – For example, fresh potatoes are classified according to their intended use such as for table consumption, for processing or for seed; architectural and engineering services are classified according to the type of project into which they are embedded, education services by the nature of the program, and public administration services according to purpose served.
Function – For example, fixed telecommunication are distinguished from mobile telecommunications, management services are classified according to the type of advice provided, and personal and personal care services are classified according to the need being fulfilled.
The number of categories at the most detailed level of NAPCS Canada reflects the accumulated and learning experiences with the implementation of product classifications.
The organization of detailed categories into higher level groupings is not based on a unique criterion either, but there is a dominant principle of organization nested in NAPCS Canada, the industry of origin.
This characteristic is inherited from classifications embedded into NAPCS Canada; many of these classifications had been developed to collect product data (outputs) for specific industries and the Supply and Use Classification of the Input-Output framework that underlies the class level of NAPCS Canada is very much based on an industry of origin model.
As a result, the presentation and organization of NAPCS Canada is similar to what is traditionally found used in industry classifications. The outputs of primary industries (agriculture, forestry and mining) appear at the beginning of the structure, followed by those of manufacturing industries, transportation services industries, trade industries, and other services producing industries.
The approach used in NAPCS Canada to create detailed categories and group them into analytical groupings is not unique. The United Nations Central Product Classification (CPC) and the Eurostat Standard Classification of Product by Activity (CPA) use a similar approach. The CPC and CPA are comparable to NAPCS Canada in purpose and in scope.
NAPCS Canada contains a standard classification structure and standard variants of that structure. The standard structure is intended for broad use, whereas each variant is designed to meet a specific user need.
The standard classification structure
The standard classification structure is hierarchical, that is, a structure where categories at the lower levels are aggregated into the next higher level. It comprises four levels; group, class, subclass and detail. The table below provides the number of categories within each of these levels.
Nomenclature and number of categories within each level of NAPCS Canada 2017 Version 2.0
Number of categories
3-digit code 158
6-digit code 1,470
The advantage of hierarchical classifications is that they enable the collection, dissemination and analysis of data at different levels of detail, in a standardized way. For example, a survey program may collect data using the most detailed level of the classification but publish data at a higher level to protect confidentiality.
NAPCS Canada is unique in that each level of the hierarchy has been designed with a particular use in mind. This approach was adopted in recognition that different product statistics programs can support a more or less detailed classification, and to facilitate the integration of different types of product data. The main purpose of each level of the classification is described below, from the most detailed to the most aggregated level.
The detail level (7-digit) of the classification was designed to be the most precise for which business statistics programs would collect and publish data on the outputs of industries. This level of the classification is most commonly used in annual industry surveys to collect data on revenues by type of goods or services produced.
The primary purpose of the subclass level (6-digit) is to support the production of price indices for the products defined in NAPCS. At the time of publishing NAPCS Canada 2017, this use was limited to the production of industrial product price indices (IPPI), raw material price indices (RMPI) and international merchandise trade price indices (IMTPI). The IPPI program measures price changes at the factory gate for products sold by Canadian manufacturers and the RMPI program measures price changes for raw materials purchased by Canadian industries for further processing. The universe of industrial products and raw materials represents about half of the subclasses of NAPCS. The IMTPI measures price changes for imported and exported goods.
The class level (5-digit) is the target level to produce coherent statistics in current and constant dollars on the supply and use of products, including the production, imports, exports and consumption of products. It is at the core level of the classification. As mentioned earlier in the introduction, the input-output accounts provide the framework to integrate product statistics into a coherent system that describes the supply and use of goods and services in our economy. For that reason, the Supply and Use Product Classification (SUPC) used for the production of input-output tables is largely embedded at the class level of NAPCS.
Finally, the group level (3-digit) provides higher level aggregates primarily for presentation and analytical purposes. This level is also the basis to define alternative aggregation structures, known as regrouping variants (discussed in the next section).
NAPCS Canada 2017 uses a traditional hierarchical coding system where the code of a child adds a digit to the code of the parent. The classification of crude oil and bitumen (group 141) shown below illustrates how the coding system works.
The classification of crude oil and bitumen (group 141)
Crude oil and bitumen
Conventional crude oil
Light and medium crude oil
Crude and diluted bitumen
Crude bitumen
Diluted bitumen
Synthetic crude oil
The reader will note that a category at a lower level can be identical to a category at the next higher level; in the example above, synthetic crude oil is found at the detail (1411311), subclass (141131) and class (14113) levels. This approach ensures that the classification is comprehensive at every level.
In addition to codes and titles, NAPCS provides definitions to help users understand the intended scope of each category and facilitate implementation. The definitions are constructed based on a set of guidelines developed by the Neuchâtel group of the United Nations Economic Commission for Europe (UNECE);Footnote 5 and guidelines from the Generic Statistical Information Model (GSIM) – Statistical Classifications Model. The definition at the most detailed level includes:
A general description of the category
A list of illustrative examples
Where necessary, a list of borderline cases that belong to the category (inclusions)
Where necessary, a list of borderline cases that do not belong to the category with a reference to the classification codes to which the excluded cases belong (exclusions).
Classification variants
Standard classifications are essential components in a coherent statistical system. That said, it is impossible for a single classification to serve all analytical needs. This limitation of standard classifications is well recognized in the field and has been addressed by the development of standard classification variants, of which there are two types:
Extension variants add one or several levels below the most detailed level of the standard classification by splitting categories of the standard classification.
Regrouping variants add one or several levels above a level of the standard classification by regrouping categories of the standard classification.
Typically, classification variants are subject-specific and are narrower in scope than the complete standard classification. They are not meant to replace the standard, but rather to complement it by adding new categories where needed (extension variants), or enhancing the analytical usefulness of the classification by changing its organization (regrouping variants). Ideally, statistical programs that adopt a classification variant can also present data on the basis of the standard classification.
There are now eight variants of NAPCS Canada 2017 Version 2.0:
Agricultural goods (extension variant) - This variant adds two additional levels (8 and 9 digits) below the detailed categories of NAPCS Canada 2017 Version 2.0 covering farm and unprocessed fish products.
Capital expenditures (CAPEX) on non-residential construction (regrouping variant) - This variant defines two new high level aggregates (sections and divisions). The divisions result from the regrouping of standard classes (5-digit) of NAPCS Canada 2017 Version 2.0 covering non-residential buildings, civil engineering works (infrastructures), selected mining and oil and gas support services, and selected remediation services. The codes for the added sections and divisions are alphanumeric. The variant replaced a program specific classification in use since 1965.
Computer and peripherals price index - CPPI (extension variant) - This variant adds two additional levels (8 and 9 digits) below the detailed categories of NAPCS Canada Version 2.0 covering computers, computer peripherals and smartphones.
Farm Products Price Index - FPPI (regrouping variant) - This variant defines a new aggregate level (sections) by regrouping 3-digit categories of NAPCS Canada 2017 Version 2.0 covering farm products. Other aggregate levels were also created to regroup 5, 6 and 7 digits categories, where needed. An additional level of detail (8 digit) was kept as it is shared with the Agricultural goods extension variant. The coding for the new levels is alphanumeric.
Industrial Product Price Index - IPPI (regrouping variant) - This variant defines a new aggregate level (sections) by regrouping 3-digit categories of NAPCS Canada 2017 Version 2.0 covering products sold by Canadian manufacturers. The coding for the new sections is alphanumeric. The variant replaced a program specific classification (Principal Commodity Groups or PCG) in use since the early 1980s.
Manufacturing and Logging (extension variant) - This variant adds an extra 8-digit variant code (level 5), under the 7-digit standard classification's detail code (level 4). These extra digit variant codes essentially cover areas related to wood and lumber products for NAPCS Canada 2017 Version 2.0.
Merchandise import and export accounts (regrouping variant) - This variant defines two new high level aggregates (sections and divisions). The divisions result from the regrouping of standard groups (3-digit) of NAPCS Canada 2017 Version 1.0 covering imported and exported merchandise. The codes for the added sections and divisions are alphanumeric. The variant replaced the summary import groups (SIG) and summary export groups (SEG) that were in use for several decades.
Raw Materials Price Index - RMPI (regrouping variant) - This variant defines a new aggregate (sections) by regrouping 3-digit categories of NAPCS Canada 2017 Version 2.0 covering raw materials processed by Canadian manufacturers. The coding for the new sections is alphanumeric. The variant replaced a program specific classification (Principal Commodity Groups or PCG) in use since the early 1980s.
North American Industry Classification System (NAICS) Canada
NAICS Canada is the official standard to group Canadian establishments into industries. It supports the collection, processing and dissemination of industry-based statistics.
The introduction of the NAICS manual describes the classification as "...an industry classification system developed by the statistical agencies of Canada, Mexico and the United States. Created against the background of the North American Free Trade Agreement, it is designed to provide common definitions of the industrial structure of the three countries and a common statistical framework to facilitate the analysis of the three economies."
NAICS Canada and NAPCS Canada are fundamentally different in that they have their own purpose, underlying concepts and scope. The table below outlines the basic characteristics of the two systems to illustrate those differences.
Basic characteristics of NAICS Canada and NAPCS Canada
Characteristics of the classification
NAICS Canada
NAPCS Canada
Statistical unit (or object classified)
Establishments (producers) Products (goods and services)
Classification criteria
Similarity of production process(es) Similarity in a physical characteristic, stage of processing, technology, purpose or function
Scope or universe
Establishments operating within Canada Products produced in Canada and consumed in Canada or elsewhere, or produced elsewhere and consumed in Canada
Statistical domain
Industry statistics (e.g., industrial outputs, and intermediate, labour and capital consumption) Product statistics (e.g., industry outputs and inputs by type, exports and imports by type, price indices)
Examples of analysis supported by related data
Changes in industrial structure or productivity over time Total supply and demand, market share analysis, shifts in consumption behaviour
Though different, these systems are complementary in that they provide the underlying classification frameworks for the country's production accounts.
Though it is the case that many products are entirely or mostly produced by one industry, it is not always so. For example, meals are mostly produced and consumed in food services establishments, but are also produced in hotels, cinemas, supermarkets and schools. It is also worth noting that product classifications are used outside the scope of industry statistics; for some uses, knowing the industrial origin of products is neither useful, nor desirable.
Supply and Use Product Classification (SUPC)
In the first section of the introduction, the purpose of NAPCS Canada is described as supporting the integration of product data obtained from multiple sources by organizing the documentation, collection, processing, presentation and analysis of data.
In practice, the source for integrated product data is the Input-Output Account (IO) of the Canadian System of Macroeconomic Accounts (CSMEA). The IO provides the set of definitions, classifications and accounting rules necessary to produce balanced industry and commodity accounts which highlight the sources of supply and demand in the economy. The Supply and Use Product Classification (SUPC) is the basis for the commodity accounts. Making the SUPC an integral part of NAPCS Canada was a necessary condition to achieve the stated objective.
The SUPC has been integrated into NAPCS Canada at the class level (5-digit) where conceptually and practically feasible, and the SUPC has been adapted to conform to NAPCS Canada where possible. There are, however, a small number of conceptual and practical constraints that prevent embedding the SUPC into NAPCS entirely. The most significant differences are conceptual in nature.
The first conceptual difference concerns the scope of the two classifications.
The SUPC includes a number of imputed, non-market, fictive and primary input (e.g., labour and capital) commodities that are out-of-scope for NAPCS. The inclusion of these commodities in the SUPC is required to implement SNA accounting concepts.
NAPCS includes a number of intellectual property products that are out of scope for the SUPC, namely intellectual property produced on own account for sale with all-attendant rights. The inclusion of these commodities in NAPCS results from trilateral agreement. The rationale for inclusion is that these types of intellectual properties are produced by one unit and supplied to another. The data to fully implement this part of the classification are not available.
The second conceptual difference concerns the use of different classification criteria.
In finance and education services in particular, NAPCS Canada uses criteria agreed to in trilateral development work. These criteria are thought to be more representative of the specific services than reflecting the institutional organization delivering the services, as found in the existing classification. To date, the data to fully implement NAPCS are not available. As well some of the NAPCS detail in finance services is not consistent with CSMEA concepts.
Though these differences are real, the goal of integrating the SUPC into NAPCS has largely been achieved. More than 80% of the remaining categories of NAPCS classes coincide with those of SUPC, and the remaining 20% or so are splits or groupings of SUPC categories.
Central Product Classification (CPC)
The CPC is an international standard to classify all goods and services. It is published by the Statistics Division of the Department of Economic and Social Affairs of the United Nations.
The CPC is very similar to NAPCS Canada in concept, purpose and scope. The introduction of the CPC manual describes it as follows:
"The Central Product Classification (CPC) constitutes a complete product classification covering all goods and services. It serves as an international standard for assembling and tabulating all kinds of data requiring product detail, including statistics on industrial production, domestic and foreign commodity trade, international trade in services, balance of payments, consumption and price statistics and other data used within the national accounts. It provides a framework for international comparison and promotes harmonization of various types of statistics related to goods and services."Footnote 6
The similarity extends to the general organization of the classification. Like NAPCS Canada, the CPC is a four level hierarchical classification that contains a similar number of detailed categories.
NAPCS Canada is not fully compatible with the CPC. In order to do so, it would have been necessary for the most detailed categories of NAPCS Canada to coincide with, be grouped or be subset of, the most detailed categories of the CPC. This would have required changes to the national classification not possible at this time.
It is the intent to develop and publish a concordance between the two systems that will assist users in understanding the similarities and differences between them.
Harmonized Commodity Description and Coding System (HS)
The HS is the international standard used by more than 200 countries, including Canada, to classify and measure international merchandise trade. Like NAPCS Canada, the HS is a product-based system, but its universe is limited to transportable goods. These HS goods are mostly covered by groups 111 to 482 of NAPCS Canada.
The HS is a more detailed classification than NAPCS Canada; at its most detailed level (sub-heading or 6-digit), it recognizes more than 5,000 goods. The HS generally classifies detailed goods on the basis of the following attributes: component material, degree or stage of processing, and use or function.
The structure of the HS is different than the structure of NAPCS Canada and no attempt was made to integrate it into NAPCS Canada. Doing so would have made it more difficult to achieve the main objective of NAPCS Canada, that of integrating several Canadian classifications into a single standard classification. That said, the class level (5-digit) of NAPCS Canada is by design a bridge level between various classifications, and the most detailed categories of the HS map well to the class level of NAPCS Canada.Footnote7
Extended Balance of Payments Services Classification (EBOPS) 2010
The EBOPS is the international standard to classify and measure international trade in services. It can be seen as a complement to HS for the classification and measurement of international trade in goods and services.Footnote 8 A version of EBOPS is used in the Canadian Balance of Payments Accounts.
At its highest level, the 2010 version of EBOPS recognizes twelve broad service categories, which are further sub-divided into a small number of detailed categories.
For the most part, the EBOPS is a product based classification system. For those categories that are product based, it is theoretically possible to create a concordance between EBOPS and more detailed product classifications like NAPCS Canada. Such a concordance has already been developed between the Central Product Classification (CPC) of the United Nations and EBOPS,Footnote 9 and the CPC is similar to NAPCS Canada in concept, purpose and scope.
However, there are three broad categories that are defined on the basis of the entity engaged in the trade activity or the mode of consumption, rather than on the basis of the type of service traded. These categories are travel, construction and government goods and services. The use of different classification criteria in these cases makes it difficult to develop a concordance between the classifications systems. This is especially true for the travel category, which includes traveller expenses on a range of goods and services. There is a need for convergence of product classifications of industry and trade for comparative purposes.
Trilateral North American Product Classification System (NAPCS)
The trilateral NAPCS 2017 is a six-level hierarchical structure consisting of 24 sections, 61 subsections, 172 divisions, 276 groups, 497 subgroups, and 1,167 trilateral productsFootnote 10. At this time, the trilateral NAPCS structure is a reference classification system for beta testing. The development of the trilateral version of NAPCSFootnote 11 has had a significant influence on the development of NAPCS Canada.
As part of their common classification development work, the three national statistical agencies reconsidered the traditional approaches in the organization of industry and product classifications. In particular, there were numerous discussions regarding the relevant classification criteria for each type of classification.Footnote 12 In the case of the product classification, the conclusion was that the analytical needs of users of product data would be better served if the aggregation structure emphasized demand-based attributes of products rather than supply-based attributes of products. This is a departure from the existing practice of emphasizing the industry of origin of products, clearly a supply-based attribute. The new structure emphasizes attributes such as the substitutability of products, the complementary nature of products, or the similarity in markets being served by the products.
NAPCS Canada does not embed the new approach. Doing so would have been too disruptive and would have complicated the task of moving from a multi-to-single product classification system. Instead, NAPCS Canada uses a more traditional aggregation structure, more or less based on the industry of origin of products.
That said, the approach adopted for the trilateral NAPCS is a useful exercise. The most detailed categories of NAPCS Canada have been defined so as to permit mapping into the most detailed trilateral categories. This means that the Canadian detailed categories can be re-organized using the trilateral aggregation structure. In effect, the trilateral aggregation structure becomes a regrouping variant of the Canadian aggregation structure, with few exceptions. The availability of data at the most detailed level of NAPCS Canada will continue to influence the extent of the trilateral work.
NAPCS Canada 2017 Version 2.0 was needed mainly in response to the legalization of cannabis for non-medical use. Other parts of the classification were updated based on specific requests from within Statistics Canada and in consultation with external clients in the case of research and experimental development (see "Decomposition of classification items" below). Some categories were added, others were split, transferred or merged. The Generic Statistical Information Model (GSIM) is used to identify the types of changes made to the classification. Real changes are those affecting the scope of the existing classification items or categories, whether or not accompanied by changes in the title, definition and/or the coding. Virtual changes are those made in coding, titles and/or definitions, while the meaning or scope of the classification item remains the same. The "real changes" are the most important ones for analysis.
A complete list of all changes is released as a separate reference document. The list of changes can also be obtained upon request, in Excel format, from Statistics Canada at: statcan.standardsproduct-normesproduit.statcan@canada.ca.
Here are some examples of real changes:
Creation of new classification items
Close to 70 classification items or categories were added as "new" in NAPCS Canada 2017 Version 2.0. To introduce new cannabis products into the classification, a number of classification items or categories were created:
to cover for agricultural and manufactured cannabis goods (see new group 213 - Cannabis products) and new detail product (see 6814191 - Cannabis products manufacturing services);
to cover for wholesale (see new class 55121 - Cannabis products, at wholesale); and
to cover for retail sale (see new class 56113 - Cannabis products, at retail).
Also added were a new subclass for "prefabricated plastic and concrete buildings and buildings of other non-wood material, and components thereof" (see code 471112) with its detail level (see code 4711121) and a new detail classification item for "battery chargers for electric automobiles" (see code 4752316).
Combination of classification items
Combinations consist of mergers and take-overs among classification items. Essentially, new groupings were created with the intent to re-arrange the classification of non-residential buildings by adding new classes for commercial buildings (see new class 62212) and institutional buildings (see new class 62213), and realigning existing classification items under these classes.
Decomposition of classification items
About 224 classification items or categories are a result of either a breakdown or a split. The majority of the "real changes" were decompositions. The most important changes, in terms of the number of categories affected is related NAPCS Canada group 642 - Research and experimental development (R&D). In anticipation of a new classification of R&D being developed in partnership between Statistics Canada and Government of Canada's granting agencies and councils,Footnote 13 NAPCS Canada has been revised to align with the Frascati Manual 2015Footnote 14 for the classification of R&D by fields of research. This includes the "broad classification" (6 categories converted into NAPCS Canada 5-digit classes), and "second-level classification" (42 categories converted into NAPCS Canada 6-digit subclasses and 7-digit detailed levels) from the Frascati Manual 2015.
Other examples of decomposition-type changes are related to the addition of more detailed classification items for:
maple products (see class 11513);
low alcohol beers, wines, ciders and other fermented drinks (see class 19311);
other manufactured goods such as:
cigar, chewing and smoking tobacco (see group 212);
asphalt (see class 26211);
aromatic hydrocarbon gases and liquefied refinery gases (see class 26321);
other inorganic and organic chemicals (see class 27113);
nitric acid, ammonia and ammonium compounds (see class 27211);
polyethylene resins (see class 28111); and
cement (see class 46511);
retail sale, decompositions include:
separate classification items covering goods for infants, such as cloth diapers, vestments, costumes and unisex clothing (see class 56121);
unmanned aircraft or drones (see class 56152);
household heating fuels (see class 56161); and
incontinence products (see class 56172);
construction, public security facilities were broken down in more details (see class 62233).
Transfer of classification items or their parts
Low alcohol beers, wines, ciders and other fermented drinks were transferred from NAPCS group 211 - Alcoholic beverages to NAPCS group 193 - Carbonated and non-carbonated drinks (including low alcohol fermented drinks), bottled water and ice.
Battery chargers were transferred from NAPCS class 38125 - Other electrical equipment and components to NAPCS class 47523 - Batteries and battery chargers.
Mining buildings were transferred from NAPCS class 62361 - Mining engineering works to NAPCS class 62211 - Industrial buildings, with their own 6-digit subclass 622114 - Mining buildings.
Virtual changes
More than 430 classification items were modified as a result of a virtual change where changes were made to codes, titles and definitions without affecting the scope or meaning of the existing classification items. These types of changes are important for clarification and making necessary updates or corrections. For example, some titles and definitions were modified for agricultural products to ensure the standard classification aligns well with the variant for agriculture goods; the definitions of "unmanned aircraft (drones)" (see classes 42111 and 47532) and "synthetic crude oil" (see class 14113) were revised and the titles and definitions were updated for the types of constructions in NAPCS Canada's groups 471 - Prefabricated buildings and components thereof, 621 - Residential buildings, 622 - Non-residential buildings and 623 - Civil engineering works. The definitions of the types of constructions are similar to those of Eurostat's Classification of types of constructions (1997) and new variables created and recently approved as recommended standards for "building" and "building unit" by Statistics Canada.
Finally, all changes made (real or virtual) can potentially have an impact on the content of the classification index file, which contains inclusions, illustrative examples and exclusions. More than 8,000 inclusions and illustrative examples and more than 800 exclusions have been either added, deleted or edited in this 2.0 version of NAPCS Canada 2017. The classification index file supports coding of products and fosters fluidity when reading or using the classification.
Changes in NAPCS Canada 2017 Version 2.0 relative to NAPCS Canada 2017 Version 1.0
Net count of categories by level
NAPCS Canada 2017 Version 2.0
Net difference
3-digit level (Group)
158 157 1 0 +1
5-digit level (Class)
512 506 10 4 +6
6-digit level (Subclass)
1,470 1,409 63 2 +61
7-digit level (Detail)
2,893 2,737 156 0 +156
Product statistics can be described as those that inform on different aspects of the supply and use of goods and services in the economy, such as the value and quantity of goods and services produced by industries, the value and quantity of goods and services consumed by industries and households, the value and quantity of imports and exports of goods and services, and price changes at different points in the distribution chain. These statistics are collected by various surveys or obtained from administrative sources, and integrated into the country's economic accounts.
Product statistics are ubiquitous in the statistical system. The few examples below are by no means exhaustive; the purpose is to provide the reader a sense of the variety of statistical programs collecting and producing such statistics, and identify those that are using NAPCS Canada or are planning to do so at the time of publishing NAPCS Canada 2017.
Statistics Canada's business and trade statistics programs are the main sources of product statistics. They administer hundreds of monthly, quarterly, annual and ad hoc programs, most of which collect product data.
Among these many programs are so-called industry surveys; they are designed to measure the contribution of specific industries to the Canadian economy. Industry surveys typically collect data on the revenues, expenses and employment characteristics of establishments, and the revenue and expense components of these surveys generally gather data by type of goods or services produced and used. The majority of industry surveys are part of the agency's Integrated Business Statistics Program (IBSP) and use, or plan to use, NAPCS to classify revenues by type of goods or services produced. The following are a few examples of surveys that fall in this broad category:
The Annual Survey of Manufacturing and Logging Industries (2103)
The Annual Wholesale Trade Survey (2445)
Annual Survey of Service Industries: Software Development and Computer Services (2410)
Annual Survey of Service Industries: Amusement and Recreation (2425)
The business and trade statistics programs also comprise several programs designed specifically to gather product data. Two of these programs are large in scope and based on NAPCS, albeit in very different ways:
The Retail Commodity Survey (2008)
Canadian International Merchandise Trade (2201 and 2202)
The retail commodity survey collects data on retail sales for more than 100 categories of commodities from Canadian retailers. The classification of commodities used for collection is compatible with NAPCS.
The Canadian international merchandise trade program is based primarily on administrative data obtained from the Canadian Border Services Agency (CBSA) and the U.S. Customs Border Protection (via the U.S. Census Bureau). By virtue of an international agreement, the coding of Canadian exports and imports must be based on the Harmonized Commodity Description and Coding System (HS) maintained by the World Customs Organization (WCO). The relationship between the HS and NAPCS is defined by concordances; a more detailed description of this approach is provided in the section titled "The methods for implementing the classification".
In addition to the retail commodity survey and the Canadian international merchandise trade statistics program, business and trade statistics programs include several surveys that collect data (value and/or quantity) on the production, disposition, consumption or sales of specific goods. Though these surveys were not designed on the basis of NAPCS, they often are NAPCS compatible, at least in part. The following are a few examples of surveys that fall in this category:
Fruits and Vegetables Survey (3407)
Maple Products (3414)
Monthly Refined Petroleum Products (2150)
Crude Oil and Natural Gas (2198)
Annual Industrial Consumption of Energy Survey (5047)
Price indices are core product statistics. Statistics Canada tracks the movements of prices in a variety of markets with more than thirty statistical programs. Three major price programs have adopted NAPCS to produce their indices:
Industrial Product Price Index Program (IPPI) (2318). The IPPI measures price changes at the factory gate for commodities sold by manufacturers in Canada.
Raw Material Price Index Program (RMPI) (2306). The RMPI measures price changes for raw materials purchased by industries in Canada for further processing.
International Merchandise Trade Price Index (IMTPI) (2203). The IMTPI measures price changes for imported and exported goods.
The remaining price programs, including the Consumer Price Index (CPI), use program specific classifications not based on NAPCS, though some are NAPCS compatible.
The business and trade statistics programs also comprise a number of programs that do not, strictly speaking, measure an aspect of the supply and use of goods and services, but that do have a product dimension. The two best known ones are:
Annual Survey of Research and Development in Canadian Industry (RDCI) (4201)
Annual Capital and Repair Expenditures Survey (CAPEX) (2803)
Though NAPCS Canada was not primarily designed for this type of application, it is possible in some instances to develop NAPCS compatible classifications for use in such programs. For instance, the component of the RDCI that measures research and development expenditures by field of science is compatible with NAPCS, as is the component of the CAPEX that measures capital expenditures on non-residential construction.
While product statistics are common in business and trade statistics programs, they are rare in household statistics programs. The one major exception is the Survey of Household Spending (3508). It collects household expenditures on the basis of a detailed survey specific classification that was designed prior to the introduction of NAPCS.
The various product statistics described above are of interest by themselves, but their full analytical value resides in their integration into a coherent accounting framework. That is the role of the Canadian System of National Accounts (CSNA).
The CSNA has several accounts designed to "measure activities associated with the production of goods and services, the sales of goods and services in final markets, the supporting financial transactions, and the resulting wealth positions."Footnote 15 Among these, the input-output accounts provide the framework to integrate product statistics from a variety of sources into a system that describes the supply and use of goods, services and production factors in our economy. The supply and use product classification (SUPC)Footnote 16 underlies that framework; several versions have been developed over time. In order to achieve the objective of improving the coherence of product-level data in the Canadian statistical system, the SUPC has been incorporated into NAPCS Canada where feasible, starting with the 2009 version of the SUPC. It is the intent to maintain this integration in the future.
There are a number of conceptual and practical constraints that prevent embedding the SUPC into NAPCS entirely. That said, the integration of the classifications used for the collection and assembly of product data and the classification used to create input-output tables in a single classification is a key feature of NAPCS Canada, the feature that will contribute most to improving coherence.
The development of NAPCS Canada was a progress of process done over a period of time. The next section provides an overview of its development and implementation history.
There are three main methods for implementing NAPCS Canada: by integrating the relevant components of the classification in survey instruments, by coding on the basis of descriptions supplied by respondents, and by forced concordances.
The integration of the classification in survey instruments is a method commonly used in industry surveys to collect revenue by type of good or service produced (sold) as well as in surveys dedicated to the collection of commodity data. Since these two types of surveys target homogeneous populations, it is possible to identify the relevant components of NAPCS at the time of their design. For example, a survey targeting accounting firms would embed the products of NAPCS classes 77121 - Accounting, tax preparation, bookkeeping and payroll services and 77511 - Management consulting services since the products of these classes represent the most likely sources of revenues of these firms. For the same reason, a survey targeting retailers would embed the products of NAPCS group 561 - Retail services (except commissions) and selected products from groups 571 - Repair and maintenance services (except for buildings and motor vehicles) and 581 - Rental and leasing (except rental of real estate).
This is the most commonly used method for implementing NAPCS. The main challenge with this method is to develop reporting guides that support a consistent interpretation of the classification by respondents.
Coding on the basis of descriptions supplied by respondents is very common for industry and occupation statistics, but not so for product statistics. This is very much a function of the source of information for coding.
Industry coding is largely based on business activity descriptions from administrative records and occupation coding is largely based on descriptions supplied by individuals participating in broad scope surveys such as the Labour Force Survey or the Census of Population. In both cases, the coding exercise requires choosing among all the available codes of the relevant classification. In the product statistics domain, coding is mostly done by respondents to industry and commodity surveys; coding based on descriptions supplied by respondents is generally restricted to unallocated revenues in those surveys.
Automated and computer assisted coding are commonly used for this type of coding exercise. It consists of comparing respondents' supplied descriptions to a bank of coded descriptions. The main challenge with this method is to obtain sufficiently rich information from respondents to assign codes at the most detailed level of the classification.
As discussed earlier, the implementation of NAPCS Canada in the international merchandise trade statistics program is achieved by forced concordances. Each of the most detailed categories the Canadian Export Classification (CEC) and the Customs Tariff (CT) is linked to one of the five-digit classes of the standard classification. The CEC and CT are derived from the Harmonized Commodity Description and Coding System (HS), the mandatory classification for the coding and declaration of goods imported into Canada or exported from Canada.
The forced concordance approach is only viable if the systems being linked are based on similar concepts and are sufficiently comparable. The HS and NAPCS have been developed independently to serve different purposes and not always compatible. That said, because the concordances are done at the relatively aggregated class level of NAPCS, most of the inconsistencies between the HS based systems and NAPCS are eliminated.
At the time of publishing NAPCS Canada 2017 Version 2.0, this was the only application of the forced concordance method.
For example the software development and computer services survey and the accounting services survey.
The Input Output Commodity Classification (IOCC) is now called the Supply and Use Product Classification (SUPC).
Such as the systems used to classify manufactured goods, retail and wholesale sales by type of good, and industrial product prices.
System of National Account 2008, Statistical Papers, Series F, No.2, Rev.5 (United Nations Publication, Sales No. E.08.XVII.29)
See Neuchâtel Terminology Model, Classification database object types and their attributes, Version 2.1, 2004
See Central Product Classification (CPC), ver.2.1, United Nations Statistics Division.
Only about 5 per cent of detailed HS categories map to more than NAPCS Canada classes.
Strictly speaking, they are not complements because of some overlap between the two systems.
See: Manual on Statistics of International Trade in Services (MSITS 2010)
North American Product Classification System (NAPCS) (see NAPCS).
A joint project of the national statistical agencies of Canada, Mexico and the United States (see Trilateral NAPCS structure).
That is, the attribute or attributes of the statistical unit used to create the most detailed categories of the classification and to group them into analytical aggregates.
The granting agencies and councils are: the Canada Foundation for Innovation (CFI), the Canadian Institutes of Health Research (CIHR), the Natural Sciences and Engineering Research Council of Canada (NSERC) and the Social Sciences and Humanities Research Council of Canada (SSHRC).
OECD (2015), "Frascati Manual 2015: Guidelines for collecting and reporting data on research and experimental development, The Measurement of Scientific, Technological and Innovation Activities, OECD Publishing, Paris. DOI: http://dx.doi.org/10.1787/9789264239012-en
Statistics Canada, Input-Output Structure of the Canadian Economy in Current Prices, Statistical Activity #1401.
Formerly the Input Output Commodity Classification (IOCC).


Warmly in the Japanese style room! Suddenly with a duvet!
"Raw Yuba Kaiseki cuisine" using "Yuba" purchased from a long-established tofu store Various ingredients are incorporated for each season.
Summer only! It is indispensable for hydration! Mineral water (500 ml) 1 bottle per person, present!
2 minutes on foot from Kyoto Station!
It is a calm that I can not think of in front of the station.
Brilliant autumn leaves ...For autumn leaves information, please do not hesitate to ask!


Booking.com: Hotels in Dehradun. Book your hotel now!
Located in Dehradun, within 5 miles of Dehradun Clock Tower and 8 miles of Indian Military Academy, OMI Retreat provides free WiFi. There's a restaurant.
Located in Dehradun, Gorayya Homestay provides free WiFi and mountain views, 6 miles from Dehradun Clock Tower. All units feature air conditioning and a flat-screen TV.
Located in Dehradun, within 3.6 miles of Dehradun Clock Tower, Garden House Dehradun offers accommodations with free WiFi and air conditioning.
OYO 117 Jagat Residency is located in Dehradun, just 3 miles from Dehradun Clock Tower. Every room includes a private bathroom.
Located 6 miles from Dehradun Clock Tower and providing a garden and free WiFi, Rajul Nest provides accommodations in Dehradun.
Located within 3.7 miles of Dehradun Clock Tower and 9 miles of Indian Military Academy, OYO 14945 Hotel UK-07 provides rooms with air conditioning and a private bathroom in Dehradun.
Featuring a garden, Hotel Apple Green offers rooms in Dehradun, 3.6 miles from Dehradun Clock Tower. With free WiFi, this 3-star hotel offers a 24-hour front desk and valet parking.
Located in Dehradun, OYO 4506 Hotel Skyking is 3.6 miles from Dehradun Clock Tower. All rooms have a TV with cable channels and a private bathroom. Indian Military Academy is 9 miles from the hotel.
Offering a fitness center, Lemon Tree Hotel, Dehradun is located atop the upscale Pacific Mall. It is just 1.2 mi from the famous Paltan Bazar and the Dehradun Bus Station. WiFi access is available.
Hotel Annex is located in the heart of Uttarakhand State's business hub. It overlooks the Himalayas and offers a spa. Free WiFi and free parking are provided.
Offering free WiFi, OYO 19177 Bzoie Resort is located in Dehradun, 3.5 miles from Dehradun Clock Tower and 9 miles from Indian Military Academy. This 3-star hotel offers a 24-hour front desk.
OYO 15566 Hotel Rosewood Inn is located in Dehradun, 3.4 miles from Dehradun Clock Tower, and has free WiFi. All rooms feature a kitchen, a TV with cable channels, and a private bathroom.
Offering a multi-cuisine restaurant, Terrace and a bar, Onyx, Four Points by Sheraton Dehradun is located 525 feet from the Pacific Mall. Free WiFi access is available in the property.
Homestay with Wi-Fi in Dehradun, by GuestHouser 8432 enjoys a location in Dehradun, just 3.1 miles from Dehradun Clock Tower and 8 miles from Indian Military Academy.
SUNNYSIDE COTTAGE enjoys a location in Dehradun, just 4.4 miles from Dehradun Clock Tower and 10 miles from Indian Military Academy.


text:
Q: Python: how to efficiently choose which function to use, given two pre-made functions? Let us say I have a module myfunctions with two functions:
def functionA():
    return'Function A chosen.'

def functionB():
    return 'Function B chosen.'

Then, I have a module silly which does something with these functions:
def sillyprinter():
    print chosen_function
    print chosen_function()

Then, In my main script, I have:
import myfunctions
import silly

class FunctionChooser():
    def __init__(function_choice="A"):
        self.choose_function_given_choice(function_choice)

    def do_something_many_times(self):
        for i in range(1000):
            silly.sillyprinter()

The idea of FunctionChooser is that it is initialized with some user given information regarding which function (A or B) I want to use from myfunctions. Then, after this choice is made, the user can call do_something_many_times, which makes use of yet another module, which will use the chosen function from myfunctions many times.
In order to be efficient, I'd like to avoid the following:
1) Choosing which function to use again and again -- so I'd like to make the choice once (during initialization), and then have it "saved" somehow. This requirement disqualifies designs like:
def sillyprinter(chosen_function):
    print chosen_function
    print chosen_function()

# =================================

class FunctionChooser():
    def __init__(function_choice="A"):
        self.function_choice = function_choice

    def choose_function_given_choice(self):
        if self.function_choice == "A":
            return myfunctions.functionA
        elif self.function_choice == "B":
            return myfunctions.functionB

    def do_something_many_times(self):
        for i in range(1000):
            silly.silly_printer(self.choose_function_given_choice())

2) storing the function I'd like to choose as a class attribute, since self calls are expensive, and the use case is numerical. This requirements disqualifies designs like:
def sillyprinter(chosen_function):
    print chosen_function
    print chosen_function()

# =================================

class FunctionChooser():
    def __init__(function_choice="A"):
        self.function_choice = function_choice

    def choose_function_given_choice(self):
        if self.function_choice == "A":
            self.chosen_function = myfunctions.functionA
        elif self.function_choice == "B":
            self.chosen_function = myfunctions.functionB

    def do_something_many_times(self):
        for i in range(1000):
            silly.silly_printer(self.chosen_function)

My current idea is to do the following:
def sillyprinter(chosen_function):
    print chosen_function
    print chosen_function()

# =================================

class FunctionChooser():
    def __init__(function_choice="A"):
        self.function_choice = function_choice

    def choose_function_given_choice(self):
        if self.function_choice == "A":
            self.chosen_function = myfunctions.functionA
        elif self.function_choice == "B":
            self.chosen_function = myfunctions.functionB

    def do_something_many_times(self):
        chosen_function = self.chosen_function
        for i in range(1000):
            silly.silly_printer(chosen_function)

It is only very slightly different than the design I disqualified in 2), in that it makes a self call once and then stores that function for use as a local variable.

Is this the best way to design such "function choice" in Python, given my requirements? (see below)

EDIT: I figure I should make requirements clearer, in order to make the question less general

*

*The "function choice string" does not have to be a string -- it could be any variable that encodes for some sort of function choice.

*I want to avoid self. access calls (but perhaps . access calls in general?) due to issues with numba optimizing code with access calls: Design heuristics for writing Python classes that interact with `scipy.integrate.odeint`?

*The "function choice" variable is only given once, so we can consider it to effectively be a constant.

A: No. Functions in Python are first-class objects; treat them as such.
class FunctionChooser():
    def __init__(function_choice=myfunctions.functionA):
        self.function_choice = function_choice

    def do_something_many_times(self):
        chosen_function = self.chosen_function
        printer = silly.silly_printer
        for i in range(1000):
            printer(chosen_function)

A: The fundamental answer is that any of these three options may be the "best," depending on circumstances. But the differences between the options you've chosen are subtle, and not likely to affect performance significantly most of the time. Instead of worrying about efficiency here, you should worry about conceptual elegance. Then, if you need efficiency, optimize.
I could imagine situations when any of these three options would be preferable, conceptually.

*

*Suppose the choice of function will depend on a value that changes frequently. You'll have to check its state frequently, so what will you gain by storing it? It makes more sense simply to look it up every time. In this case, (1) is the best option.

*Suppose the choice of function won't be based on a value that changes often, or that is easy to "invert control" with (i.e. the code that pays attention to the variable knows to change the function selection as well). Unless you have an overriding reason to worry about the extra overhead of a single . access, just store this as an attribute. (And note that looking up an attribute in self is no more costly than looking up an attribute in some other object. The operation is exactly the same; there's nothing special about self!) In this case, (2) is the best option.

*Suppose, as you have, that the choice of function won't be based on a value that changes often, but that the function will itself be called frequently. Furthermore, you are certain that the . access is slowing down your code, because you have done rigorous tests. Then it makes sense to cache the result of the . access in a local variable, as in option (3). (But note that in option (3) you're still using another . operation -- that should be cached as well, as in Ignacio's answer.) But beware premature optimization! Every local variable imposes an additional cognitive load on you and your fellow developers -- you must be sure it's worth it. Only choose this option if you've actually done tests, and it makes a significant speed difference.
A final note: there's also some extra complexity in your example code that I am assuming is supposed to be evocative of complexity rather than specifically purposeful in this particular case. For example, given the code you've actually posted, the choose_function_given_choice function is quite useless. But I think you know that already. Still, to restate the obvious -- you should make all of this happen in the simplest way possible.

redpajama_set_name: RedPajamaStackExchange


text:
Speeches, 357 results 357
4 Dialogue Programme, 96 results 96
5.1 NMF > Mandela Day, 72 results 72
Rivonia Trial, 51 results 51
Tributes, 48 results 48
3.5.1 Memory Programme > Research > Exhibitions, 22 results 22
The Presidential Years, 21 results 21
Nelson Mandela Annual Lecture [sound/video], 20 results 20
1.12 Nelson Mandela > Birthdays, 20 results 20
1.6.2 Nelson Mandela > Receiving visitors > Elsewhere, 18 results 18
Nelson Mandela Centre of Memory, 795 results 795
University of the Witwatersrand, Historical Papers Research Archive, 17 results 17
South Afican History Archive (SAHA), 6 results 6
Liliesleaf Farm, Rivonia, 6 results 6
SABC Sound Archive, 4 results 4
National Archives and Records Service of South Africa, 3 results 3
University of South Africa (UNISA) Library, Archives and Special Collections, 3 results 3
National Library of South Africa, Pretoria, 2 results 2
Institute for Security Studies, 1 results 1
South African Democracy Education Trust, 1 results 1
Mandela, Nelson Rolihlahla, 354 results 354
Unknown, 100 results 100
Nelson Mandela Foundation (NMF), 43 results 43
Flow, 42 results 42
Various, 26 results 26
Lerole, Tumelo, 25 results 25
Trew, Tony, 21 results 21
South African Broadcasting Corporation (SABC), 21 results 21
Blue Media, 16 results 16
Godlo, Yase, 12 results 12
Machel, Graça, 87 results 87
Hatang, Sello K, 56 results 56
Dangor, Achmat, 39 results 39
African National Congress (ANC), 38 results 38
Kathrada, Ahmed Mohamed (Kathy), 33 results 33
Madikizela-Mandela, Winifred Nomzamo Zanyiwe, 33 results 33
Gerwel, Jakes, 25 results 25
Mbeki, Thabo Mvuyelwa, 24 results 24
Mandela, Zindziswa, 23 results 23
Africa, 919 results 919
South Africa, 919 results 919
Gauteng, 919 results 919
Johannesburg, 680 results 680
Pretoria, 121 results 121
Soweto, 84 results 84
Houghton, 54 results 54
Tshwane, 54 results 54
Western Cape, 22 results 22
Cape Town, 20 results 20
Address, 252 results 252
Nelson Mandela International Day, 78 results 78
Annual Lectures, 69 results 69
Dialogue Programme, 57 results 57
Awards, tributes and honours, 48 results 48
Development, 43 results 43
Nation-building, 42 results 42
Statement, 36 results 36
Transcriptions, 91 results 91
Interviews, 21 results 21
Press conferences, 6 results 6
subsubseries, 92 results 92
subx3series, 12 results 12
subx4series, 2 results 2
Karis/Gerhart Collection
ZA MR-RT-119
Part of Rivonia Trial
Includes interviews, political documents, political trial material, trade union documents and biographical files covering the political scene from 1964-1990. Many are photocopies. There is no Rivonia Trial material in the political trial material but there are biographies on the accused: Mandela (reel 91), Kathrada (reel 90), Sisulu (reel 96), Mbeki (reel 92), Wolpe (reel 98) and supplementary biographical files on Motsoaledi, Goldberg and Bernstein.
South African Police Museum and Archives Collection
The Museum contains evidence and documentation related to high profile police investigations. Rivonia Trial material is as follows:
Artefacts taken as evidence during the raid on Liliesleaf Farm:
-Three duplication machines (Roneo 750)
-Two radio transmitters
-Typewriter
Incomplete. These came to the Museum from John Vorster Square Police Station. They were then transferred back to the Police Station. When they were finally returned to the Museum, some artefacts and evidence was missing.
Archival files contain:
-One page on artefacts and their significance when transferred from John Vorster Square Police Station to the Museum in 1984.
-Labels from artefact evidence
-Pamphlets collected as evidence
-Instruction manual for duplication machine
-Press clippings from trial
-State's Concluding Address III (Afrikaans)
All 639.29-2/2A
Liliesleaf Farm Artefact Collection
Artefacts and fragments from archaeological dig conducted at Liliesleaf Farm; artefacts in exhibits in the Museum; Hinterland truck used to smuggle arms into South Africa in 1980s and documentation on it; Awaiting Trial card from 1963 and notes passed between accused and lawyers during the Trial. For example, "Jimmy Kantor, Jolly Good Work. Denis"
These artefacts do not necessarily form a collection discrete from other Liliesleaf Farm collections but have been listed as such for ease of reference. Also see entries for Harold and Annemarie Wolpe Papers, Liliesleaf Farm Audio-Visual Collection, James Kantor Papers, Liliesleaf Farm/Rivonia Trial Research Collection, Percy Yutar Papers.
National Intelligence Agency Archive
Inventory accessed contains one manuscript (bound photocopy in three parts) in Nelson Mandela's handwriting: "How to be a Good Communist; Dialectical Materialism; Political Economy". Preceding the manuscript are two pages from Mandela's Statement from the Dock (pages 45 and 46) and a photocopy of a sub-file indicating what the manuscript is about and that is was seizd at Rivonia.
There may be other records related to the Rivonia Trial in this archive
Prosecution Records
ZA NARSSA MR-RT-005
These records were donated by the Oppenheimer Family to the National Archives in 2008 from the Brenthurst Library in Johannesburg. The Oppenheimers acquired them from Dr Percy Yutar, the prosecutor in the trial.
They are not a complete record. Some witness testimony, and cross-examination are missing. See linked list for more details.
Included in the records are the indictment, opening address, statements, evidence by witnesses for the State and for the accused, evaluation of evidence of the trial, judgment and sentence, photographs, the diary Mandela kept when he left South Africa secretly at the beginning of 1962 to undergo military training and to garner support for the banned ANC. Also included is Mandela's statement from the dock. A significant component of the material is the working papers of the prosecution that were used to build up the State's case against the Rivonia Trialists. There are also photocopies and microfilm copies.
There are also prosecution records from the Yutars in the personal collection of Douw Steyn and at Liliesleaf Farm.
Yutar, Percy
Criminal Court Case No. 253/1963 (The State versus N Mandela and Others)
The records of the Supreme Court of South Africa (Transvaal Provincial Division) on the proceedings of the Rivonia Trial. Transferred to National Archives in 1994. Incomplete on transfer. Existent records are:
File cover with handwritten notes, including the sentences that were passed. The clerk of the court recorded the sentences that were passed together with the names of the accused on the cover of a file in blue ink.
Extracts of evidence by state witnesses (3 vols). These volumes include records by the attorney for the accused, Mr. B Fischer, applying for the postponement of the proceedings and the reply by Dr Yutar, the State's main prosecutor. Further records include the verbatim transcriptions of evidence given by state witnesses.
Evidence for defence (1 vol.). Include verbatim transcriptions of evidence given by Ahmed Kathrada, Raymond Mhlaba, Lionel Bernstein and Govan Mbeki.
Rivonia Exhibits (1 vol.). The exhibits include documents seized by the police at Liliesleaf and deals with topics such as the Transkei; Operation Mayibuye; the new draft programme of the South African Communist Party (SACP); names and addresses of ANC and SACP members; a copy of Sibanye, a newsletter; documents discussing problems in the democratic movement, the Nationalists invasion scare, the general predictions for 1963; handwritten notes on freedom movements elsewhere in Africa; an article by E Rosenthal on General De Wet; a syllabus on the fundamental principles of Marxism; a pamphlet named 'A Call to the Youth'; a manual on rock blasting; the rules of the SACP; sketch of Tunisia; handwritten notes on the Kenya Youth Wing Organisations; SACP newsletter on the China/India border dispute; statement by the SACP on conditions in South Africa; document on the differences in the communist movement; invoices from Ace Auto electricians; press statement by Nelson Mandela on 26 June 1961.
State's Concluding Address (4 vols). These volumes are divided into three parts. The first part deals with a factual analysis of documentary exhibits handed in, and of oral testimony given, by state witnesses. Part two deals with a factual analysis of the documentary exhibits handed in, and of the oral testimony given, by state witnesses (continued). The third part deals with the Rivonia exhibits.
Two volumes consisting of Judge's remarks in passing sentence; the Attorney General for the Transvaal's statement explaining which of the accused was found guilty of what offences; a part of the judgement and verbatim transcriptions of the court proceedings
Judgement (1 vol.).
Dictabelts covering the whole case (8 vols).
These records, together with the Prosecution Records received from Brenthurst Library, will at some stage become one group.
Department of Correctional Services Political Prisoner Files
This collection consists of files, kept by prison authorities, on all political prisoners held in prisons in South Africa. The list for these files is in three parts but only the first two relate to Rivonia Trialists.
List A reflects files of nine people, including Kathrada, Mandela, Mbeki, Mhlaba, Mlangeni of the Rivonia Trialists. These files contain correspondence.
List B has many more political prisoners' files. These files contain general correspondence re prisoners, transfers etc. The only Rivonia Trialist in List B is Denis Goldberg.
List C deals with specific issues such as medical attention and education of prisoners but does not include any of the Rivonia Trialists.
Department of Correctional Services
Twenty Five Years of Apartheid
ZA NFVSA MR-RT-106
Panorama Series. Very short clip where Winnie Mandela greets the crowds with a raised fist and the BBC reporter Robin Ray reads out the statements made at the Rivonia Trial, including that of Nelson Mandela. FA8576: Complete 16mm print on one reel; FA5093: Reel one of two; FA5094: Reel two of two. Also on VHS.
British Broadcasting Corporation (BBC)
Mandela: An Audio History
ZA SABC SA MR-RT-011
SAFM documentary in two parts for The Inner Ear Programme. Details the role played by Nelson Mandela and the ANC in the struggle for freedom in South Africa. Compiled by Joe Richardson and Sue Johnson and presented by Will Bernard. Dated 9 May 2004.
Part 1 deals with the call for armed struggle, the creation of Umkhonto we Sizwe, the arrests at Rivonia. Mandela as the first witness in the Trial, four hour statement from the dock made at the Trial, sentencing to life imprisonment, meaning of Rivonia Trial.
South African Broadcasting Corporation (SABC)
Rivonia Trial: Sentencing
SABC English Service broadcast. A short summary of the Rivonia Trial case, the verdict and the passing of sentence by Judge President Quartus De Wet. Dated 11 June 1963.
Rivonia Trial: Quartus De Wet/Bram Fischer/Dr Percy Yutar
SABC English Service broadcast. Recordings of the proceedings during the Rivonia Trial. Includes recordings of Judge President Quartus De Wet, the prosecutor Dr Percy Yutar and counsel for the defence Bram Fischer. Mandela appears as Accused number 1. Dated 3 December 1963.
The Voice of Nelson Mandela
Extracts from his famous Statement from the Dock. Produced in 2001.
The Road to Democracy in South Africa
ZA SADET MR-AAO-323
Part of Anti-Apartheid Movement Archives
'The Road to Democracy in South Africa' is a series of books published by the South African Democratic Education Trust (SADET). Volume 3 is dedicated to the International Solidarity movement and organisations. Volume 5 deals with the African Solidarity movement.
South African History Archive
ZA SAHA MR-AAO-294
SAHA is a human rights archive located at Constitution Hill, Johannesburg. The Struggles for Justice Programme, though mainly concentrating on South African organisations and people, also contains materials of international AAMs.
Julie Frederikse Collection
ZA SAHA MR-RT-067
Sound recordings and interview transcripts. Julie Frederikse worked as a journalist for National Public Radio (NPR) in the USA covered politics in South Africa. The collection includes a taped interview with Denis Goldberg and a file on him. The file contains newspaper clippings of his release in 1985; stickers re his release and release of all political prisoners; transcript of the interview (mostly on his life including rationale behind joining armed struggle) and a biography. The interview does not go into detail about the Rivonia Trial itself.
Fredrickse, Julie
Hilda and Rusty Bernstein Papers
Rusty (Lionel) Bernstein's Papers include personal correspondence to family and comrades, professional documentation relating to his career as an architect and inventor, and a large collection of writing, including drafts and material for his political biography "Memory Against Forgetting" as well as articles, essays and literature relating to prominent events in the liberation struggle (the 1946 Mine Workers Strike, The Freedom Charter and the Rivonia Trial). The collection also includes written material relating to his political career in the Communist Party and involvement with the ANC and as editor/contributor to journals like Fighting Talk and The African Communist and a lecture series given in Moscow to young militants of the ANC. Hilda Bernstein's papers include a series of journals dating from 1967 to 2001 and personal diaries written whilst in prison, and on travels throughout South Africa and Europe. A large part of the collection marks her involvement with women's rights and work for the ANC Women's League. There is also a considerable collection of art records documenting her career in London and Europe. The bulk of the collection is comprised of records relating to Hilda's extensive writings - books, articles and political literature. Of particular prominence is material collected for her most recent book "The Rift", which captures the experiences of South African exiles. There is also a large collection of correspondence both personal and professional and political brochures relating to her position as City Councillor for the Communist Party in Johannesburg from 1943 to 1946. The records kept by Hilda (viewed as 'evidence' of Hilda's activities) far outnumber those kept by Rusty. It would be misleading to presume that this is in any way a complete archive of the Bernstein's activities.
Records directly related to the Rivonia Trial are:
D1.2 Sketches, Rivonia Trial done by Hilda on scraps of paper in black pen during the trial. There are drawings of the judge, Special Branch policemen, court scenes and the back of the heads of the accused.
F2.18 Article by Hilda: "The Rivonia Trial" (1 December 1963), 4 pages of a reflection on the trial
F2.23 Article by Hilda: "The Men Who Many Die" (8 March 1964)
F2.25 Article by Hilda: "Rivonia" Landmark in SA Liberation Struggle" (24 June 1964) detailing what happened at Rivonia
F3.36 Article by Hilda: "The Trials of Nelson Mandela" (undated)
R3.1 Article in Sechaba 1989: "Rivonia: Telling it as it was"
V2.1 Transcript of Judge's remarks when passing sentence in the trial (photocopy)
V2.2 "Rivonia: The Story of Accused No. 11" by Bob Hepple. Memoirs (manuscript) with letters from Sisulu and Joffe as appendix.
Minor references to the Rivonia Trial are:
B2.1 Diary notes where Hilda refers visiting Rusty in jail, going to court and consulting with lawyers amongst other things
I11.1.2 Letter addressed to Rusty from Hilda in Pretoria Jail. Aside from address, not reference to trial or Rivonia events.
N4 Correspondence re his inventions and other business between Rusty and Hilda while he was in prison during the Rivonia Trial
Q1 Draft Novel by Rusty written in Pretoria Local Prison during the trial in 1963/4. Content not related to Trial in any way.
Bernstein, Robert L
South African History Archive Photograph Collection
Forms part of Struggles for Justice Archival Collection at SAHA. This collection was opened by Julie Frederikse whilst researching her book The Unbreakable Thread. The 1210 photographs she collected, form the bulk of this collection. SAHA photographs are incorporated into the broader Historical Papers photograph collection stored in the Ephemera room. A few individual photographs relating to the Rivonia Trial are in this collection under 21A including the front page of "The Argus" newspaper with a report on the verdict (21A.10).
South African History Archive (SAHA)
South African History Archive Poster Collection
Forms part of Struggles for Justice Archival Collection at SAHA. In the formative years, SAHA was managed by non-archivists, who applied library techniques to their collection, arrangement and description activities. Materials were catalogued by subject and/or physical medium, with very little attention paid to preserving documentation in accordance with its original context or what is referred to as 'provenance' in archival discourse. This approach saw the emergence of six collections one of which was the Poster Collection. The collection dates mainly from the 1980s and 1990s. There are duplicate copies for a substantial proportion of the items. Posters acquired by Historical Papers are also included in this collection. All items are retrievable on a database. The book Images of Defiance: South African Resistance Posters of the 1980s (Raven Press, Johannesburg, 1991)
reproduced 327 items from the collection. Slides of the latter are also available
(see AL2432). A few individual posters relating to the Rivonia Trial are: Poster 181 (SN1096) "Release Mandela Campaign Remembers Rivonia Trial" from 1985 (?) from Release Mandela Campaign and Poster 1049 (SN599) "We remember Rivonia and life-serving prisoners: Release all political prisoners" from Release Mandela Campaign, UDF, COSATU, SAYCO from 1987 (?).
Records of the United Democratic Front (UDF)
Established in 1983 to coordinate opposition to the Apartheid State's reforms, the UDF promoted links between various organisations, region and parties. The UDF Collection was created by adding together material from various sources: individuals, the UDF Information Office and UDF offices from around the country. Gaps are evident. The National Reception Committee which was created to deal with the release of the Rivonia trialists operated from the UDF offices. There is a small amount of material related to this: A1.13.4 Statements and Press Releases (1988, 1989) including on the release of Rivonia leaders (1 file, 10 items) and A1.18.8 Profiles of various people including of Rivonia leaders (1 file, 8 items).
United Democratic Front (UDF)

redpajama_set_name: RedPajamaCommonCrawl