Python Forum
Seeking advice on dask distributed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeking advice on dask distributed
#1
I am using python to do stock backtesting for day trading.

I have a function called process_date(datedf), this is passed a pandas dataframe.

This function backtests the strategy across a single day, and returns me another pandas dataframe with the desired results.

Because this is day trading, each day is completely independent from the next so I parallelized my code to run multiple days at once using joblib, and it works great.

However, I want to take it to the next step - my main computer only has 16 cores, it's the fastest one I have but I have a menagerie of other computers strewn about. So my thought was what if I can parallelize this process_date function across multiple computers using dask distributed. Just like how joblib does on one computer, but now I'm also using the cores in multiple other computers at once.

I've never used dask before, but my understanding is that each function needs to be passed a dask dataframe. I could convert the pandas dataframe to a dask dataframe before passing it - but then would all my pandas functions inside of process_date() still work? I read that each partition of a dask dataframe is essentially a pandas dataframe, so my understanding is it should work, but I'm seeking confirmation.

Also, I do make use of some global variables within the function. This works fine with joblib, but would this work with dask across multiple machines? Or would I need to rewrite that code?

Let me know if conceptually my idea would work, or not. Thanks.
Reply


Messages In This Thread
Seeking advice on dask distributed - by sawtooth500 - Apr-13-2024, 09:36 PM
RE: Seeking advice on dask distributed - by Larz60+ - Apr-14-2024, 10:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  New user seeking help EdRaponi 2 49,726 Jun-23-2020, 12:03 PM
Last Post: EdRaponi
  seeking suggestions for function option name Skaperen 1 2,574 Dec-22-2018, 05:27 AM
Last Post: Gribouillis
  Newbie seeking help with DNS query DaytonJones 0 2,266 Sep-21-2018, 06:29 PM
Last Post: DaytonJones
  Class Modules, and Passing Variables: Seeking Advice Robo_Pi 21 10,498 Mar-02-2018, 05:22 PM
Last Post: snippsat
  Seeking understanding with the python import function. Intelligent_Agent0 2 2,647 Feb-18-2018, 11:57 PM
Last Post: snippsat
  Seeking feedback on my script-in-progress league55 2 2,692 Feb-12-2018, 03:03 PM
Last Post: league55
  Seeking creative and knowlegeable coder for help! Elusth 4 5,535 Nov-07-2016, 08:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020