3 ms·
Why does pandas code often feel ugly and clunky compared to the equivalent SQL? Is there no better way to do this?
by cuteboy19 4y ago
Why does pandas code often feel ugly and clunky compared to the equivalent SQL? Is there no better way to do this?
- throwamon 4y agohttps://github.com/machow/siuba https://github.com/machow/siuba for one
- wswope 4y agoI find Pandas vs. SQL to be complimentary, rather than an either-or type situation. For anything in the tens of GB range or smaller, it’s easy enough to move between the two with read_sql_query and to_sql. The general strategy is to build the core of any dataset as a SQL query that handles joins and performance-sensitive parts of the query, then polish/plot/yeet into weird shapes with Pandas since it offers much greater expressivity.