converts col numbers to names
(self, mapping)
| 304 | |
| 305 | @final |
| 306 | def _clean_mapping(self, mapping): |
| 307 | """converts col numbers to names""" |
| 308 | if not isinstance(mapping, dict): |
| 309 | return mapping |
| 310 | clean = {} |
| 311 | # for mypy |
| 312 | assert self.orig_names is not None |
| 313 | |
| 314 | for col, v in mapping.items(): |
| 315 | if isinstance(col, int) and col not in self.orig_names: |
| 316 | col = self.orig_names[col] |
| 317 | clean[col] = v |
| 318 | if isinstance(mapping, defaultdict): |
| 319 | remaining_cols = set(self.orig_names) - set(clean.keys()) |
| 320 | clean.update({col: mapping[col] for col in remaining_cols}) |
| 321 | return clean |
| 322 | |
| 323 | @final |
| 324 | def _agg_index(self, index) -> Index: |
no test coverage detected