Waterfall Charts in Python - starter code

I’m not sure I understand. The function itself is callable through waterfall() already. Did you mean the package name?

According to the readme, it’s called quick_charts()

I see what you mean. Would you prefer:

from waterfallcharts import waterfall as wf
plot = wf.waterfall_matplot(a,b)

The package name is waterfallcharts, which contains the quick_charts.py source file, itself containing the definition of a waterfall plotting function waterfall(). Did I overcomplicate this naming convention?

I would say so :wink:

Best, I think, to move waterfall.py into the root of your tree, and call it waterfall_chart, then name the function plot, so you can simply:

import waterfall_chart
waterfall_chart.plot(...)

How would that be?

1 Like

I now understand how this could have been made simpler. Many thanks for the recommendation!

The function is now callable through

import waterfall_chart
waterfall_chart.plot(...)

As you suggested.

2 Likes

Hey guys, is there a way to increase the size of the waterfall chart? I am calling

from waterfall_chart import plot as waterfall
waterfall(
    index=subset_xs.columns, 
    data=choice_contributions, 
    rotation_value=90,
    threshold=choice_contributions.mean(),
    sorted_value=True,
    net_label='Total',
    formatting='{:,.3f}',
    Title='Instance {}, FP in target={} predicted as {}, (Pr={:.2f})'.format(miss, target, confusion_arr[miss], choice_contributions.sum())
);