Commit 4001a5d
authored
Bug fix for Rank and WMA operators (#1228)
* bug fix: 1) 100 should be used to scale down percentileofscore return to 0-1, not length of array; 2) for (linear) weighted MA(n), weight should be n, n-1, ..., 1 instead of n-1, ..., 0
* use native pandas fucntion for rank
* remove useless import
* require pandas 1.4+
* rank for py37+pandas 1.3.5 compatibility
* lint improvement
* lint black fix
* use hasattr instead of version to check whether rolling.rank is implemented1 parent ff2154c commit 4001a5d
1 file changed
+9
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 217 | + | |
222 | 218 | | |
223 | 219 | | |
224 | 220 | | |
| |||
241 | 237 | | |
242 | 238 | | |
243 | 239 | | |
244 | | - | |
245 | | - | |
246 | 240 | | |
247 | 241 | | |
248 | 242 | | |
| |||
1155 | 1149 | | |
1156 | 1150 | | |
1157 | 1151 | | |
| 1152 | + | |
1158 | 1153 | | |
1159 | 1154 | | |
1160 | | - | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1161 | 1159 | | |
1162 | 1160 | | |
1163 | 1161 | | |
1164 | 1162 | | |
1165 | 1163 | | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | | - | |
| 1166 | + | |
1169 | 1167 | | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
| 1168 | + | |
1175 | 1169 | | |
1176 | 1170 | | |
1177 | 1171 | | |
| |||
1341 | 1335 | | |
1342 | 1336 | | |
1343 | 1337 | | |
1344 | | - | |
| 1338 | + | |
1345 | 1339 | | |
1346 | 1340 | | |
1347 | 1341 | | |
| |||
0 commit comments