Is there anyway in ArcGIS to convert the first table into the second one? I thought about it a lot but couldn't get the idea how to do even using python (I'm a python beginner).
Try looking into Pivot Tables
more recent versions of the pivot table help (ie for 10.4 and 10.3) can be found here
Pivot Table—Help | ArcGIS for Desktop and for
ArcGIS Pro Pivot Table—Data Management toolbox | ArcGIS for Desktop
Oh yes! Pivot table is what I wanted. Thanks Michael and Dan
Retrieving data ...