-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: inconsistent None handling for ISO and non-ISO formats #50071
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
@mroeschke do you have thoughts on which is correct? |
i think id expect both to be NaT and both to be DatetimeIndex |
I don't think DatetimeIndex is possible with mixed offsets, is it? (note how the strings have different offsets) |
didnt notice that, you're right |
Should the Since there's an implicit |
yeah it's tested here pandas/pandas/tests/tools/test_to_datetime.py Lines 1343 to 1363 in 8da8743
I just think
|
I guess in that particular example I haven't looked at mixed-argument
|
Agreed with your conclusions |
Not sure it should depend on whether or not
Note that with PDEP4, it'll always behave as if |
Ah okay I like those guidelines then. |
looks like the example you used is the same as from #40111, so a PR that addresses this may close that |
Resolved by #50242 |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
In the first (ISO) case,
None
staysNone
. But in the second (non-ISO) case,None
becomesNaT
.Expected Behavior
@jbrockmendel any thoughts on what should be correct?
I think I'd prefer the latter (just change to
NaT
)Installed Versions
INSTALLED VERSIONS
commit : 8dab54d
python : 3.8.15.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.102.1-microsoft-standard-WSL2
Version : #1 SMP Wed Mar 2 00:30:59 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.5.2
numpy : 1.23.5
pytz : 2022.6
dateutil : 2.8.2
setuptools : 65.5.1
pip : 22.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.6.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None
None
The text was updated successfully, but these errors were encountered: