frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Python is not a great language for data science

https://blog.genesmindsmachines.com/p/python-is-not-a-great-language-for
48•speckx•2h ago

Comments

lenerdenator•1h ago
> I think people way over-index Python as the language for data science. It has limitations that I think are quite noteworthy. There are many data-science tasks I’d much rather do in R than in Python.1 I believe the reason Python is so widely used in data science is a historical accident, plus it being sort-of Ok at most things, rather than an expression of its inherent suitability for data-science work.

Python doesn't need to be the best at any one thing; it just has to be serviceable for a lot of things. You can take someone who has expertise in a completely different domain in software (web dev, devops, sysadmin, etc.) and introduce them to the data science domain without making them learn an entirely new language and toolchain.

dmurray•1h ago
That's not why it's used in data science though. Lots of data scientists use Python all day and have no concept of ever working in a different field.

It's used in data science because it's used in data science.

mohaine•1h ago
But data science usually isn't an island.

Use whatever you want on your one off personal projects but use something more non-data science friendly if you ever want your model to run directly in a production workflow.

Productionizing R models is quite painful. The normal way is to just rewrite it not in R.

lenerdenator•1h ago
That's probably true now, but at one point, they were looking for people to start doing data science, and were pulling people from other domains.
vkazanov•56m ago
It's used in data science because no other language has this level of library support.

And it got this unprecedented level of support because right from the start it made its focus clear syntax and (perceived) simplicity.

There is also a sort of cumulative effect from being nice for algorithmic work.

Guido's long-term strategy won over numerous other strong candidates for this role.

forgotpwd16•1h ago
Article is well written but fails to address its own thesis by postponing it to a sequel article. At its current state only alludes that Python is not great because requires specialized packages. (And counterexample is R for which also used a package.)
stevenpetryk•1h ago
Totally agree. The author's most significant example is two code snippets that are quite similar and both pretty nice.
yeahwhatever10•1h ago
A little late for this
ASalazarMX•52m ago
"Not great" doesn't necessarily mean "bad", it can be interpreted as "good", or even "very good". An honest title would have explicitly qualified how suitable the author found it was.

That the author avoided saying Python was a bad language outright speaks a great deal of its suitability. Well, that, and the majority data science in practice.

iLemming•1h ago
From many practical points, Clojure is great for data. And you can even leverage python libs via clj-python.
phforms•12m ago
In the past few years I have seen some serious efforts from the Clojure community to make Clojure more attractive for data science. Check out the Scicloj[1] group and their data science stack/toolkit Noj[2] (still in beta) as well as the high-performance tabular data processing library tech.ml.dataset (TMD)[3].

- [1] https://scicloj.github.io

- [2] https://scicloj.github.io/noj

- [3] https://github.com/techascent/tech.ml.dataset

paulfharrison•56m ago
R is so good in part because of the efforts of people like Di Cook, Hadley Wickham, and Yihui Xie to create an software environment that they like working in.

It also helps that in R any function can completely change how its arguments are evaluated, allowing the tidyverse packages to do things like evaluate arguments in the context of a data frame or add a pipe operator as a new language feature. This is a very dangerous feature to put in the hands of statisticians, but it allows more syntactic innovation than is possible in Python.

cb321•42m ago
Like Python, R is a 2 (+...) language system. C/Fortran backends are needed for performance as problems scale up.

Julia and Nim [1] are dynamic and static approaches (respectively) to 1 language systems. They both have both user-defined operators and macros. Personally, I find the surface syntax of Julia rather distasteful and I also don't live in PLang REPLs / emacs all day long. Of course, neither Julia nor Nim are impractical enough to make calling C/Fortran all that hard, but the communities do tend to implement in the new language without much prompting.

[1] https://nim-lang.org/

