Add or replace the column with the given name and data. Parameters ---------- name : str The column name. data : Column or data convertible to Column The column data.
(self, name, data)
| 770 | self._num_rows += num_rows |
| 771 | |
| 772 | def update_column(self, name, data): |
| 773 | """Add or replace the column with the given name and data. |
| 774 | |
| 775 | Parameters |
| 776 | ---------- |
| 777 | name : str |
| 778 | The column name. |
| 779 | data : Column or data convertible to Column |
| 780 | The column data. |
| 781 | """ |
| 782 | if isinstance(data, LazyFeature): |
| 783 | self._columns[name] = data |
| 784 | return |
| 785 | |
| 786 | col = Column.create(data) |
| 787 | if len(col) != self.num_rows: |
| 788 | raise DGLError( |
| 789 | "Expected data to have %d rows, got %d." |
| 790 | % (self.num_rows, len(col)) |
| 791 | ) |
| 792 | self._columns[name] = col |
| 793 | |
| 794 | def update_row(self, rowids, data): |
| 795 | """Update the feature data of the given rows. |
no test coverage detected