6 ms·
> Examples include converting boxplots into violins or vice versa, turning a line plot into a heatmap, plotting a density estimate instead of a histogram, perfo
by aorist 10mo ago
> Examples include converting boxplots into violins or vice versa, turning a line plot into a heatmap, plotting a density estimate instead of a histogram, performing a computation on ranked data values instead of raw data values, and so on.
Most of this is not about Python, it’s about matplotlib. If you want the admittedly very thoughtful design of ggplot in Python, use plotnine
> I would consider the R code to be slightly easier to read (notice how many quotes and brackets the Python code needs)
This isn’t about Python, it’s about the tidyverse. The reason you can use this simpler syntax in R is because it’s non-standard-evaluation allows packages to extend the syntax in a way Python does not expose: http://adv-r.had.co.nz/Computing-on-the-language.html http://adv-r.had.co.nz/Computing-on-the-language.html
- npalli 10mo agoPython is nothing without it’s batteries.
- jskherman 10mo agoPython is its batteries.
- iLemming 10mo agoBut why whenever I try to use it, it tries to hurt me like it's kicking me right in my batteries?
- pphysch 10mo agoThe design and success of e.g. Golang is pretty strong support for the idea that you can't and shouldn't separate a language from its broader ecosystem of tooling and packages.
- LtWorf 10mo agoThe success of python is due to not needing a broader ecosystem for A LOT of things. They are of course now abandoning this idea.
- lmm 10mo ago> The success of python is due to not needing a broader ecosystem for A LOT of things. I honestly think that was a coincidence. Perl and Ruby had other disadvantages, Python won despite having bad package management and a bloated standard library, not because of it.
- rjzzleep 10mo agoIt's because Ruby captured the web market and Python everything else, and I get everything is more timeless than a single segment.
- vkazanov 10mo agoRuby was competing on the web market and lost to many others, including Python. In part, because python had a much broader ecosystem, and php had wide adoption through wordpress and others, and javascript was expanding from browsers.
- procaryote 10mo agoThe bloated standard library is the only reason I kept using python in spite of the packaging nightmare. I can do most things with no dependencies, or with one dependency I need over and over like matplotlib If python had been lean and needed packages to do anything useful, while still having a packaging nightmare, it would have been unusable
- lmm 10mo agoWell, sure, but equally I think there would have been a lot more effort to fix the packaging nightmare if it had been more urgent.
- ModernMech 10mo agoThere was a massive effort though, the proliferation of several different package managers is evidence of that.
- 1vuio0pswjnm7 10mo agoWhat language is used to write the batteries
- logicprog 10mo agoC/C++, in large part
- saboot 10mo agoAnd below that, FORTRAN :)
- JPKab 10mo agoThese days it's a whole lot of Rust.
- volemo 10mo agoThese days it’s still a whole lot of Fortran, with some Rust sprinkled on top. (:
- pjmlp 10mo agoWhich since Fortran 2003, or even Fortran 95, has gotten rather nice to use.
- Koshkin 10mo agoIDK it's become too verbose IMHO, looks almost like COBOL now. (I think it was Fortran 66 that was the last Fortran true to its nature as a "Formula Translator"...)
- pjmlp 10mo agoWe are way beyond comparing languages to COBOL, now that plenty folks type whole book sized descriptions into tiny chat windows for their AI overloads.
- throwaway2037 10mo agoI hear this so much from Python people -- almost like they are paid by the word to say it. Is it different from Perl, Ruby, Java, or C# (DotNet)? Not in my experience, except people from those communities don't repeat that phrase so much. The irony here: We are talking about data science. 98% of "data science" Python projects start by creating a virtual env and adding Pandas and NumPy which have numerous (really: squillions of) dependencies outside the foundation library.
- m55au 10mo agoSomeone correct me if I'm completely wrong, but by default (i.e. precompiled wheels) numpy has 0 dependencies and pandas has 5, one of which is numpy. So not really "squillions" of dependencies. pandas==2.3.3 ├── numpy [required: >=1.22.4, installed: 2.2.6] ├── python-dateutil [required: >=2.8.2, installed: 2.9.0.post0] │ └── six [required: >=1.5, installed: 1.17.0] ├── pytz [required: >=2020.1, installed: 2025.2] └── tzdata [required: >=2022.7, installed: 2025.2]
- noitpmeder 10mo agoI don't know about _squillions_, but numpy definitely has _requirements_, even if they're not represented as such in the python graph. e.g. https://github.com/numpy/numpy/blob/main/.gitmodules (some source code requirements) https://github.com/numpy/numpy/tree/main/requirements (mostly build/ci/... requirements) ...
- m55au 10mo agoThey're not represented, because those are build-time dependencies. Most users when they do pip install numpy or equivalent, just get the precompiled binaries and none of those get installed. And even if you compile it yourself, you still don't need those for running numpy.
- nonameiguess 10mo agoRead https://numpy.org/devdocs/building/blas_lapack.html https://numpy.org/devdocs/building/blas_lapack.html. NumPy will fall back to internal and very slow BLAS and LAPACK implementations if your system does not have a better one, but assuming you're using NumPy for its performance and not just the convenience of adding array programming features to Python, you're really gonna want better ones, and what that is heavily depends on the computer you're using. This isn't really a Python thing, though. It's a hard problem to solve with any kind of scientific computing. If you insist on using a dynamic interpreted language, which you probably have to do for exploratory interactive analysis, and you still need speed over large datasets, you're gonna need to have a native FFI and link against native libraries. Thanks to standardization, you'll have many choices and which is fastest depends heavily on your hardware setup.
- dm319 10mo ago> This isn’t about Python, it’s about the tidyverse. > it’s non-standard-evaluation allows packages to extend the syntax in a way Python does not expose Well this is a fundamental difference between Python and R.
- debtta 10mo agoThe point is that the ability to extend the syntax of R leads to chaos and mess (in general) but when used correctly and effectively in the tidyverse, improves the experience of writing and reading code.
- robot-wrangler 10mo ago>> I would consider the R code to be slightly easier to read (notice how many quotes and brackets the Python code needs) Oh god no, do people write R like that, pipes at the end? Elixir style pipe-operators at the beginning is the way. And if you really wanted to "improve" readability by confusing arguments/functions/vars just to omit quotes, python can do that, you'll just need a wrapper object and getattr hacks to get from `my_magic_strings.foo` -> `'foo'`. As for the brackets.. ok that's a legitimate improvement, but again not language related, it's library API design for function sigs.
- rtaylorgarlock 10mo agoUpvoted for pipes at the beginning
- medstrom 10mo agoIIRC, putting pipe operator `|>` at end of line prevents the expression from terminating early. Otherwise the newline would terminate it.
- tmtvl 10mo agoThe right way is putting the pipe operator at the beginning of the expression. (-> (gather-some-data) (map 'Vector #'some-functor) (filter #'some-predicate) (reduce #'some-gatherer)) Or for those who have an irrational fear of brackets: -> gather-some-data map 'Vector #'some-functor filter #'some-predicate reduce #'some-gatherer
- evolighting 10mo agoR is more of a statistical software than a programming language. So, if you are a so-called "statistician," then R will feel familiar to you
- _yb2s 10mo agoNo, R is a serious general purpose programming language that is great for building almost any type of complex scientific software with. Projects like Bioconductor are a good example.
- evolighting 10mo agoPerhaps a in a context of comparison with Python? In my limited experience, Using R feels like to using JavaScript in the browser: it's a platform heavily focused on advanced, feature-rich objects (such as DataFrames and specialized plot objects). but you could also just build almost anything with it.
- blubber 10mo agoNo, it's not. Even established packages have bugs caused by R weirdness. I like it nevertheless.
- getnormality 10mo agoIt's not about Python, it's about how R lets you do something Python can't?
- isolli 10mo agoOr seaborn. It was built exactly for this purpose: abstracting some of the annoying kinks of matplotlib while still offering a rich set of features. https://seaborn.pydata.org/tutorial/introduction.html https://seaborn.pydata.org/tutorial/introduction.html
- jampekka 10mo agoI wonder what the last example of "logistics without libraries" would look like in R. Based on my experience of having to do "low-level" R, it's gonna be a true horror show. In R it's often that things for which there's a ready made libraries and recipes are easy, but when those don't exist, things become extremely hard. And the usual approach is that if something is not easy with a library recipe, it just is not done.
- m000 10mo agoThe way you describe it, can we say that R was AI-first without even knowing?
- nerdponx 10mo agoR is overtly and heavily inspired by Lisp which was a big deal in AI at one point. They knew what they were doing.
- debtta 10mo agoPython: easy things are easy, hard things are hard. R: easy things are hard, hard things are easy.
- blubber 10mo ago"The reason you can use this simpler syntax in R is because it’s non-standard-evaluation ..." So it actually is about Python vs R. That said, while this kind of non-standard evaluation is nice when working interactively on the command line, I don't think it's that relevant when writing code for more elaborated analyses. In that context, I'd actually see this as a disadvantage of R because you suddenly have to jump through loops to make trivial things work with that non-standard evaluation.
- _Wintermute 10mo agoThe increasing prevalence of non-standard evaluation in R packages was one of the major reasons I switched from R to python for my work. The amount of ceremony and constant API changes just to have something as an argument in a function drove me mad.
- disgruntledphd2 10mo ago> nd constant API changes Yeah, this was so very very painful. I once ended up maintaining a library that basically used all the different NSE approaches, which was not very much fun at all.