Lyngbakr•56m ago
I was a bit disappointed to discover that this was essentially an R vs. Python article, which is a data science trope. I've been in the field for 20+ years now and while I used to be firmly on team R, I now think that we don't really have a good language for data science. I had high hopes for Julia and even Clojure's data landscape looks interesting, but given the momentum of Python I don't see how it could be usurped at this point.
vkazanov•54m ago
It is EVERYWHERE. I recently had to interview a bunch of data scientists, and only one of them knew SQL. Surely, all of then worked with python. I bet none of them even heard of R.
Lyngbakr•49m ago
Yikes. Were they experienced data scientists or straight out of school? I find it very odd (and a bit scary) that they didn't know SQL.
garciasn•42m ago
Experienced Data Scientists and/or those straight out of school are EXTREMELY lacking in valuable SQL experience and always have been. Take a DS with 25 years experience in SAS, many of them are great with DATAstep, but have far less experience using PROC SQL for querying the data in the most effective way--even if they were pulling the data down with pass-through via SAS/ACCESS.

Often they'd be doing very simplistic querying and then manipulating via DATAstep prior to running whatever modeling and/or reporting PROCs later, rather than pushing it upstream into a far faster native database SQL pull via pass-through.

Back in 2008/2009, I saved 30h+ runtime on a regular report by refactoring everything in SQL via pass-through as opposed to the data scientists' original code that simply pulled the data down from the external source and manipulated it in DATAstep. Moving from 30h to 3m (Oracle backend) freed up an entire FTE to do more than babysit a long-running job 3x a week to multiple times per day.

garciasn•48m ago
SAS > R > Python.

The focus of SAS and R were primarily limited to data science-related fields; however, Python is a far more generic programming language, thus the number of folks exposed to it is wider and thus the hiring pool of those who come in exposed to Python is FAR LARGER than SAS/R ever were, even when SAS was actively taught/utilized in undergraduate/graduate programs.

As a hiring leader in the Data Science and Engineering space, I have extensive experience with all of these + SQL, among others. Hiring has become much easier to go cross-field/post-secondary experience and find capable folks who can hit the ground running.

username135•44m ago
you beat me to it. i understand why sas gets hate but I think that comes with simply not understanding how powerful it is.
garciasn•40m ago
It was a great language, but it was/is extremely cost-prohibitive plus it simply fell out of favor in academia, for many of the same reasons, and thus was supplanted by free alternatives.
SiempreViernes•47m ago
What would it even mean to be a "good language for data science"?

In the first place data science is more a label someone put on bag full of cats, rather than a vast field covered by similarly sized boxes.

username135•46m ago
SAS has entered the chat
RobinL•51m ago
I think a lot of this comes down to the question: Why aren't tables first class citizens in programming languages?

If you step back, it's kind of weird that there's no mainstream programming language that has tables as first class citizens. Instead, we're stuck learning multiple APIs (polars, pandas) which are effectively programming languages for tables.

R is perhaps the closest, because it has data.frame as a 'first class citizen', but most people don't seem to use it, and use e.g. tibbles from dplyr instead.

The root cause seems to be that we still haven't figured out the best language to use to manipulate tabular data yet (i.e. the way of expressing this). It feels like there's been some convergence on some common ideas. Polars is kindof similar to dplyr. But no standard, except perhaps SQL.

FWIW, I agree that Python is not great, but I think it's also true R is not great. I don't agree with the specific comparisons in the piece.

jna_sh•43m ago
I know the primary data structure in Lua is called a table, but I’m not very familiar with them and if they map to what’s expected from tables in data science.
TheSoftwareGuy•40m ago
IIRC those are basically hash tables, which are first-class citizens in many languages already
Jtsummers•39m ago
Lua's tables are associative arrays, at least fundamentally. There's more to it than that, but it's not the same as the tables/data frames people are using with pandas and similar systems. You could build that kind of framework on top of Lua's tables, though.

https://www.lua.org/pil/2.5.html

kelipso•43m ago
People use data.table in R too (my favorite among those but it’s been a few years). data.table compared to dplyr is quite a contrast in terms of language to manipulate tabular data.
CivBase•42m ago
What is a table other than an array of structs?
RobinL•24m ago
I would argue that's about how the data is stored. What I'm trying to express is the idea of the programming language itself supporting high level tabular abstractions/transformations such as grouping, aggregation, joins and so on.
CivBase•19m ago
Ah, that makes more sense. Thanks for the clarification.
thom•9m ago
It’s not that you can’t model data that way (or indeed with structs of arrays), it’s just that the user experience starts to suck. You might want a dataset bigger than RAM, or that you can transparently back by the filesystem, RAM or VRAM. You might want to efficiently index and query the data. You might want to dynamically join and project the data with other arrays of structs. You might want to know when you’re multiplying data of the wrong shapes together. You might want really excellent reflection support. All of this is obviously possible in current languages because that’s where it happens, but it could definitely be easier and feel more of a first class citizen.
kevinhanson•36m ago
this is my biggest complaint about SAS--everything is either a table or text.

