Git Product home page Git Product logo

waterfall's Introduction

waterfallcharts

A simple graphing tool that attempts to generate a standard waterfall chart in generic Python.

The idea was first brought to my attention by Jeremy Howard, who remarked that no such easy to use package existed. The underlying method borrows from Chris Moffitt's stacked bar charts approach, and improves upon data range reliability, appearance, and chart options.

The primary aim of the package is to provide a quick and reliable way to generate waterfall charts on a whim, for both accounting and random forest interpretation purposes.

Functionality

There is currently one function:

  • quick_charts(): Given two sequences ordered appropriately, of contribution amounts and labels, generate a standard waterfall chart

There are three features:

  • sorted_value: Sorts contributions by absolute value in the chart

  • threshold: Groups all contributions under a certain threshold value into an 'other' group

  • formatting: Formats Y axis labels and bar chart labels to the specified input

Additionally, there are several arguments that control for chart title, axis names, bar colors, custom bar labels for 'other' and 'net', and x label rotation angles

Check out the examples.

Installation

Simply install the Python waterfallcharts package:

$ pip install waterfallcharts

or upgrade to the latest version:

$ pip install -U waterfallcharts

Usage

As detailed in the example and source code, the function assumes two list inputs, one of the contribution NAMES and the other of the contribution AMOUNTS. Please note that the NET SUM of all contributions is not an input to the function, and is calculated for you.

import waterfall_chart
a = ['sales','returns','credit fees','rebates','late charges','shipping']
b = [10,-30,-7.5,-25,95,-7]
my_plot = waterfall_chart.plot(a, b)

Implementation notes

Deploy

$ python setup.py sdist upload

waterfall's People

Contributors

chrispaulca avatar parrt avatar

Stargazers

Marc G avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.