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

Method __array_wrap__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

meta_frame_constructorFunction · 0.90

Tested by

no test coverage detected