Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
BUG: .diff() function for UTC datetimes doesn't work #18578
This worked in pandas 0.20.3. For some reason in pandas 0.21 and greater the to_datetime() is now providing a 'datetime64[ns, UTC]' which doesn't play well with diff() when called from the DataFrame. When called from the Series it works fine.
I don't really have an opinion on which dtype is used. In fact the dtypes seem more "correct" in 0.21 than in 0.20.3. I just want diff() to work when using a datetime64[ns, UTC] the same way it does for a datetime64[ns] when called from a DataFrame. It works when called from a Series so this seems like a bug.