We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2146f68 commit badeeecCopy full SHA for badeeec
1 file changed
turftopic/late.py
@@ -210,11 +210,13 @@ def unflatten_repr(
210
return repr
211
212
213
-def pool_flat(flat_repr: np.ndarray, lengths: Lengths, agg=np.mean):
+def pool_flat(flat_repr: np.ndarray, lengths: Lengths, agg=np.nanmean):
214
pooled = []
215
start_index = 0
216
for length in lengths:
217
- pooled.append(agg(flat_repr[start_index:length], axis=0))
+ pooled.append(
218
+ agg(flat_repr[start_index : start_index + length], axis=0)
219
+ )
220
start_index += length
221
return np.stack(pooled)
222
0 commit comments