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,
)
| 5475 | |
| 5476 | |
| 5477 | def concat( |
| 5478 | dfs, |
| 5479 | axis=0, |
| 5480 | join="outer", |
| 5481 | ignore_unknown_divisions=False, |
| 5482 | ignore_order=False, |
| 5483 | interleave_partitions=False, |
| 5484 | **kwargs, |
| 5485 | ): |
| 5486 | """Concatenate DataFrames along rows. |
| 5487 | |
| 5488 | - When axis=0 (default), concatenate DataFrames row-wise: |
| 5489 | |
| 5490 | - If all divisions are known and ordered, concatenate DataFrames keeping |
| 5491 | divisions. When divisions are not ordered, specifying |
| 5492 | interleave_partition=True allows concatenate divisions each by each. |
| 5493 | |
| 5494 | - If any of division is unknown, concatenate DataFrames resetting its |
| 5495 | division to unknown (None) |
| 5496 | |
| 5497 | - When axis=1, concatenate DataFrames column-wise: |
| 5498 | |
| 5499 | - Allowed if all divisions are known. |
| 5500 | |
| 5501 | - If any of division is unknown, it raises ValueError. |
| 5502 | |
| 5503 | Parameters |
| 5504 | ---------- |
| 5505 | dfs : list |
| 5506 | List of dask.DataFrames to be concatenated |
| 5507 | axis : {0, 1, 'index', 'columns'}, default 0 |
| 5508 | The axis to concatenate along |
| 5509 | join : {'inner', 'outer'}, default 'outer' |
| 5510 | How to handle indexes on other axis |
| 5511 | interleave_partitions : bool, default False |
| 5512 | Whether to concatenate DataFrames ignoring its order. If True, every |
| 5513 | divisions are concatenated each by each. |
| 5514 | ignore_unknown_divisions : bool, default False |
| 5515 | By default a warning is raised if any input has unknown divisions. |
| 5516 | Set to True to disable this warning. |
| 5517 | ignore_order : bool, default False |
| 5518 | Whether to ignore order when doing the union of categoricals. |
| 5519 | |
| 5520 | Notes |
| 5521 | ----- |
| 5522 | This differs in from ``pd.concat`` in the when concatenating Categoricals |
| 5523 | with different categories. Pandas currently coerces those to objects |
| 5524 | before concatenating. Coercing to objects is very expensive for large |
| 5525 | arrays, so dask preserves the Categoricals by taking the union of |
| 5526 | the categories. |
| 5527 | |
| 5528 | Examples |
| 5529 | -------- |
| 5530 | If all divisions are known and ordered, divisions are kept. |
| 5531 | |
| 5532 | >>> import dask.dataframe as dd |
| 5533 | >>> a # doctest: +SKIP |
| 5534 | dd.DataFrame<x, divisions=(1, 3, 5)> |