Skip to content

Commit

Permalink
Tagging 0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1610 committed Jun 22, 2020
1 parent d2953b6 commit ff8253a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# History

# 0.4.0 (Development)
# 0.4.0 (2020-06-21)
- Adding a subtotal function
- Allow sorting by column values in freq table
- Add flag to drop cumulative count and frequency if they are not needed

# 0.3.0 (2020-05-31)
- First public release
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can also summarize missing values with `df.stb.missing()`:
You can group the data and add subtotals and grand totals with `stb.subtotal()`:

```python
titanic.groupby(['sex', 'class']).agg({'fare': ['sum']}).stb.subtotal()
df.groupby(['sex', 'class']).agg({'fare': ['sum']}).stb.subtotal()
```

<table border="1" class="dataframe">
Expand Down Expand Up @@ -118,7 +118,7 @@ sidetable has several useful features:
* Provide a threshold point above which all data is grouped into a single bucket. This is useful for
quickly identifying the areas to focus your analysis.
* Get a count of the missing values in your data.
* Add grand totals on any DataFrame and Subtotals to any grouped DataFrame
* Add grand totals on any DataFrame and subtotals to any grouped DataFrame

## Table of Contents:

Expand Down Expand Up @@ -150,6 +150,9 @@ df.stb.freq(['column1', 'column2'])

# See what data is missing
df.stb.missing()

# Group data and add a subtotal
df.groupby(['column1', 'column2'])['col3'].sum().stb.subtotal()
```
That's it.

Expand Down Expand Up @@ -366,9 +369,9 @@ df.stb.missing(style=True)
| alive | 0 | 891 | 0 |
| alone | 0 | 891 | 0 |

Another really useful function is the subtotal function. Trying to add a subtotal
Another useful function is the subtotal function. Trying to add a subtotal
to grouped pandas data is not easy. sidetable adds a `subtotal()` function that
makes it very easy to add a subtotal at one or more levels of a DataFrame.
makes adds a subtotal at one or more levels of a DataFrame.

The subtotal function can be applied to a simple DataFrame in order to add a Grand Total
label:
Expand Down Expand Up @@ -496,7 +499,8 @@ summary_table.stb.subtotal(sub_level=[1, 2])
```

The `subtotal` function also allows the user to configure the labels and separators used in
the subtotal and Grand Total.
the subtotal and Grand Total by using the `grand_label`, `sub_label`, `show_sep` and `sep`
arguments.

## Caveats
sidetable supports grouping on any data type in a pandas DataFrame. This means that
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
author="Chris Moffitt",
author_email='[email protected]',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
Expand All @@ -55,6 +55,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/chris1610/sidetable',
version='0.4.dev',
version='0.4.0',
zip_safe=False,
)
2 changes: 1 addition & 1 deletion sidetable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Chris Moffitt"""
__email__ = '[email protected]'
__version__ = '0.4.dev'
__version__ = '0.4.0'

from .sidetable import SideTableAccessor

Expand Down

0 comments on commit ff8253a

Please sign in to comment.