Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: groupby.transform ValueError: Could not convert object to NumPy datetime #15429

Closed
stephenrauch opened this issue Feb 16, 2017 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Groupby

Comments

@stephenrauch
Copy link
Contributor

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

@jreback
Copy link
Contributor

jreback commented Feb 17, 2017

this is a dupe of #10972

@jreback jreback closed this as completed Feb 17, 2017
@jreback jreback added the Duplicate Report Duplicate issue or pull request label Feb 17, 2017
@jreback jreback added this to the No action milestone Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Groupby
Projects
None yet
Development

No branches or pull requests

2 participants