In econometrics and statistics, top-coding and bottom-coding refer to the act of censoring data points, the values of which are above or below a certain number or threshold, respectively. In essence, top and bottom coding is what we have covered in the previous recipe, where we capped the minimum or maximum values of variables at a certain value, which we determined with the mean and standard deviation, the inter-quartile range proximity rule, or the percentiles. Zero-coding is a variant of bottom-coding and refers to the process of capping, usually the lower value of the variable, at zero. It is commonly used for variables that cannot take negative values, such as age or income. In this recipe, we will learn how to implement zero-coding in a toy dataframe using pandas and Feature-engine.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia