-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
where() corrupts tz-aware datetime column data #15701
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
Interesting...
|
these prob pass thru a float conversion; these should be handled in the Block better. |
https://github.com/pandas-dev/pandas/blob/master/pandas/core/internals.py#L2443 needs a |
if anyone wants to do a PR, pls do! |
@jreback I can take a stab at this tonight. |
…andas-dev#15701) closes pandas-dev#15701 Author: Christopher C. Aycock <[email protected]> Closes pandas-dev#15711 from chrisaycock/GH15701 and squashes the following commits: b77f5ed [Christopher C. Aycock] BUG: TZ-aware Series.where() appropriately handles default other=nan (pandas-dev#15701)
…andas-dev#15701) closes pandas-dev#15701 Author: Christopher C. Aycock <[email protected]> Closes pandas-dev#15711 from chrisaycock/GH15701 and squashes the following commits: b77f5ed [Christopher C. Aycock] BUG: TZ-aware Series.where() appropriately handles default other=nan (pandas-dev#15701)
Code Sample, a copy-pastable example if possible
Problem description
receive
0 NaT
1 2016-12-31 12:00:04.009999872+00:00
seems similar to #14872, which I also ran into.
works as expected if you do: s.where(p, other=pd.NaT)
Expected Output
I would expect:
0 NaT
1 2016-12-31 12:00:04.010000+00:00
Output of
pd.show_versions()
pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.2
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.9.3
lxml: None
bs4: 4.5.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.9.4
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: