generating histograms for countries more efficient

This commit is contained in:
frankknoll
2023-02-16 14:59:43 +01:00
parent ef7c36d567
commit 0ffc5881b6
8 changed files with 139 additions and 136 deletions

View File

@@ -7,6 +7,6 @@ class MultiIndexExploder:
@staticmethod
def explodeMultiIndexOfTable(table):
batchcodeColumns = table.index.names
explodedTable = table.loc[np.repeat(table.index, len(batchcodeColumns))].reset_index()
explodedTable = table.iloc[np.repeat(range(len(table.index)), len(batchcodeColumns))].reset_index()
explodedTable['VAX_LOT_EXPLODED'] = Utils.flatten(table.index.values)
return explodedTable.set_index(['VAX_LOT_EXPLODED'] + batchcodeColumns)