| 1254 | |
| 1255 | |
| 1256 | class Count(Reduction): |
| 1257 | _parameters = ["frame", "numeric_only", "split_every"] |
| 1258 | _defaults = {"split_every": False, "numeric_only": False} |
| 1259 | reduction_chunk = M.count |
| 1260 | |
| 1261 | @classmethod |
| 1262 | def reduction_aggregate(cls, df): |
| 1263 | return df.sum().astype("int64") |
| 1264 | |
| 1265 | @property |
| 1266 | def chunk_kwargs(self): |
| 1267 | if self.frame._meta.ndim < 2: |
| 1268 | return dict() |
| 1269 | else: |
| 1270 | return dict(numeric_only=self.numeric_only) |
| 1271 | |
| 1272 | |
| 1273 | class IndexCount(Reduction): |