Grouping data to be displayed in the a template.
An approach I have used at the moment is to use a preprocess hook in my template. Added the following preprocess template to a custom module 

THEMENAME_preprocess_views_view_unformatted__PAGENAME(&amp;$variables)

where variable is an array containing 
- view : the view object
- rows : an array of row items and each row is an array of content. 

I looped over the data and constructed my required object, which then I set as a new property resource  (i.e. $variables['resource']) of variables. 

Within the template (views-view-unformatted--PAGENAME.html.twig), I then have access to the resource variable to use in the twig template. e.g {{ resource.type }} , where type is a property added to the resource variable in the preprocess hook. 

Not sure if this is the best way to approach the problem, but at least it is one way of approaching the problem.