Return a copy of this dataset with some fields renamed.
(self, field_map: Mapping[str, str])
| 233 | return self.sample(n=len(self), seed=seed) |
| 234 | |
| 235 | def remap(self, field_map: Mapping[str, str]): |
| 236 | """Return a copy of this dataset with some fields renamed.""" |
| 237 | new_spec = utils.remap_dict(self.spec(), field_map) |
| 238 | new_examples = [utils.remap_dict(ex, field_map) for ex in self.examples] |
| 239 | return Dataset(new_spec, new_examples, base=self) |
| 240 | |
| 241 | @staticmethod |
| 242 | def lit_example_from_bytes(input_bytes: bytes) -> Optional[JsonDict]: |