most procs use tables as both input and output, and you better hope the tables have the correct columns.

you want a loop? you either get an implicit loop over rows in a table, write something using syscalls on each row in a table, or you're writing macros (all text).

nextos•29m ago
I don't think this is the real problem. In R and Julia tables are great, and they are libraries. The key is that these languages are very expressive and malleable.

Simplifying a lot, R is heavily inspired by Scheme, with some lazy evaluation added on top. Julia is another take at the design space first explored by Dylan.

paddleon•23m ago
> R is perhaps the closest, because it has data.frame as a 'first class citizen', but most people don't seem to use it, and use e.g. tibbles from dplyr instead.

You're forgetting R's data.table, https://cran.r-project.org/web/packages/data.table/vignettes...,

which is amazing. Tibbles only wins because they fought the docs/onboarding battle better, and dplyr ended up getting industry buy-in.

RodgerTheGreat•19m ago
There are a number of dynamic languages to choose from where tables/dataframes are truly first-class datatypes: perhaps most notably Q[0]. There are also emerging languages like Rye[1] or my own Lil[2].

I suspect that in the fullness of time, mainstream languages will eventually fully incorporate tabular programming in much the same way they have slowly absorbed a variety of idioms traditionally seen as part of functional programming, like map/filter/reduce on collections.

[0] https://en.wikipedia.org/wiki/Q_(programming_language_from_K...

[1] https://ryelang.org/blog/posts/comparing_tables_to_python/

[2] http://beyondloom.com/tools/trylil.html

serjester•50m ago
Seems like their critique boils down to two areas - pandas limitations and fewer built ins to lean on.

Personally I've found polars has solved most of the "ugly" problems that I had with pandas. It's way faster, has an ergonomic API, seamless pandas interop and amazing support for custom extensions. We have to keep in mind Pandas is almost 20 years old now.

I will agree that Shiny is an amazing package, but I would argue it's less important now that LLMs will write most of your code.

kasperset•45m ago
R data science people generally come to data science field from life science or stats field. Python data science people generally originate from other fields that are mostly engineering focused. Again this may not apply to all the cases but that is my general observation.

Recently I am seeing that Python is heavily pushed for all data science related things. Sometimes objectively Python may not be the best option especially for stats. It is hard to change something after it becomes the "norm" regardless of its usability.

exabrial•44m ago
The problem is there's so much momentum behind it that's hard to course correct. PyTorch is now a goliath.
jakobnissen•42m ago
Excellent article - except that the author probably should have gated their substantiation of the claim behind a cliffhanger, as other commenters have mentioned.

The author's priorities are sensible, and indeed with that set of priorities, it makes sense to end up near R. However, they're not universal among data scientists. I've been a data scientist for eight years, and have found that this kind of plotting and dataframe wrangling is only part of the work. I find there is usually also some file juggling, parsing, and what the author calls "logistics". And R is terrible at logistics. It's also bad at writing maintainable software.

If you care more about logistics and maintenance, your conclusion is pushed towards Python - which still does okay in the dataframes department. If you're ALSO frequently concerned about speed, you're pushed towards Julia.

None of these are wrong priorities. I wish Julia was better at being R, but it isn't, and it's very hard to be both R and useful for general programming.

Edit: Oh, and I should mention: I also teach and supervise students, and I KEEP seeing students use pandas to solve non-table problems, like trying to represent a graph as a dataframe. Apparently some people are heavily drawn to use dataframes for everything - if you're one of those people, reevaluate your tools, but also, R is probably for you.

whyenot•42m ago
What makes Python a great language for data science, is that so many people are familiar with it, and that it is an easy language to read. If you use a more obscure language like Clojure, Common Lisp, Julia, etc., many people will not be familiar with the language and unable to read or review your code. Peer review is fundamental to the scientific endeavor. If you only optimize on what is the best language for the task, there are clearly better languages than Python. If you optimize on what is best for science then I think it is hard not to argue that Python (and R) are the best choices. In science, just getting things done is not enough. Other people need to be able to read and understand what you are doing.

