(self, other: SingleData, fill_value=0)
| 593 | return SingleData(tmp_data, index) |
| 594 | |
| 595 | def add(self, other: SingleData, fill_value=0): |
| 596 | # TODO: add and __add__ are a little confusing. |
| 597 | # This could be a more general |
| 598 | common_index = self.index | other.index |
| 599 | common_index, _ = common_index.sort() |
| 600 | tmp_data1 = self.reindex(common_index, fill_value) |
| 601 | tmp_data2 = other.reindex(common_index, fill_value) |
| 602 | return tmp_data1.fillna(fill_value) + tmp_data2.fillna(fill_value) |
| 603 | |
| 604 | def to_dict(self): |
| 605 | """convert SingleData to dict. |