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

Method __array_wrap__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

meta_frame_constructorFunction · 0.90

Tested by

no test coverage detected