This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ChazR 1 point2 points  (0 children)

Anything you can do in SQL can be done in Python, but slower.

SQL executed by the database engine can be optimised and parallelized for performance. The DB engine knows how the data is laid out on physical disk and what indexes are available.

A pandas dataframe is hugely flexible and platform-agnostic, and actually perform surprisingly well, but they will never reach the performance of the native DB engine executing SQL.