Commit 6060335
committed
Adjust constraints on ddof for var_axis and std_axis
Requiring `ddof` to not be < 0 allows us to ignore weird edge cases.
Allowing `ddof` to be equal to the length of the axis allows
computation of the population variance (`ddof` = 0) for a zero-length
axis and computation of the sample variance (`ddof` = 1) for an axis
of length one. (The result in these cases is an array of NaNs.)
Note that this is a breaking change because of the new constraint that
`ddof` must not be less than zero.1 parent 7d35df4 commit 6060335
2 files changed
+35
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
| 230 | + | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
814 | 821 | | |
815 | 822 | | |
816 | 823 | | |
817 | 824 | | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
818 | 833 | | |
819 | 834 | | |
820 | | - | |
821 | | - | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
822 | 839 | | |
823 | 840 | | |
824 | 841 | | |
| |||
830 | 847 | | |
831 | 848 | | |
832 | 849 | | |
833 | | - | |
834 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
835 | 854 | | |
836 | 855 | | |
837 | 856 | | |
| |||
0 commit comments