0d arrays are caught before this function and thrown into nanmeans so the logic does not need to be duplicated