Wes McKinney, the developer of Pandas
qz.com
qz.com
Compare with dlply. It solves a similar problem as pandas does but has a vastly simpler API. To be fair, Pandas does do more but dlply is also more flexible. I looked at implementing something like dlply in Python but you really need to have a lazy evaluation syntax. dlply makes extensive use of this feature of R. As the downside, it can be very confusing to new users as it is hard to debug this lazy evaluation code.
Rather than adopting Pandas to build our product, I built a very minimal version of it (on top of numpy) that only does what we need. That was some extra work but I'm happy I did it as we avoid this huge dependency. I understand quite well my little minimal version does, it is only about 1000 lines of Python code and some tiny C extensions.
It’s a more complicated environment for sure, but still more efficient.
df1.createOrReplaceTempView("table1")
df2.createOrReplaceTempView("table2")
spark.sql("SELECT * FROM table1 t1, table2 t2 WHERE t1.id=t2.fid")I find both hobbled, however, by their rather simple SQL dialects. No window functions, common table expressions, grouping sets or similar, etc. An improvement, no doubt, but Postgres still has it beat.
I honestly wish the vast corpus of effort put into statistics and machine learning in R and Python were more easily portable as Postgres foreign function packages. I've tried the ones I've seen mentioned and they were all horrible, mostly due to embedding an entire language's runtime and memory model on top of the SQL inner workings. A project on my backburner, waiting for the time to work on it :)
Yes, SQL is incredibly battle-tested, and has a ton of features that newer systems need to catch up on, and there's a ton of work sunk into performance on too-big-for-RAM datasets that standalone Pandas and dplyr doesn't have. (But see dbplyr, for example.)
But actually programming in SQL sucks. There's no such thing as code reuse, as parameterization, as composability, etc. Everything about DRY goes right out the window when writing SQL and copy-pasta is the law of the land. Writing dplyr is so much more comfortable for me with just a little bit of learning about it. And I think it's going to be so much easier to extend dplyr to cover the gaps between it an SQL than it would be to try and fix the ergonomics of SQL.
* anything with data that doesn't fit in memory
* anything that could trivially be written in an SQL window function
* anything involving table joins, especially multi-column and/or non-inner joins.
* anything involving subtotal-like summaries (easily implemented using GROUPING SETS, CUBE, and/or ROLLUP)
I use pandas more than any other tool, but every time I look at R, I go through a period of re-evaluating all my life decisions.
You know Heinrich Wolfflin, one of the pioneers of art history, invented this breakthrough method of teaching where he would set up dual projectors because demonstrating contrasts was a much more effective pedagogical tool than simply describing a painting.
What? It seems McKinney didn't commit almost anything for the past few years to pandas (not lowering his contribution per-se, but the article made it sounds like he's still dedicated to improvements of pandas).
https://notebooks.azure.com/wesm/libraries/python-for-data-a...
If you want to read, click on any notebook, for example:
https://notebooks.azure.com/wesm/libraries/python-for-data-a...
If you want to run, click Clone, sign in, then Run. It's basically a collection of Jupyter notebooks. This is from his personal repo.
[disclaimer: work at msft]
https://github.com/wesm/pydata-book
I was really pleased to notice that the second edition of the "Pandas book" (https://www.amazon.com/Python-Data-Analysis-Wrangling-IPytho...) just came out in late October. I'm about halfway through reading it now.
https://medium.com/dunder-data/python-for-data-analysis-a-cr...
.. Followed by Scikit learn. Then, huge projects like {Tensorflow, Pytorch}. Only then, Pandas.
I don't know why QZ thought it is a good idea to start a "Meet the man" article with a large photo of a man who is not the titular man.
[1] https://www.citylab.com/environment/2017/09/lab-report-shari...
A couple of years ago the whole team was using only R. Now some guys use it here and there a couple of days a month.
Programmers grok pandas Statisticians grok R
A metric worth underlining.