Ok, we're all tired of the neverending count, so here's something completely different:

10 less well-known code packages; the fun, the useful, and the unexpected.

🧵below.

#EconTwitter #DataScience #RStats #Python #PyData
1. Jazzit. “Ever wanted your scripts to play music while running/ on erroring out? Of course you didn’t. But here it is anyway”

Yes, Jazzit laughs at your expense when your code hits an error, here via a clip from curb your enthusiasm. github.com/Sangarshanan/j…

(see also: beepy)
2. Handcalcs

Handcalcs renders maths in latex in your console/notebook and can also export latex equations to file. *Really* useful for writing papers where you want your code and the mathematics in your paper to be consistent.

github.com/connorferster/…

(see also: sympy)
3. Pandas profiling

Exploratory data analysis is important, often a bit overlooked, and also saves time in the long-run. So a library creating beautiful HTML EDA reports (missing variables, cardinality, distributions, & correlations) is super useful.

github.com/pandas-profili…
4. Matplotlib!?

Alright, you’ve probably heard of @matplotlib & might be surprised to see it on the list. But there’s a new feature of matplotlib that you might not be aware of: figure placement using ASCII & lists. Can be useful for plots in papers.

matplotlib.org
5. Pandera data validation

You don't want nasty surprises with the data you're reading in (think floats as strings), & this package validates data types, & more, as it arrives. Fantastically useful.

pandera.readthedocs.io/en/stable/

See also: Great Expectations, greatexpectations.io
6. Tenacity

If at first you don’t succeed, try and try again. Tenacity has several different ways to keep trying a function, even if execution fails.

tenacity.readthedocs.io/en/latest/

See also: purrr’s 'insistently'
7. Streamlit

streamlit sells itself as the fastest way to build data apps (dashboards). You can do an impressive amount with a very simple set of commands. But there’s also depth--it can, for example, serve up 'explainable' AI models.

streamlit.io

Also: RShiny, Dash
8. Black

Black is an automatic code formatter (“you can have it any colour you want, as long as it’s black”). If you just want to write code & forget about formatting, it's brilliant-though some won't like its opinionated style.

black.readthedocs.io/en/stable/

Also: Google's yapf
9. Scalene for profiling

Profiling finds bottlenecks in your code-but with scalene, you can find bottlenecks in your data too. Yes, it does memory profiling! Super useful for economics & data science, where *memory* is often limiting.

github.com/emeryberger/sc…

Also: PyInstrument
10. alive-progress for progress bars

Waiting for code to run doesn't *need* to be tedious. alive-progress gives a wealth of options for glitzing your progress bar. Better still is the realistic ETA (I'm looking at you, Windows File Transfer)

github.com/rsalmei/alive-…

Also: tdqm
Bonus: R style analysis in Python!?

R users swear by two of R’s most loved declarative-style packages, dplyr for data analysis & ggplot2 for plotting, & miss them when working in Python. Here are two great stand-ins:

plotnine, a port of ggplot2:
plotnine.readthedocs.io/en/stable/inde…
...and here's Siuba, a Python port of dplyr in R. (Yes, it has slightly awkward syntax for now, but it's new & great for R users wanting to get going quickly in Python.)

github.com/machow/siuba
Well I hope you've enjoyed this non-election related content. You can find all of the packages, the 'see also' packages, and more, in this blog post:

aeturrell.com//2020/10/24/10…
I see the gifs inexplicably didn't work on this one! You'll have to go onto the homepage.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Dr Arthur Turrell

Dr Arthur Turrell Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!