Update alternative solutions with sliding_window_view (NumPy >= 1.20.0).
Before: `threshold=np.nan` After : `threshold=float("inf")` `np.nan` may fail in latest version.