MCPcopy Index your code
hub / github.com/dask/dask / meta_frame_constructor

Function meta_frame_constructor

dask/dataframe/utils.py:720–740  ·  view source on GitHub ↗

Return a serial DataFrame constructor Parameters ---------- like : Any series-like, Index-like or dataframe-like object.

(like)

Source from the content-addressed store, hash-verified

718
719
720def meta_frame_constructor(like):
721 """Return a serial DataFrame constructor
722
723 Parameters
724 ----------
725 like :
726 Any series-like, Index-like or dataframe-like object.
727 """
728 if is_dask_collection(like):
729 try:
730 like = like._meta
731 except AttributeError:
732 raise TypeError(f"{type(like)} not supported by meta_frame_constructor")
733 if is_dataframe_like(like):
734 return like._constructor
735 elif is_series_like(like):
736 return like._constructor_expanddim
737 elif is_index_like(like):
738 return like.to_frame()._constructor
739 else:
740 raise TypeError(f"{type(like)} not supported by meta_frame_constructor")
741
742
743def meta_series_constructor(like):

Callers 7

_cov_corr_aggFunction · 0.90
idxmaxmin_chunkFunction · 0.90
idxmaxmin_rowFunction · 0.90
stdMethod · 0.90
__array_wrap__Method · 0.90

Calls 5

is_dask_collectionFunction · 0.90
is_dataframe_likeFunction · 0.90
is_series_likeFunction · 0.90
is_index_likeFunction · 0.90
to_frameMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…