rewrite the code in spark

Job ID: 33341732

Budget: ₹600 – ₹1,500 INR

there is a code in python which is taking longer time and memory to run on databricks, please rewrite the code in spark or if possible to cut short in python, then also fine... need to optimize the code and run with low memory in databricks
Related categories: Python Azure Microsoft Azure PySpark