# Part 2.(Regional Outlook) Create a table that shows the Regions and their percent forest area in 1990 and 2016.
# فلترة الجدول على عام 1990 وعام 2016
forestation_1990_2016 = forestation[forestation['year'].isin([1990, 2016])]
# تجميع البيانات حسب المنطقة والسنة
forestation_1990_2016 = forestation_1990_2016.groupby(['region', 'year'], as_index=False).agg(
total_land_area=('total_area_sqkm', 'sum'),
total_forest_area=('forest_area_sqkm', 'sum'))
# حساب نسبة الغابات
forestation_1990_2016['percent_forest_area'] = round((forestation_1990_2016['total_forest_area'] / forestation_1990_2016['total_land_area']) * 100,2)
# جدول يحتوي على region - year - percent forest area
r_insights=forestation_1990_2016[['region','year','percent_forest_area']]
print(r_insights)