| 486 | raise ValueError(f"axis must be None, 0 or 1") |
| 487 | |
| 488 | def mean(self, axis=None, dtype=None, out=None): |
| 489 | assert out is None and dtype is None, "`out` is just for compatible with numpy's aggregating function" |
| 490 | # FIXME: weird logic and not general |
| 491 | if axis is None: |
| 492 | return np.nanmean(self.data) |
| 493 | elif axis == 0: |
| 494 | tmp_data = np.nanmean(self.data, axis=0) |
| 495 | return SingleData(tmp_data, self.columns) |
| 496 | elif axis == 1: |
| 497 | tmp_data = np.nanmean(self.data, axis=1) |
| 498 | return SingleData(tmp_data, self.index) |
| 499 | else: |
| 500 | raise ValueError(f"axis must be None, 0 or 1") |
| 501 | |
| 502 | def isna(self): |
| 503 | return self.__class__(np.isnan(self.data), *self.indices) |