Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
DataFrame.apply adds a frequency to a freq=None DatetimeIndex as a side-effect #22150
Code Sample, a copy-pastable example if possible
This particular index (found by hypothesis) suddenly gains a frequency it is used in a DataFrame, with >= 2 columns, which goes on to call ".apply".
for all n.
Yes. I have reduced the conditions to the following:
One example is
Thanks @dycw. I can reproduce with a similar example:
#14927 may be playing a role here somewhere. Investigation and PR' are always welcome!
I have been looking at the example of @mroeschke. The setting of the frequency takes place in pandas.core.apply.FrameRowApply when wrapping the results with wrap_results_for_axis(). This calls self.obj._constructor, which returns a results object with freq='WOM-4FRI' instead of the original freq='None' that went inside.