table description of the variables in the nutritional study [ feature gender situation tea coffee height weight age meat fish raw_fruit cooked_fruit_veg chocol fat unit or coding =male =female =single =living with spouse family status =living with family =living with someone else daily consumption of tea number of cups daily consumption of coffee number of cups height cm weight (actuallymasskg age at date of interview years =never =less than once week =once week consumption of meat = - times week = - times week =every day consumption of fish as in meat consumption of raw fruits as in meat consumption of cooked as in meat fruits and vegetables consumption of chocolate as in meat =butter =margarine =peanut oil type of fat used =sunflower oil for cooking =olive oil =mix of vegetable oils ( isio =colza oil =duck or goose fat description gender contrast to qualitative features without orderwhich are called nominal we will not make such distinction in this book we can modify the python value and type for each categorical featureusing the replace and astype methods for categorical featuressuch as genderwe can replace the value with 'maleand with 'female'and change the type to 'categoryas follows dict { 'male ' :'female 'dictionary specifies replacement nutri ['gender 'nutri ['gender 'replace (dictastype ('category 'the structure of the other categorical-type features can be changed in similar way continuous features such as height should have type floatnutri ['height 'nutri ['height 'astype float