Concatenate DataFrames along rows. - When axis=0 (default), concatenate DataFrames row-wise: - If all divisions are known and ordered, concatenate DataFrames keeping divisions. When divisions are not ordered, specifying interleave_partition=True allows concatenate divisio
(
dfs,
axis=0,
join="outer",
ignore_unknown_divisions=False,
ignore_order=False,
interleave_partitions=False,
**kwargs,
)
| 5440 | |
| 5441 | |
| 5442 | def concat( |
| 5443 | dfs, |
| 5444 | axis=0, |
| 5445 | join="outer", |
| 5446 | ignore_unknown_divisions=False, |
| 5447 | ignore_order=False, |
| 5448 | interleave_partitions=False, |
| 5449 | **kwargs, |
| 5450 | ): |
| 5451 | """Concatenate DataFrames along rows. |
| 5452 | |
| 5453 | - When axis=0 (default), concatenate DataFrames row-wise: |
| 5454 | |
| 5455 | - If all divisions are known and ordered, concatenate DataFrames keeping |
| 5456 | divisions. When divisions are not ordered, specifying |
| 5457 | interleave_partition=True allows concatenate divisions each by each. |
| 5458 | |
| 5459 | - If any of division is unknown, concatenate DataFrames resetting its |
| 5460 | division to unknown (None) |
| 5461 | |
| 5462 | - When axis=1, concatenate DataFrames column-wise: |
| 5463 | |
| 5464 | - Allowed if all divisions are known. |
| 5465 | |
| 5466 | - If any of division is unknown, it raises ValueError. |
| 5467 | |
| 5468 | Parameters |
| 5469 | ---------- |
| 5470 | dfs : list |
| 5471 | List of dask.DataFrames to be concatenated |
| 5472 | axis : {0, 1, 'index', 'columns'}, default 0 |
| 5473 | The axis to concatenate along |
| 5474 | join : {'inner', 'outer'}, default 'outer' |
| 5475 | How to handle indexes on other axis |
| 5476 | interleave_partitions : bool, default False |
| 5477 | Whether to concatenate DataFrames ignoring its order. If True, every |
| 5478 | divisions are concatenated each by each. |
| 5479 | ignore_unknown_divisions : bool, default False |
| 5480 | By default a warning is raised if any input has unknown divisions. |
| 5481 | Set to True to disable this warning. |
| 5482 | ignore_order : bool, default False |
| 5483 | Whether to ignore order when doing the union of categoricals. |
| 5484 | |
| 5485 | Notes |
| 5486 | ----- |
| 5487 | This differs in from ``pd.concat`` in the when concatenating Categoricals |
| 5488 | with different categories. Pandas currently coerces those to objects |
| 5489 | before concatenating. Coercing to objects is very expensive for large |
| 5490 | arrays, so dask preserves the Categoricals by taking the union of |
| 5491 | the categories. |
| 5492 | |
| 5493 | Examples |
| 5494 | -------- |
| 5495 | If all divisions are known and ordered, divisions are kept. |
| 5496 | |
| 5497 | >>> import dask.dataframe as dd |
| 5498 | >>> a # doctest: +SKIP |
| 5499 | dd.DataFrame<x, divisions=(1, 3, 5)> |
searching dependent graphs…