Concatenate, handling some edge cases: - Unions categoricals between partitions - Ignores empty partitions Parameters ---------- dfs : list of DataFrame, Series, or Index axis : int or str, optional join : str, optional uniform : bool, optional Whether to tr
(
dfs,
axis=0,
join="outer",
uniform=False,
filter_warning=True,
ignore_index=False,
**kwargs,
)
| 32 | |
| 33 | |
| 34 | def concat( |
| 35 | dfs, |
| 36 | axis=0, |
| 37 | join="outer", |
| 38 | uniform=False, |
| 39 | filter_warning=True, |
| 40 | ignore_index=False, |
| 41 | **kwargs, |
| 42 | ): |
| 43 | """Concatenate, handling some edge cases: |
| 44 | |
| 45 | - Unions categoricals between partitions |
| 46 | - Ignores empty partitions |
| 47 | |
| 48 | Parameters |
| 49 | ---------- |
| 50 | dfs : list of DataFrame, Series, or Index |
| 51 | axis : int or str, optional |
| 52 | join : str, optional |
| 53 | uniform : bool, optional |
| 54 | Whether to treat ``dfs[0]`` as representative of ``dfs[1:]``. Set to |
| 55 | True if all arguments have the same columns and dtypes (but not |
| 56 | necessarily categories). Default is False. |
| 57 | ignore_index : bool, optional |
| 58 | Whether to allow index values to be ignored/dropped during |
| 59 | concatenation. Default is False. |
| 60 | ignore_order : bool, optional |
| 61 | Whether to ignore the order when doing the union of categoricals. |
| 62 | Default is False. |
| 63 | """ |
| 64 | if len(dfs) == 1: |
| 65 | return dfs[0] |
| 66 | else: |
| 67 | func = concat_dispatch.dispatch(type(dfs[0])) |
| 68 | return func( |
| 69 | dfs, |
| 70 | axis=axis, |
| 71 | join=join, |
| 72 | uniform=uniform, |
| 73 | filter_warning=filter_warning, |
| 74 | ignore_index=ignore_index, |
| 75 | **kwargs, |
| 76 | ) |
| 77 | |
| 78 | |
| 79 | def is_categorical_dtype(obj): |
no test coverage detected
searching dependent graphs…