Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/utils.py @ 1058:16575ca4537d
work in progress
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 10 Jul 2018 17:16:38 -0400 |
| parents | 4069d8545922 |
| children | a87b3072bd26 |
comparison
equal
deleted
inserted
replaced
| 1057:a7ada64b8214 | 1058:16575ca4537d |
|---|---|
| 589 return lambda x: percentile(x, 85) | 589 return lambda x: percentile(x, 85) |
| 590 else: | 590 else: |
| 591 print('Unknown aggregation method: {}'.format(funcStr)) | 591 print('Unknown aggregation method: {}'.format(funcStr)) |
| 592 return None | 592 return None |
| 593 | 593 |
| 594 def aggregationMethods(methods, centiles = None): | |
| 595 aggFunctions = {} | |
| 596 headers = [] | |
| 597 for method in methods: | |
| 598 if method == 'centile': | |
| 599 aggFunctions[method] = aggregationFunction(method, centiles) | |
| 600 for c in centiles: | |
| 601 headers.append('{}{}'.format(method,c)) | |
| 602 else: | |
| 603 aggFunctions[method] = utils.aggregationFunction(method) | |
| 604 headers.append(method) | |
| 605 return aggFunctions, headers | |
| 606 | |
| 594 ######################### | 607 ######################### |
| 595 # regression analysis using statsmodels (and pandas) | 608 # regression analysis using statsmodels (and pandas) |
| 596 ######################### | 609 ######################### |
| 597 | 610 |
| 598 # TODO make class for experiments? | 611 # TODO make class for experiments? |
