1

I have a dataframe that generates from pd.pivot_table with columns having datetime.

I want to calculate the time difference along columns. So I used df.diff(axis=1). I got NotImplementedError.

I came across this pull request in Github: https://github.com/pandas-dev/pandas/pull/19773

I guess the problem has been solved? Why I still get NonImplementedError?

Data Sample: enter image description here Please ignore the "Text". Typo.

sophros
  • 14,672
  • 11
  • 46
  • 75
JOHN
  • 1,411
  • 3
  • 21
  • 41

1 Answers1

2

I tried to remove the timezone in datetime64[ns, UTC] columns. It works!

data['date'] = data['date'].dt.tz_convert(None)

JOHN
  • 1,411
  • 3
  • 21
  • 41
  • gosh, i appreciate the ability to work with timezones, but they really screw up all the formatting. i wish the default would have stayed at not having them. suddenly, CSV readings produce different outputs... :( – K.-Michael Aye Mar 27 '20 at 02:48