@@ -274,8 +274,9 @@ def format_adaptation_summary_detail(data):
274274 summary = format_adaptation_summary (data [0 ])
275275 detail = format_adaptation_detail (data [1 ])
276276
277- return pd .merge (summary , detail , left_on = ['adaptation' , 'valid_id' ], right_on = ['adaptationId' , 'valid_id' ],
278- how = 'left' ).drop ('adaptationId' , axis = 1 ).rename (columns = {"error_x" : "error" }).drop ('error_y' , axis = 1 )
277+ return pd .merge (summary , detail , left_on = ['adaptation' , 'valid_id' ],
278+ right_on = ['adaptationId' , 'valid_id' ], how = 'left' ).drop ('adaptationId' , axis = 1 )\
279+ .rename (columns = {"error_x" : "error" }).drop ('error_y' , axis = 1 )
279280
280281
281282def format_probability_chance (data ):
@@ -1160,15 +1161,16 @@ def format_aal_summary_property(data):
11601161 df ['mid' ] = pd .NA
11611162 df ['high' ] = pd .NA
11621163
1164+ df .rename (columns = {'data' : 'damage' }, inplace = True )
11631165 df ['fsid' ] = df ['fsid' ].apply (str )
11641166 df ['year' ] = df ['year' ].astype ('Int64' ).apply (str )
11651167 df ['low' ] = df ['low' ].astype ('Int64' ).apply (str )
11661168 df ['mid' ] = df ['mid' ].astype ('Int64' ).apply (str )
11671169 df ['high' ] = df ['high' ].astype ('Int64' ).apply (str )
11681170 df ['depth' ] = df ['depth' ].astype ('Int64' ).apply (str )
1169- df ['data ' ] = df ['data ' ].astype ('Int64' ).apply (str )
1171+ df ['damage ' ] = df ['damage ' ].astype ('Int64' ).apply (str )
11701172
1171- return df [['fsid' , 'valid_id' , 'depth' , 'data ' , 'year' , 'low' , 'mid' , 'high' , 'error' ]]
1173+ return df [['fsid' , 'valid_id' , 'depth' , 'damage ' , 'year' , 'low' , 'mid' , 'high' , 'error' ]]
11721174
11731175
11741176def format_aal_summary (data ):
@@ -1199,10 +1201,11 @@ def format_aal_summary(data):
11991201 df ['count_mid' ] = pd .NA
12001202 df ['count_high' ] = pd .NA
12011203
1202- df = df .sort_values (by = ['fsid' , 'floodFactor' , 'year' ])
1204+ df .rename (columns = {'floodFactor' : 'floodFactor_gr2' }, inplace = True )
1205+ df = df .sort_values (by = ['fsid' , 'floodFactor_gr2' , 'year' ])
12031206 df ['fsid' ] = df ['fsid' ].apply (str )
12041207 df ['year' ] = df ['year' ].astype ('Int64' ).apply (str )
1205- df ['floodFactor ' ] = df ['floodFactor ' ].astype ('Int64' ).apply (str )
1208+ df ['floodFactor_gr2 ' ] = df ['floodFactor_gr2 ' ].astype ('Int64' ).apply (str )
12061209 df ['total_loss_low' ] = df ['total_loss_low' ].astype ('Int64' ).apply (str )
12071210 df ['total_loss_mid' ] = df ['total_loss_mid' ].astype ('Int64' ).apply (str )
12081211 df ['total_loss_high' ] = df ['total_loss_high' ].astype ('Int64' ).apply (str )
@@ -1211,7 +1214,7 @@ def format_aal_summary(data):
12111214 df ['count_high' ] = df ['count_high' ].astype ('Int64' ).apply (str )
12121215
12131216 return df [['fsid' , 'valid_id' , 'year' , 'total_loss_low' , 'total_loss_mid' , 'total_loss_high' , 'count_low' ,
1214- 'count_mid' , 'count_high' , 'floodFactor ' , 'error' ]]
1217+ 'count_mid' , 'count_high' , 'floodFactor_gr2 ' , 'error' ]]
12151218
12161219
12171220def format_avm (data ):
0 commit comments