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

Method analyze

dask/dataframe/dask_expr/_collection.py:468–493  ·  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

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