Skip to content

Commit

Permalink
change type to concept_type
Browse files Browse the repository at this point in the history
  • Loading branch information
semio committed Mar 2, 2016
1 parent dca05b7 commit e6323f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion output/ddf--concepts--continuous.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
concept,type,series_code,topic,indicator_name,short_definition,long_definition,unit_of_measure,periodicity,base_period,other_notes,aggregation_method,limitations_and_exceptions,notes_from_original_source,general_comments,source,statistical_concept_and_methodology,development_relevance,related_source_links,other_web_links,related_indicators,license_type
concept,concept_type,series_code,topic,indicator_name,short_definition,long_definition,unit_of_measure,periodicity,base_period,other_notes,aggregation_method,limitations_and_exceptions,notes_from_original_source,general_comments,source,statistical_concept_and_methodology,development_relevance,related_source_links,other_web_links,related_indicators,license_type
ag_agr_trac_no,measure,AG.AGR.TRAC.NO,Environment: Agricultural production,"Agricultural machinery, tractors",,Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year.,,Annual,,,Sum,"The data are collected by the Food and Agriculture Organization of the United Nations (FAO) through annual questionnaires. The FAO tries to impose standard definitions and reporting methods, but complete consistency across countries and over time is not possible. The data collected from official national sources through the questionnaire are supplemented with information from official secondary data sources. The secondary sources cover official country data from websites of national ministries, national publications and related country data reported by various international organizations.",,,"Food and Agriculture Organization, electronic files and web site.","A tractor provides the power and traction to mechanize agricultural tasks, especially tillage. Agricultural implements may be towed behind or mounted on the tractor, and the tractor may also provide a source of power if the implement is mechanized. The most common use of the term ""tractor"" is for the vehicles used on farms. The farm tractor is used for pulling or pushing agricultural machinery or trailers, for plowing, tilling, disking, harrowing, planting, and similar tasks. Planting, tending and harvesting a crop requires both a significant amount of power and a suitable range of tools and equipment. Mechanization of farming has allowed an increase to the area that can be planted and has contributed towards increased yields, mainly due to the precision with which the farming tasks can be accomplished.","Agricultural land covers more than one-third of the world's land area. In many industrialized countries, agricultural land is subject to zoning regulations. In the context of zoning, agricultural land (or more properly agriculturally zoned land) refers to plots that may be used for agricultural activities, regardless of the physical type or quality of land.

A substantial contribution to agriculture in the last century has been the escalation from manual and stock-animal farm work to gas-powered farm equipment. Globally, steel plows, mowers, mechanical reapers, seed drills, and threshers contributed to the development of mechanized agriculture, tractors enabled the farmer to sow and harvest large agricultural lands with less manpower. In modern times, powered machinery such as tractors, has replaced many jobs formerly carried out by men or animals such as oxen, horses and mules. FAO estimates that most farmers in developing countries experience a greater annual expenditure on farm power inputs than on fertilizer, seeds or agrochemicals.
Expand Down
2 changes: 1 addition & 1 deletion output/ddf--concepts--discrete.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
concept,name,type
concept,name,concept_type
country_code,Country Code,string
short_name,Short Name,string
table_name,Table Name,string
Expand Down
6 changes: 3 additions & 3 deletions script/wdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def to_concept_id(s):
def extract_concept_discrete(country, series):
"""extract all discrete concepts, base on country and series data."""
# headers for dataframe and csv file
header_discrete = ['concept', 'name', 'type']
header_discrete = ['concept', 'name', 'concept_type']

# create the dataframe
concepts_discrete = pd.DataFrame([], columns=header_discrete)
Expand All @@ -38,7 +38,7 @@ def extract_concept_discrete(country, series):

# assign all concepts' type to string, then change the non string concepts
# to their correct type.
concepts_discrete['type'] = 'string'
concepts_discrete['concept_type'] = 'string'

# adding 'year' and 'country' concept
concepts_discrete = concepts_discrete.append(
Expand All @@ -58,7 +58,7 @@ def extract_concept_continuous(country, series):

# adding some columns for DDF model
concepts_continuous['concept'] = series['Series Code'].apply(to_concept_id)
concepts_continuous['type'] = 'measure'
concepts_continuous['concept_type'] = 'measure'

# rename the columns into lower case alphanumeric and rearrange them
idxs = np.r_[concepts_continuous.columns[-2:], concepts_continuous.columns[:-2]]
Expand Down

0 comments on commit e6323f6

Please sign in to comment.