Problem description

As can be seen here, the error ValueError: Could not convert object to NumPy datetime is being thrown by:

df = DataFrame(dict(A=Timestamp('20130101'), B=np.arange(5)))
result = df.groupby('A')['A'].transform(lambda x: x.max() - x.min())

NOTE: I will be submitting a PR shortly.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.5.1.final.0 python-bits: 32 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel byteorder: little pandas: 0.19.2 nose: 1.3.7 pip: 8.1.2 setuptools: 18.2 Cython: None numpy: 1.12.0 dateutil: 2.6.0 pytz: 2016.6.1

Comment From: jreback

this is a dupe of #10972