ComeçarComece de graça

Constructing custom Dask bags

A common use case for Dask bags is to convert some code you have already written to run in parallel. Depending on the code, sometimes it can be easier to construct lists of delayed objects and then convert them to a bag. Other times it will be easier to form a Dask bag early on in the code and map functions over it. Which of these options is easier will depend on your exact code, so it's important that you know how to use either method.

dask has been imported for you, and dask.bag has been imported as db. A list of file names strings is available in your environment as wavfiles.

Este exercício faz parte do curso

Parallel Programming with Dask in Python

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Convert the list of filenames into a Dask bag
filename_bag = ____

# Apply the load_wav() function to each element of the bag
loaded_audio_bag = ____
Editar e executar o código