-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame.merge error with empty frame and multiple datetime64[ns, UTC] columns #25014
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
Thanks for the report. iNaT should be a valid fill_value here as its passed internally? @jbrockmendel If so, this would be the fix:
|
This is a regression, so would be nice to include the fix in 0.24.1. @jbrockmendel the above is the correct fix? |
Disallowing iNaT was an intentional choice (I'd have to dig out the PR and preceeding discussion). Is passing NaT not an option? |
It's not the user that is doing this, but our algos code. So I think you are the best one placed to answer your question :-) |
Spoke a bit too fast: it is not directly the algos code, but |
I'll take a look at what breaks if |
@TomAugspurger you cannot fill an empty M8 array with it, as eg done here: pandas/pandas/core/internals/concat.py Lines 193 to 196 in b9f2e2b
|
Yes, so the answer to
is quite a lot :) I think changing it just before calling |
Code Sample, a copy-pastable example if possible
If there is no timezone specified it works as expected:
It also works if there is only one date column:
Problem description
It seems like the issue is that
iNaT
is being passed as thefill_value
rather thanNaT
.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-43-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: C.UTF-8
LANG: C.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.0
pytest: 4.1.1
pip: 18.1
setuptools: 40.6.3
Cython: 0.29.2
numpy: 1.15.4
scipy: None
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: 1.8.2
patsy: None
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: 4.3.0
bs4: None
html5lib: None
sqlalchemy: 1.2.16
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: