Create a Dask partition for either a DataFrame or Series. Designed to be used with :func:`dask.blockwise.blockwise`. ``data`` is the array from which the partition will be created. ``index`` can be: 1. ``None``, in which case each partition has an independent RangeIndex 2. a `tuple
(data, index=None, initializer=None, **kwargs)
| 80 | |
| 81 | |
| 82 | def _partition_from_array(data, index=None, initializer=None, **kwargs): |
| 83 | """Create a Dask partition for either a DataFrame or Series. |
| 84 | |
| 85 | Designed to be used with :func:`dask.blockwise.blockwise`. ``data`` is the array |
| 86 | from which the partition will be created. ``index`` can be: |
| 87 | |
| 88 | 1. ``None``, in which case each partition has an independent RangeIndex |
| 89 | 2. a `tuple` with two elements, the start and stop values for a RangeIndex for |
| 90 | this partition, which gives a continuously varying RangeIndex over the |
| 91 | whole Dask DataFrame |
| 92 | 3. an instance of a ``pandas.Index`` or a subclass thereof |
| 93 | |
| 94 | The ``kwargs`` _must_ contain an ``initializer`` key which is set by calling |
| 95 | ``type(meta)``. |
| 96 | """ |
| 97 | if isinstance(index, tuple): |
| 98 | index = pd.RangeIndex(*index) |
| 99 | return initializer(data, index=index, **kwargs) |
| 100 | |
| 101 | |
| 102 | def from_dask_array(x, columns=None, index=None, meta=None): |
nothing calls this directly
no outgoing calls
no test coverage detected