Implement function merge_or_sum()
The function merge_or_sum() is a static helper function to work with pandas series and reduce them by either selecting the first non-null value for non numerical values, or summing the values for numerical types.
The need for this function is because the European Building Stock Obsertvatory (EUBSO) dataset has a large amount of attributes that are not so relevant for our use case, and these might lead to differentiation between features, that if the attributes are ignored, the features could be merged and made into one. For example, a set of four features might all be of:
- Austria
- 1990 - 2000
- Residential
- Apartment Buildings
- Represent the number of buildings data point
But differ in attributes irrelevant for us such as:
- Occupancy (primary or secondary residence)
- Building user (owner or tenants)
- social housing (True or False)
and many more.
This function aims to ignore irrelevant attributes and merge the features that match in the relevant ones by filling in Null values for features that miss an object type column, and sum the values in columns that are numeric.