Comece agoraComece grátis

Collecting two reports together

The dashboard needs two related summaries: digital checkouts by format and digital checkouts by month. Both queries scan the same CSV. Hand both lazy queries to pl.collect_all() so Polars plans them together and reads the file just once.

Two LazyFrame queries have already been built for you:

  • checkouts_by_format: total digital checkouts grouped by format.
  • checkouts_by_month: total digital checkouts grouped by month.

Este exercicio faz parte do curso

Scaling and Optimizing Data Pipelines with Polars

Ver curso

Instruções do exercicio

  • Use the right method to execute both lazy queries at once.
  • Pass checkouts_by_format first and checkouts_by_month second in the list.

exercicio interativo prático

Tente este exercicio completando este código de exemplo.

# Execute both lazy queries together so Polars shares the scan
results = pl.____([
    # Pass checkouts_by_format first, then checkouts_by_month
    ____,
    ____,
])

# Inspect each result
print(results[0])
print(results[1])
Editar e Executar Código