ComenzarEmpieza gratis

Creating a Dask bag

You have been tasked with analyzing some reviews left on TripAdvisor. Your colleague has provided the reviews as a list of strings. You want to use Dask to speed up your analysis of the data, so to start with, you need to load the data into a Dask bag.

Este ejercicio forma parte del curso

Parallel Programming with Dask in Python

Ver curso

Instrucciones del ejercicio

  • Import the dask.bag subpackage as db.
  • Use the from_sequence() function to convert reviews_list into a Dask bag with 3 partitions.
  • Use the bag's .take() method to print a single element from the Dask bag.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Import the Dask bag subpackage as db
____

# Convert the list to a Dask bag
review_bag = db.____(____, ____=____)

# Print 1 element of the bag
print(____)
Editar y ejecutar código