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

Function meta_series_constructor

dask/dataframe/utils.py:754–774  ·  view source on GitHub ↗

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

(like)

Source from the content-addressed store, hash-verified

752
753
754def meta_series_constructor(like):
755 """Return a serial Series constructor
756
757 Parameters
758 ----------
759 like :
760 Any series-like, Index-like or dataframe-like object.
761 """
762 if is_dask_collection(like):
763 try:
764 like = like._meta
765 except AttributeError:
766 raise TypeError(f"{type(like)} not supported by meta_series_constructor")
767 if is_dataframe_like(like):
768 return like._constructor_sliced
769 elif is_series_like(like):
770 return like._constructor
771 elif is_index_like(like):
772 return like.to_frame()._constructor_sliced
773 else:
774 raise TypeError(f"{type(like)} not supported by meta_series_constructor")
775
776
777def get_string_dtype():

Callers 8

idxmaxmin_chunkFunction · 0.90
idxmaxmin_rowFunction · 0.90
stdMethod · 0.90
_dot_seriesFunction · 0.90
__array_wrap__Method · 0.90
to_datetimeFunction · 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