Comments (10)
I think could help simplify the implementation
I don't think it will simplify things generally, because we still need the current inference logic when the default unit does not fit, but from looking a bit into it, I also don't think it should make the code much more complex.
from pandas.
cc @pandas-dev/pandas-core
from pandas.
This sounds reasonable and I think could help simplify the implementation
from pandas.
I think this would be an improvement. Seems like a good idea that anyone working with human times (say down to second precision) with a range of the modern era would get the same basis for the timestamp.
from pandas.
take
from pandas.
Based on discussions, I will update to_datetime
to always use nanoseconds in the given scenarios.
from pandas.
@jorisvandenbossche would updating the to_datetime
function to accept a default unit='ns'
be a feasible solution for this? Or are there cases where it wouldn't make sense to default to nanoseconds?
from pandas.
@Pranav-Wadhwa nanoseconds is what we used previously, so I don't think we want to go back to that. The OP suggests microseconds as a default resolution, although I'm not sure its as simple as changing the to_datetime signature either.
Before diving into the details I think should get some more agreement from the pandas core team. @jbrockmendel is our datetime guru so let's see if he has any thoughts first
from pandas.
Iām fine with OP suggestion as long as we are internally consistent, I.e. Timestamp constructor
from pandas.
@jbrockmendel what do you mean by timestamp constructor? If we set the default value of unit='us'
in to_datetime
, it resolves the example that the OP mentioned but would require changing many test cases in tests/tools/test_to_datetime.py
.
from pandas.
Related Issues (20)
- BUG: merging DataFrames on a column containing just NaN values triggers address violation in `safe_sort` HOT 4
- BUG: UnboundLocalError when full outer merging two dataframes HOT 3
- Python 3.13 wheel builds are failing HOT 2
- BUG: Inconsistent behavior between `.any` and `.all` with missing values HOT 1
- BUG: stacked bar graphs show invalid label position due to invalid rectangle bottom when data is 0 HOT 9
- BUG: `isna` on pyarrow backed Series is returning Series with `bool` dtype instead of `bool[pyarrow]` HOT 9
- BUG: dropna in pivot_table is not affecting the outcome
- BUG: pandas.DataFrame.plot crashes, if subplots argument receives a touple. HOT 3
- BUG: assert_frame_equal does not include the obj parameter in error when a MultiIndex is different HOT 4
- QST: How to use 'numba' for group by sum HOT 1
- BUG: Large XML files on Windows trigger false Encoding error HOT 2
- BUG: Series.replace(dict-like, dict-like) raises uninformative AttributeError HOT 1
- BUG: escapechar=',' Causes Double Commas in Output in Pandas 2.2.2 HOT 5
- DOC: fix docstring validation errors for `pandas.Timestamp` HOT 15
- DOC: Development on Gitpod have problems HOT 1
- BUG: Ability to set both color and style in pandas plotting HOT 2
- Title: Feature Request: Improve diff Function to Support Forward and Backward CompletionENH: HOT 2
- Title: Feature Request: Improve diff Function to Support Forward and Backward CompletionENH: HOT 2
- Bug in Chunk Processing: Non-NULL IDs Become NULL During IterationBUG: HOT 2
- ENH: Add Float128 support for groupby. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandas.