why using numpy? It is a big dependency just for nan value. Python have native nan with : float('nan')