MCPcopy
hub / github.com/dmlc/dgl / update_row

Method update_row

python/dgl/frame.py:794–816  ·  view source on GitHub ↗

Update the feature data of the given rows. If the data contains new keys (new columns) that do not exist in this frame, add a new column. The ``rowids`` shall not contain duplicates. Otherwise, the behavior is undefined. Parameters ----------

(self, rowids, data)

Source from the content-addressed store, hash-verified

792 self._columns[name] = col
793
794 def update_row(self, rowids, data):
795 """Update the feature data of the given rows.
796
797 If the data contains new keys (new columns) that do not exist in
798 this frame, add a new column.
799
800 The ``rowids`` shall not contain duplicates. Otherwise, the behavior
801 is undefined.
802
803 Parameters
804 ----------
805 rowids : Tensor
806 Row Ids.
807 data : dict[str, Tensor]
808 Row data.
809 """
810 for key, val in data.items():
811 if key not in self:
812 scheme = infer_scheme(val)
813 ctx = F.context(val)
814 self.add_column(key, scheme, ctx)
815 for key, val in data.items():
816 self._columns[key].update(rowids, val)
817
818 def _append(self, other):
819 """Append ``other`` frame to ``self`` frame."""

Callers 4

invoke_udf_reduceFunction · 0.95
mergeFunction · 0.80
_set_n_reprMethod · 0.80
_set_e_reprMethod · 0.80

Calls 5

add_columnMethod · 0.95
infer_schemeFunction · 0.85
contextMethod · 0.80
itemsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected