Hacker News Viewer

What Category Theory Teaches Us About DataFrames

by mchav on 3/29/2026, 8:44:25 AM

https://mchav.github.io/what-category-theory-teaches-us-about-dataframes/

Comments

by: rich_sasha

The article starts well, on trying to condense pandas&#x27; gaziliion of inconsistent and continuously-deprecated functions with tens of keyword arguments into a small, condensed set of composable operations - but it lost me then.<p>The more interesting nugget for me is about this project they mention: <a href="https:&#x2F;&#x2F;modin.readthedocs.io&#x2F;en&#x2F;latest&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;modin.readthedocs.io&#x2F;en&#x2F;latest&#x2F;index.html</a> called Modin, which apparently went to the effort of analysing common pandas uses and compressed the API into a mere handful of operations. Which sounds great!<p>Sadly for me the purpose seems to have been rather to then recreate the full pandas API, only running much faster, backed by things like Ray and Dask. So it&#x27;s the same API, just much faster.<p>To me it&#x27;s a shame. Pandas is clearly quite ergonomic for various exploratory interactive analyses, but the API is, imo, awful. The speed is usually not a concern for me - slow operations often seem to be avoidable, and my data tends to fit in (a lot of) RAM.<p>I can&#x27;t see that their more condensed API is public facing and usable.

4/3/2026, 10:59:14 AM


by: few

I felt like one or two decades ago, all the rage was about rewriting programs into just two primitives: map and reduce.<p>For example filter can be expressed as:<p><pre><code> is_even = lambda x: x % 2 == 0 mapped = map(lambda x: [x] if is_even(x) else [], data) filtered = reduce(lambda x, y: x + y, mapped, []) </code></pre> But then the world moved on from it because it was too rigid

4/3/2026, 11:11:34 AM


by: jiehong

Dups of a few days ago:<p>- <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47567087">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47567087</a>

4/3/2026, 11:40:20 AM