(no title)
aorist | 3 months ago
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
blubber|3 months ago
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|3 months ago
robot-wrangler|3 months ago
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.
tmtvl|3 months ago
medstrom|3 months ago
rtaylorgarlock|3 months ago
isolli|3 months ago
https://seaborn.pydata.org/tutorial/introduction.html
jampekka|3 months ago
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.
debtta|3 months ago
R: easy things are hard, hard things are easy.
m000|3 months ago
dm319|3 months ago
> 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|3 months ago
npalli|3 months ago
pphysch|3 months ago
jskherman|3 months ago
1vuio0pswjnm7|3 months ago
throwaway2037|3 months ago
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.
getnormality|3 months ago
evolighting|3 months ago
UniverseHacker|3 months ago