Compute this dask collection This turns a lazy Dask collection into its in-memory equivalent. For example a Dask array turns into a NumPy array and a Dask dataframe turns into a Pandas dataframe. The entire dataset must fit into memory before calling this operation.
(self, **kwargs)
| 351 | return result |
| 352 | |
| 353 | def compute(self, **kwargs): |
| 354 | """Compute this dask collection |
| 355 | |
| 356 | This turns a lazy Dask collection into its in-memory equivalent. |
| 357 | For example a Dask array turns into a NumPy array and a Dask dataframe |
| 358 | turns into a Pandas dataframe. The entire dataset must fit into memory |
| 359 | before calling this operation. |
| 360 | |
| 361 | Parameters |
| 362 | ---------- |
| 363 | scheduler : string, optional |
| 364 | Which scheduler to use like "threads", "synchronous" or "processes". |
| 365 | If not provided, the default is to check the global settings first, |
| 366 | and then fall back to the collection defaults. |
| 367 | optimize_graph : bool, optional |
| 368 | If True [default], the graph is optimized before computation. |
| 369 | Otherwise the graph is run as is. This can be useful for debugging. |
| 370 | kwargs |
| 371 | Extra keywords to forward to the scheduler function. |
| 372 | |
| 373 | See Also |
| 374 | -------- |
| 375 | dask.compute |
| 376 | """ |
| 377 | (result,) = compute(self, traverse=False, **kwargs) |
| 378 | return result |
| 379 | |
| 380 | def __await__(self): |
| 381 | try: |