MCPcopy Create free account
hub / github.com/dask/dask / analyze

Method analyze

dask/dataframe/dask_expr/_collection.py:462–487  ·  view source on GitHub ↗

Outputs statistics about every node in the expression. analyze optimizes the expression and triggers a computation. It records statistics like memory usage per partition to analyze how data flow through the graph. .. warning:: analyze adds plugins to the schedul

(self, filename: str | None = None, format: str | None = None)

Source from the content-addressed store, hash-verified

460 return DaskMethodsMixin.persist(out, **kwargs)
461
462 def analyze(self, filename: str | None = None, format: str | None = None) -> None:
463 """Outputs statistics about every node in the expression.
464
465 analyze optimizes the expression and triggers a computation. It records statistics
466 like memory usage per partition to analyze how data flow through the graph.
467
468 .. warning::
469 analyze adds plugins to the scheduler and the workers that have a non-trivial
470 cost. This method should not be used in production workflows.
471
472 Parameters
473 ----------
474 filename: str, None
475 File to store the graph representation.
476 format: str, default is png
477 File format for the graph representation.
478
479 Returns
480 -------
481 None, but writes a graph representation of the expression enriched with
482 statistics to disk.
483 """
484 out = self
485 if not isinstance(out, Scalar):
486 out = out.repartition(npartitions=1)
487 return out.expr.analyze(filename=filename, format=format)
488
489 def explain(self, stage: OptimizerStage = "fused", format: str | None = None):
490 """Create a graph representation of the Expression.

Callers 1

test_analyzeFunction · 0.45

Calls 1

repartitionMethod · 0.45

Tested by 1

test_analyzeFunction · 0.36