BTW AI is not helping and in fact is leading to a generation of scientists who know how to write prompts, but do not understand the code those prompts generate or have the ability to peer review it.

huherto•37m ago
For what is worth. The Kotlin folks have been adding some cool features and tools for data analysis. https://kotlinlang.org/docs/data-analysis-overview.html
niemandhier•36m ago
Python is just a language that:

1. Is easy to read

2. Was easy to extend in languages that people who work with scientific data happen to like.

When I did my masters we hacked around in the numpy source and contributed here and there while doing astrophysics.

Stuff existed in Java and R, but we had learned C in the first semester and python was easier to read and contrary to MATLAB numpy did not need a license.

When data science came into the picture, the field was full of physicists that had done similar things. They brought their tools as did others.

jswelker•33m ago
Inherited Python code is a mixed bag. Inherited R code is a nightmare.
mushufasa•31m ago
Languages inherently have network effects; most people around the world learn English so they can talk with other professionals who also know English, not because they are passionate about Charles Dickens.

My take (and my own experience) is that python won because the rest of the team knows it. I prefer R but our web developers don't know it, and it's way better for me to write code that the rest of our team can review, extend, and maintain.

pacbard•28m ago
When you think about a data science pipeline, you really have three separate steps:

[Data Preparation] --> [Data Analysis] --> [Result Preparation]

Neither Python or R does a good job at all of these.

The original article seems to focus on challenges in using Python for data preparation/processing, mostly pointing out challenges with Pandas and "raw" Python code for data processing.

This could be solved by switching to something like duckdb and SQL to process data.

As far as data analysis, both Python and R have their own niches, depending on field. Similarly, there are other specialized languages (e.g., SAS, Matlab) that are still used for domain-specific applications.

I personally find result preparation somewhat difficult in both Python and R. Stargazer is ok for exporting regression tables but it's not really that great. Graphing is probably better in R within the ggplot universe (I'm aware of the python port).

huherto•27m ago
Isn't the author saying that Python + Pandas is almost as good as R, but Python without Pandas is less powerful than R.

I can't help to conclude that Python is as good as R because I still have the choice of using Pandas when I need it. What did I get wrong?

paddleon•19m ago
you missed the "almost as" in your first sentence.

also, we didn't define "good".

programmertote•25m ago
Disclaimer: I have nothing against R or Python and I'm not partial to either.

Python, the language itself, might not be a great language for data science. BUT the author can use Pandas or Polars or another data-science-related library/framework in Python to get the job done that s/he was trying to write in R. I could read both her R and Pandas code snippets and understand them equally.

This article reads just like, "Hey, I'm cooking everything by making all ingredients from scratch and see how difficult it is!".

NuSkooler•24m ago
You could end it with "Python is not a great language".

Now, is Python a SUCCESSFUL language? Very.

rdtsc•23m ago
They basically advocate using R. I think it depends what they mean by "data science" and if the person will be doing just data science. If that's the case then R may be better. As in their whole career is going to built on that domain. But let's say they are on a general computer science track, now they'll probably benefit from learning Python more than R, simply because they can use it for other purposes.

> Either way, I’ll not discuss it further here. I’ll also not consider proprietary languages such as Matlab or Mathematica, or fairly obscure languages lacking a wide ecosystem of useful packages, such as Octave.

I feel, to most programming folks R is in the same category. R is to them what Octave is to the author. R is nice nice, but do they really want to learn a "niche" language, even if it has better some features than Python? Is holding a whole new paradigm, syntax, library ecosystem in your head worth it?

Google Antigravity Exfiltrates Data

https://www.promptarmor.com/resources/google-antigravity-exfiltrates-data
144•jjmaxwell4•51m ago•44 comments

Show HN: We built an open source, zero webhooks payment processor

https://github.com/flowglad/flowglad
99•agreeahmed•1h ago•64 comments

FLUX.2: Frontier Visual Intelligence

https://bfl.ai/blog/flux-2
133•meetpateltech•3h ago•43 comments

Launch HN: Onyx (YC W24) – Open-source chat UI

109•Weves•5h ago•93 comments

Bad UX World Cup 2025

