diff --git a/README.md b/README.md index 49d39cb..bfbd9ca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ -# histoviewer -Dynamic histograms for pandas DataFrames +## Introduction +Histoviewer is an interactive bokeh application for dynamically viewing histograms and bar charts for a pandas DataFrame input. + +Try out the application here (it may take up to a minute to start the heroku app): +https://histoviewer.herokuapp.com/sample_app + +Play around with the sliders, text inputs, dropdowns, and button widgets to update the data dynamically! + +## Features +Histoviewer uses bokeh widgets to interact with the displayed plots. The column selection dropdown changes the data source to **df[column]**. + +- Continuous variables + - dynamically rebin histogram from 10-100 bins + - dynamically rescale minimum/maximum bounds of histogram +- Categorical variables + - resort by y-axis (descending) or x-axis (alphabetical) + - reindex x-axis to filter categories + +## Getting Started +To use Histoviewer, simply install the required dependencies: +``` +pip install -r requirements.txt +``` + +Then run the following code (in Jupyter notebook) to interact with a pandas DataFrame: +``` +from histoviewer import histoviewer +histoviewer(df) +``` + +For an example of how to run histoviewer from a python 2.7 script, see [sample_app.py](https://github.com/alvinthai/histoviewer/blob/master/sample_app.py). diff --git a/histoviewer.py b/histoviewer.py index ea2ab7f..d9cf76e 100644 --- a/histoviewer.py +++ b/histoviewer.py @@ -20,11 +20,11 @@ def histoviewer(df, default_col=None, serve='notebook'): pandas DataFrame input. Histograms (continuous variables) have interactive inputs for: - - rebinning from 10-100 Bins - - rescaling minimum and maximum bounds of axis + - rebinning histogram from 10-100 bins + - rescaling minimum/maximum bounds of histogram Bar Charts (categorical variables) have interactive inputs for: - - sorting by y-axis (descending) or x-axis (ascending) - - reindexing x-axis for hiding categories + - resorting by y-axis (descending) or x-axis (alphabetical) + - reindexing x-axis to filter categories Default serve mode assumes jupyter notebook. Histoviewer application could also be served from a python script via: diff --git a/requirements.txt b/requirements.txt index 1a9d513..7d1dd50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ bokeh==0.12.14 -numpy==1.14.1 -pandas==0.22.0 +numpy>=1.14.1 +pandas>=0.22.0