I would suggest something along `np.where(np.isnan(obj), "NaN", obj)`.