-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
apply changes the datatypes: strange behaviour/bug? #8660
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
Comments
in the future, pls post a simple self-reproducing example. It makes it easier to see what is the problem. |
Mhh so what if I need to have an operation that checks/sets the holidays? I have to use apply somehow.. (sorry for the usage question, but it seems almost a bug to me, if not documented) |
why/how are you using apply? |
Mhh because I need to compare all the dates one by one Sent from my iPhone
|
and exactly how are you doing that? |
Something naive like this:
But of course pandas converts me the dates in UTC, so everything is wrong. http://stackoverflow.com/questions/26593908/how-to-set-holidays-with-pandas-in-a-timezone-aware-way |
Well not sure what you are expecting as output, but that is not going to work. (and will be as slow as can be) try something like this to set the holidays to
See here: You might want to create a custom business index with holidays to handle this. Apply on object by definition tries to convert. At some point timezone-aware will be supported fully, so this is not preservable at the moment., see #8260 As a further comment. Using DST in dates is really odd when dealing with DAILY holidays. I have never seen this done, thought I guess conceptually it should work. Prob better to attach the tz after. Against because it doesn't matter for the holiday determination. |
thanks!! |
Hello. I tried to apply a function to a dataframe and it changes the column types. See this example: http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/1118905/Calls-bug.ipynb
Am I doing something wrong? Is it a bug?
pandas 0.15.0
The text was updated successfully, but these errors were encountered: