HHammond / PrettyPandas

A Pandas Styler class for making beautiful tables
http://prettypandas.readthedocs.org/
MIT License
415 stars 23 forks source link

various changes (aggregates, nans)... #31

Closed hottwaj closed 4 years ago

hottwaj commented 8 years ago

Various changes - happy to split these, remove anything you don't like, add docs etc. Let me know what you'd like to keep and what to improve.

Changes are:

aggregates (total, average etc) can now be applied to a subset or exclude a given column

NAN values can be replaced with a given string for all columns, or for selected calls to as_percent, as_unit etc

I re-instated the as_percent method that allows for different precision, rather than using babel (this is really a personal requirement - happy to remove)

also added a bit of a hack to allow the index to be hidden if required (this could be improved!)

changed .average() call to use numpy.average, which can be optionally passed weights to allow for weighted averages to be calculated if required

Cheers!

hottwaj commented 8 years ago

I've made those changes. Some documentation is needed for NaN removal, formatter subsetting and percent formatting options, and some tests are needed too... I'm afraid I probably can't commit much time to doing those for now but if there's anything you'd like me to check out let me know.

Cheers!

HHammond commented 4 years ago

Oh wow, this looks like a lot of great work! I plan on reviewing this on Saturday or Sunday, is there anything you think needs extra attention?

hottwaj commented 4 years ago

Ah thanks! I forgot I had an open PR on this - didn't mean to flood you with changes :)

I've been using this library a lot since 2016 and made a few tweaks to suit my needs over time as you can see!

Please feel free to ignore/delete anything you don't like the look of.

I could also help split out the bits you think are worth keeping into a new PR rather than dealing with this mess of commits?

Cheers!

hottwaj commented 4 years ago

Hey this PR turned into a big mess (my fault) and is quite out of sync with master. I think better to close for now and I will try to rebase my changes bit by bit to master when I have time.

Are you still using/developing this library?

Thanks!