Files
HowBadIsMyBatch/src/GoogleAnalytics/RegionCountsByBatchcodeTablesMerger.py
2023-10-04 11:34:20 +02:00

14 lines
738 B
Python

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