(self, to_replace: Dict[np.number, np.number])
| 449 | return self.__class__(tmp_data, *self.indices) |
| 450 | |
| 451 | def replace(self, to_replace: Dict[np.number, np.number]): |
| 452 | assert isinstance(to_replace, dict) |
| 453 | tmp_data = self.data.copy() |
| 454 | for num in to_replace: |
| 455 | if num in tmp_data: |
| 456 | tmp_data[self.data == num] = to_replace[num] |
| 457 | return self.__class__(tmp_data, *self.indices) |
| 458 | |
| 459 | def apply(self, func: Callable): |
| 460 | """apply a function to data.""" |