-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Series (but not DataFrame) combine_first() loses timezone information #21469
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
I'm +1 for consistency. Investigation and PR are welcome! |
Hmm.. looks like this might be the result of a more general issue with
|
Actually it looks like there where issue might only be tangentially related... |
If I were to guess, this may be a problem in the pandas/pandas/core/internals.py Line 1449 in 5fbb683
In general, data is operated as numpy arrays and therefore tz information will be discarded (and not appropriated considered when remerging data) |
Code Sample, a copy-pastable example if possible
Problem description
Calling
Series.combine_first
on two tz-localized datetime Series returns a non-localized Series.#10567 handled the case when running
DataFrame.combine_first
on DataFrames with datetime tz columns. Oddly, this does not work for Series. This behavior is the same under at least both 0.19.2 and latest master so it appears it may never have been fixed with #10567.Output of
pd.show_versions()
pandas: 0.24.0.dev0+103.g576d5c6b7
pytest: 3.6.0
pip: 10.0.1
setuptools: 39.2.0
Cython: 0.28.3
numpy: 1.14.2
scipy: 1.0.0
pyarrow: 0.8.0
xarray: 0.10.6
IPython: 6.4.0
sphinx: 1.7.5
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: 1.2.1
tables: 3.4.3
numexpr: 2.6.4
feather: 0.4.0
matplotlib: 2.2.2
openpyxl: 2.5.3
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.0.5
lxml: 4.1.1
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.8
pymysql: 0.8.1
psycopg2: None
jinja2: 2.10
s3fs: 0.1.5
fastparquet: 0.1.5
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: