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

Method __array_wrap__

dask/dataframe/dask_expr/_collection.py:2782–2800  ·  view source on GitHub ↗
(self, array, context=None)

Source from the content-addressed store, hash-verified

2780 return NotImplemented
2781
2782 def __array_wrap__(self, array, context=None):
2783 if isinstance(context, tuple) and len(context) > 0:
2784 if isinstance(context[1][0], np.ndarray) and context[1][0].shape == ():
2785 index = None
2786 else:
2787 index = context[1][0].index
2788 else:
2789 try:
2790 import inspect
2791
2792 method_name = f"`{inspect.stack()[3][3]}`"
2793 except IndexError:
2794 method_name = "This method"
2795
2796 raise NotImplementedError(
2797 f"{method_name} is not implemented for `dask.dataframe.DataFrame`."
2798 )
2799
2800 return meta_frame_constructor(self)(array, index=index, columns=self.columns)
2801
2802 def _ipython_key_completions_(self):
2803 return methods.tolist(self.columns)

Callers

nothing calls this directly

Calls 1

meta_frame_constructorFunction · 0.90

Tested by

no test coverage detected