Return a subcolumn. The resulting column will share the same storage as this column so this operation is quite efficient. If the current column is also a sub-column (i.e., the index tensor is not None), the current index tensor will be sliced by 'rowids', if they are
(self, rowids)
| 430 | return Column(F.clone(self.data), copy.deepcopy(self.scheme)) |
| 431 | |
| 432 | def subcolumn(self, rowids): |
| 433 | """Return a subcolumn. |
| 434 | |
| 435 | The resulting column will share the same storage as this column so this operation |
| 436 | is quite efficient. If the current column is also a sub-column (i.e., |
| 437 | the index tensor is not None), the current index tensor will be sliced |
| 438 | by 'rowids', if they are on the same context. Otherwise, both index |
| 439 | tensors are saved, and only applied when the data is accessed. |
| 440 | |
| 441 | Parameters |
| 442 | ---------- |
| 443 | rowids : Tensor |
| 444 | Row IDs. |
| 445 | |
| 446 | Returns |
| 447 | ------- |
| 448 | Column |
| 449 | Sub-column |
| 450 | """ |
| 451 | if self.index is None: |
| 452 | return Column( |
| 453 | self.storage, |
| 454 | self.scheme, |
| 455 | rowids, |
| 456 | self.device, |
| 457 | self.deferred_dtype, |
| 458 | ) |
| 459 | else: |
| 460 | index = self.index |
| 461 | if not isinstance(index, _LazyIndex): |
| 462 | index = _LazyIndex(self.index) |
| 463 | index = index.slice(rowids) |
| 464 | return Column( |
| 465 | self.storage, |
| 466 | self.scheme, |
| 467 | index, |
| 468 | self.device, |
| 469 | self.deferred_dtype, |
| 470 | ) |
| 471 | |
| 472 | @staticmethod |
| 473 | def create(data): |