MCPcopy
hub / github.com/dask/dask / to_dict

Method to_dict

dask/highlevelgraph.py:564–570  ·  view source on GitHub ↗

Efficiently convert to plain dict. This method is faster than dict(self).

(self)

Source from the content-addressed store, hash-verified

562 return iter(self.to_dict())
563
564 def to_dict(self) -> dict[Key, Any]:
565 """Efficiently convert to plain dict. This method is faster than dict(self)."""
566 try:
567 return self._to_dict
568 except AttributeError:
569 out = self._to_dict = ensure_dict(self)
570 return out
571
572 def keys(self) -> KeysView:
573 """Get all keys of all the layers.

Callers 15

__iter__Method · 0.95
keysMethod · 0.95
itemsMethod · 0.95
valuesMethod · 0.95
demo_tuplesFunction · 0.95
to_dataframeMethod · 0.80
meta_warningFunction · 0.80
_nunique_df_chunkFunction · 0.80
_layerMethod · 0.80
_collect_statisticsFunction · 0.80
_df_to_bagFunction · 0.80

Calls 1

ensure_dictFunction · 0.90

Tested by 4

demo_tuplesFunction · 0.76
test_enforce_dtypesFunction · 0.64