doctest the vectorize function
Merge pull request #1968 from thisch/doctest_vectorize

doctest the vectorize function