A higher-level wrapper over `factorize_from_iterable`. Parameters ---------- iterables : list-like of list-likes Returns ------- codes : list of ndarrays categories : list of Indexes Notes ----- See `factorize_from_iterable` for more info.
(iterables)
| 3155 | |
| 3156 | |
| 3157 | def factorize_from_iterables(iterables) -> tuple[list[np.ndarray], list[Index]]: |
| 3158 | """ |
| 3159 | A higher-level wrapper over `factorize_from_iterable`. |
| 3160 | |
| 3161 | Parameters |
| 3162 | ---------- |
| 3163 | iterables : list-like of list-likes |
| 3164 | |
| 3165 | Returns |
| 3166 | ------- |
| 3167 | codes : list of ndarrays |
| 3168 | categories : list of Indexes |
| 3169 | |
| 3170 | Notes |
| 3171 | ----- |
| 3172 | See `factorize_from_iterable` for more info. |
| 3173 | """ |
| 3174 | if len(iterables) == 0: |
| 3175 | # For consistency, it should return two empty lists. |
| 3176 | return [], [] |
| 3177 | |
| 3178 | codes, categories = zip( |
| 3179 | *(factorize_from_iterable(it) for it in iterables), |
| 3180 | strict=True, |
| 3181 | ) |
| 3182 | return list(codes), list(categories) |
no test coverage detected