NumPy-NaNs durch letzten Nicht-NaN-Wert ersetzen

Verwende bottleneck.push:

replace_nans_bottleneck.py
import bottleneck

y = bottleneck.push(y, axis=0)

Falls noch nicht installiert, kannst du bottleneck installieren mit

install_bottleneck.py
pip install bottleneck

Check out similar posts by category: Python