Strange and possibly buggy behaviour when using series.dt with series.apply(strftime) #12793
Labels
Duplicate Report
Duplicate issue or pull request
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Timezones
Timezone data dtype
It seems like Series.dt timezone properties to not interact well with series.apply(lambda x : x.strftime("..")) leading to some odd behaviour. Here is a script demonstrating the problem:
Which yields the output
In which the application of the format string using apply caused the times to revert to UTC (Compare the hours in Formatted vs Converted), whereas I expected to get output similar to the "Using pytz" column, where I have displayed the time in local time with no timezone adjustment.
Is this expected behaviour? Can I format to a string directly through Series.dt?
The text was updated successfully, but these errors were encountered: