made ts retrieval robuster since some versions of numpy do not support tuples as axis keyword for nanmean