https://badux.lol/
7•CharlesW•46m ago•2 comments

The 101 of analog signal filtering (2024)

https://lcamtuf.substack.com/p/the-101-of-analog-signal-filtering
66•harperlee•4d ago•3 comments

how to repurpose your old phone into a web server

https://far.computer/how-to/
32•louismerlin•3d ago•14 comments

It is ok to say "CSS variables" instead of "custom properties"

https://blog.kizu.dev/css-variables/
49•eustoria•1h ago•27 comments

Trillions spent and big software projects are still failing

https://spectrum.ieee.org/it-management-software-failures
123•pseudolus•7h ago•104 comments

Human brains are preconfigured with instructions for understanding the world

https://news.ucsc.edu/2025/11/sharf-preconfigured-brain/
352•XzetaU8•12h ago•240 comments

Show HN: Secure private diffchecker with merge support

https://diffchecker.dev
4•subhash_k•22m ago•2 comments

Making Crash Bandicoot (2011)

https://all-things-andy-gavin.com/video-games/making-crash/
156•davikr•7h ago•14 comments

Jakarta is now the biggest city in the world

https://www.axios.com/2025/11/24/jakarta-tokyo-worlds-biggest-city-population
67•skx001•13h ago•18 comments

Ozempic does not slow Alzheimer's, study finds

https://www.semafor.com/article/11/25/2025/ozempic-does-not-slow-alzheimers-study-finds
60•danso•2h ago•46 comments

Most Stable Raspberry Pi? Better NTP with Thermal Management

https://austinsnerdythings.com/2025/11/24/worlds-most-stable-raspberry-pi-81-better-ntp-with-ther...
252•todsacerdoti•12h ago•77 comments

LPLB: An early research stage MoE load balancer based on linear programming

https://github.com/deepseek-ai/LPLB
12•simonpure•6d ago•0 comments

Unpowered SSDs slowly lose data

https://www.xda-developers.com/your-unpowered-ssd-is-slowly-losing-your-data/
671•amichail•23h ago•277 comments

Roblox is a problem but it's a symptom of something worse

https://www.platformer.news/roblox-ceo-interview-backlash-analysis/
113•FiddlerClamp•3h ago•161 comments

Inflatable Space Stations

https://worksinprogress.co/issue/inflatable-space-stations/
15•bensouthwood•4d ago•4 comments

Broccoli Man, Remastered

https://mbleigh.dev/posts/broccoli-man-remastered/
125•mbleigh•6d ago•66 comments

Orion 1.0

https://blog.kagi.com/orion
198•STRiDEX•3h ago•114 comments

PRC elites voice AI-skepticism

https://jamestown.org/prc-elites-voice-ai-skepticism/
90•JumpCrisscross•23h ago•19 comments

Nearby peer discovery without GPS using environmental fingerprints

https://www.svendewaerhert.com/blog/nearby-peer-discovery/
54•waerhert•4d ago•17 comments

US banks scramble to assess data theft after hackers breach financial tech firm

https://techcrunch.com/2025/11/24/us-banks-scramble-to-assess-data-theft-after-hackers-breach-fin...
29•indigodaddy•2h ago•0 comments

Brain has five 'eras' with adult mode not starting until early 30s

https://www.theguardian.com/science/2025/nov/25/brain-human-cognitive-development-life-stages-cam...
213•hackernj•5h ago•191 comments

Claude Advanced Tool Use

https://www.anthropic.com/engineering/advanced-tool-use
614•lebovic•1d ago•246 comments

APT Rust requirement raises questions

https://lwn.net/SubscriberLink/1046841/5bbf1fc049a18947/
214•todsacerdoti•5h ago•380 comments

Using an Array of Needles to Create Solid Knitted Shapes

https://dl.acm.org/doi/10.1145/3746059.3747759
71•PaulHoule•3d ago•19 comments

Hollywood's vision of ancient Rome is all wrong, according to Mary Beard

https://www.openculture.com/2025/11/why-your-vision-of-ancient-rome-is-all-wrong-according-to-his...
55•bookofjoe•6d ago•55 comments

How the Atomic Tests Looked Like from Los Angeles

https://www.amusingplanet.com/2016/09/how-atomic-tests-looked-like-from-los.html
123•ohjeez•3d ago•84 comments