Split the block and apply func column-by-column. Parameters ---------- func : Block method *args **kwargs Returns ------- List[Block]
(self, func, *args, **kwargs)
| 402 | |
| 403 | @final |
| 404 | def split_and_operate(self, func, *args, **kwargs) -> list[Block]: |
| 405 | """ |
| 406 | Split the block and apply func column-by-column. |
| 407 | |
| 408 | Parameters |
| 409 | ---------- |
| 410 | func : Block method |
| 411 | *args |
| 412 | **kwargs |
| 413 | |
| 414 | Returns |
| 415 | ------- |
| 416 | List[Block] |
| 417 | """ |
| 418 | assert self.ndim == 2 and self.shape[0] != 1 |
| 419 | |
| 420 | res_blocks = [] |
| 421 | for nb in self._split(): |
| 422 | rbs = func(nb, *args, **kwargs) |
| 423 | res_blocks.extend(rbs) |
| 424 | return res_blocks |
| 425 | |
| 426 | # --------------------------------------------------------------------- |
| 427 | # Up/Down-casting |