COMPAT: datetime.date comparisons with datetime64[ns]
See original GitHub issueThis should probably work
In [16]: df = pd.DataFrame({'A':[pd.Timestamp('20130101'), np.nan]})
In [17]: df
Out[17]:
A
0 2013-01-01
1 NaT
In [18]: pd.Timestamp('20130101').to_pydatetime()>=df.A
Out[18]:
0 True
1 False
Name: A, dtype: bool
In [20]: pd.Timestamp('20130101').to_pydatetime().date()>=df.A
ValueError: cannot set a Timestamp with a non-timestamp
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Comparison between datetime and datetime64[ns] in pandas
I'm writing a program that checks an excel file and if today's date is in the excel file's date column ...
Read more >TypeError: Invalid comparison between dtype=datetime64[ns ...
Pandas : Python: TypeError: Invalid comparison between dtype= datetime64[ns ] and date [ Beautify Your Computer ...
Read more >Time Series / Date functionality — pandas 0.23.0 documentation
to_datetime looks for standard designations of the datetime component in the column names, including: required: year , month , day; optional: hour , ......
Read more >Datetimes and Timedeltas — NumPy v1.24 Manual
The most basic way to create datetimes is from strings in ISO 8601 date or datetime format. ... The datetime type works with...
Read more >Python Datetime Vs. NumPy Datetime: 8 Differences You ...
Data Representation. Native Python and NumPy both follow different formats to store date-time attributes. The Python datetime format stores data as a group...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
These just need wrapping
I think a MCVE for @liuli1735 's post is this
Result with
0.20.3-py27_1
on conda-forge (linux64 python2.7)Result with
0.21.0-py27_0
on conda-forge (linux64 python2.7)