[HN Gopher] Data Manipulation in Clojure Compared to R and Python
___________________________________________________________________
Data Manipulation in Clojure Compared to R and Python
Author : tosh
Score : 78 points
Date : 2026-03-22 09:55 UTC (2 days ago)
(HTM) web link (codewithkira.com)
(TXT) w3m dump (codewithkira.com)
| soumyaskartha wrote:
| Clojure never got the data science crowd even though the language
| is genuinely good for it. Always felt like a distribution problem
| more than a technical one.
| asa400 wrote:
| Unfortunately, having to mess around with a JVM is a tough sell
| for a lot of data analysis folks. I'm not saying it's rational
| or right, but a lot of people hear "JVM" and they go "no thank
| you". Personally I think it's a non-issue, but you have to meet
| people where they are.
| famicom0 wrote:
| Meanwhile, I find it very annoying to deal with the litany of
| Python versions and the distinction between global packages
| and user packages, and needing to manage virtual environments
| just to run scripts. That being said, I am not an expert but
| that's always been my experience when I need to do anything
| Python related.
| pjmlp wrote:
| The irony given the mess of Python setup where there are
| companies whose business is to solve Python tooling.
| cmiles74 wrote:
| I dunno, if you can slog through the Python ecosystem then
| the JVM is starting to look not so bad. Plus with Clojure you
| don't need to deal with the headache and heartache that is
| Maven.
| packetlost wrote:
| idk, I don't think I've had to do anything beyond _install_
| the JVM to work with Clojure. I 'm not really a fan of the
| clj commands flag choices though (-M, -X, etc. all make no
| sense)
| levocardia wrote:
| In this very post you can see why: the dplyr code is just so
| much more readable. Like a lot of python, dplyr reads almost
| like pseudocode: take this dataset, select the columns that
| start with "bill", then filter so that bill_length is less than
| 30. So simple and so little fluff!
| erichocean wrote:
| > _is just so much more readable_
|
| I thought that too before I learned Clojure, now I find them
| equally readable.
| ertucetin wrote:
| I've built many different kinds of software (backend, frontend,
| 3D games, cli tools, code editor, and more) with Clojure and have
| been using it for over a decade now.
|
| I can confidently say that, among the list I mentioned, it's the
| best for data manipulation/transformation. Thanks to the author
| for presenting it clearly and showing how the libraries and code
| look across different languages, all of which do a great job.
|
| But Clojure has its own special place (maybe in my heart as well
| :). I think Clojure should be used more in the data science
| space. Thanks to the JVM, it can be very performant (I'm looking
| at you, Python).
| __mharrison__ wrote:
| Good pandas and polars code should also be written in an
| immutable way...
| epgui wrote:
| Good python code can exist, but python makes it so easy to
| write bad code that good python rarely exists.
| nxpnsv wrote:
| Agree. While it is common to see code like these pandas
| examples, it is very possible to write these manipulations so
| that they return a new frame or view without changing the
| inputs.
| olivia-banks wrote:
| Having "NA" being treated as nil/null/None by default seems like
| it would cause the Namibia problem!
| QubridAI wrote:
| Interesting perspective Clojure's immutable, functional approach
| makes data wrangling feel very different from the more imperative
| style of R and Python.
| thrawa8387336 wrote:
| I always wished Incanter took off.
| zmmmmm wrote:
| Seems like it's going to be a tough sell to get people to want to
| write (tc/select-rows ds #(> (% "year") 2008))
|
| instead of filter(ds, year > 2008)
|
| They seem to ignore the existance of Spark, so even if you
| specifically want to use JVM it feels clearer and simpler:
| ds.filter(r => r.year > 2008)
___________________________________________________________________
(page generated 2026-03-24 23:00 UTC)