Using .round() in Manipulating Columns needs to be explained. If we don’t use it, we will not get to a full integer and then calling int() will truncate. Compare ((unemployment['year_month'] - unemployment['year']) * 100).astype(int) and ((unemployment['year_month'] - unemployment['year']) * 100).round(0).astype(int) - the first starts at 0, second starts at 1
Using
.round()in Manipulating Columns needs to be explained. If we don’t use it, we will not get to a full integer and then callingint()will truncate. Compare((unemployment['year_month'] - unemployment['year']) * 100).astype(int)and((unemployment['year_month'] - unemployment['year']) * 100).round(0).astype(int)- the first starts at 0, second starts at 1