diff --git a/README.md b/README.md index 3482565..6bc6a95 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,23 @@ python -m pip install git+https://github.com/Der-Henning/TopK-Insights ## Example ````Python -import pandas as pd +import logging + import matplotlib.pyplot as plt +import pandas as pd from tki import TKI -from tki.insights import OutstandingFirstInsight, OutstandingLastInsight, \ - TrendInsight, EvennessInsight, CorrelationInsight -from tki.extractors import RankExtractor, DeltaPrevExtractor, \ - DeltaMeanExtractor, ProportionExtractor from tki.aggregators import SumAggregator -from tki.dimensions import CardinalDimension, TemporalDimension, NominalDimension +from tki.dimensions import (CardinalDimension, NominalDimension, + TemporalDimension) +from tki.extractors import (DeltaMeanExtractor, DeltaPrevExtractor, + ProportionExtractor, RankExtractor) +from tki.insights import (CorrelationInsight, EvennessInsight, + OutstandingFirstInsight, OutstandingLastInsight, + TrendInsight) + +logging.basicConfig() +logging.getLogger('tki').setLevel(logging.INFO) data = [ ['H', 2010, 40], ['T', 2010, 38], ['F', 2010, 13], ['B', 2010, 20], @@ -38,7 +45,6 @@ data = [ ['H', 2013, 43], ['T', 2013, 29], ['F', 2013, 23], ['B', 2013, 17], ['H', 2014, 58], ['T', 2014, 36], ['F', 2014, 27], ['B', 2014, 19] ] - extractors = { RankExtractor, DeltaPrevExtractor, @@ -70,7 +76,7 @@ tki.run() fig, axes = plt.subplots(7, 3, figsize=(25, 40), dpi=80) for idx, i in enumerate(tki.heap.insights): - plt.axes(axes[int(idx/3)][idx % 3]) + plt.axes(axes[int(idx / 3)][idx % 3]) i.plot() plt.title( f"{idx + 1}) {type(i.insight).__name__} "