-werners-
Esteemed Contributor III

Ok, basically it comes down to this:

Pandas/Python is pretty good in data processing, as long as it can run on a single node.

If you do not have issues with processing your data on a single node, pandas is fine.

However, when you start getting OOM messages etc, it can be a good idea to look at pyspark.pandas.

Spark will use multiple nodes to process the data.

Of course this means you will have to rewrite code. But with the latest additions of databricks this will not be a daunting task, here is an interesting article:

https://databricks.com/blog/2021/10/04/pandas-api-on-upcoming-apache-spark-3-2.html

Besides that you can still use 'ordinary' pandas or python. But beware that this code will be executed on the driver only (so in single node mode).

You can mix pandas and pyspark.pandas but it is not guaranteed that this will be faster than doing everything in pyspark.pandas because it will break the processing logic of spark into multiple parts.

But check out the article and see where it gets you.