adding CityCountsByBatchcodeTablesMerger

This commit is contained in:
frankknoll
2023-10-04 11:34:20 +02:00
parent 3f1f9ac19f
commit 5cd36b8e1e
5 changed files with 140 additions and 11 deletions

View File

@@ -1,13 +1,13 @@
import pandas as pd
from GoogleAnalytics.RegionCountsByClickedBatchcodeProvider import RegionCountsByClickedBatchcodeProvider
from GoogleAnalytics.FilesProvider import FilesProvider
from GoogleAnalytics.Resolution import Resolution
from TablesHelper import TablesHelper
class RegionCountsByBatchcodeTablesMerger:
@staticmethod
def getRegionCountsByClickedBatchcode(dataDir):
files = FilesProvider(dataDir).getFilesHavingResolution(Resolution.CITY)
tables = [RegionCountsByClickedBatchcodeProvider.getRegionCountsByClickedBatchcode(file) for file in files]
table = TablesHelper.concatTables_groupByIndex_sum(tables)
return table
cityCountsByClickedBatchcodeTables = [RegionCountsByClickedBatchcodeProvider._getCityCountsByClickedBatchcode(file) for file in files]
table = pd.concat(cityCountsByClickedBatchcodeTables)
return RegionCountsByClickedBatchcodeProvider._getRegionCountsByClickedBatchcodeFromTable(table)