Posts tagged with 'python' - 2

I wrote up a little on exporting DataFrames to markdown and html here But I've been playing with a web app for with lists and while I'm toying around I learned you can actually give your tables some style with some simple css classes! To HTML Remind ... read more →

Pandas pandas.DataFrames are pretty sweet data structures in Python. I do a lot of work with tabular data and one thing I have incorporated into some of that work is automatic data summary reports by throwing the first few, or several relevant, rows ... read more →

Amazon has crossed the line with me just one too many times now so we are looking to drop them like every other Big Tech provider.... However, one key feature of Amazon that has been so useful for us is Lists... We can just maintain a list for each ... read more →

TL;DR pandas.Series.str.contains accepts regular expressions and this is turned on by default! Use case We often need to filter pandas DataFrames based on several string values in a Series. Notice that sweet pyflyby import 😁! sandbox  main via 3 ... read more →

Unpacking iterables in python with * is a pretty handy trick for writing code that is just a tiny bit more pythonic than not. arr: Tuple[Union[int, str]] = (1, 2, 3, 'a', 'b', 'c') print(arr) >>> (1, 2, 3, 'a', 'b', 'c') # the * unpacks ... read more →

pipx is a tool I've been using to solve a few problems of mine... pinning formatting tools like black, flake8, isort, etc. to the same version for all my projects keeping virtual environments clean of things like cookiecutter python utilities I wan ... read more →

Type hinting has helped me write code almost as much, if not more, than unit testing. One thing I love is that with complete type hinting you get a lot more out of your LSP. Typing dictionaries can be tricky and I recently learned about TypedDict to ... read more →

I often struggle to remember the correct way to do and type comparisons when working in pandas. I remember learning long long ago that and and & are different, the former being lazy boolean evaluation whereas the latter is a bitwise operation. I ... read more →