Returns the weighted average of the Array elements.
(self, weights=None)
| 192 | return sum(self) / self.size |
| 193 | |
| 194 | def average(self, weights=None): |
| 195 | """ Returns the weighted average of the Array elements. """ |
| 196 | if weights is None: |
| 197 | return sum(self) / self.size |
| 198 | else: |
| 199 | return sum(self.mul(weights)) / sum(weights) |
| 200 | |
| 201 | def floor(self, inplace=False): |
| 202 | """ Floors the Array elements. """ |