Giter Club home page Giter Club logo

Comments (10)

jorisvandenbossche avatar jorisvandenbossche commented on August 24, 2024 1

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.

jorisvandenbossche avatar jorisvandenbossche commented on August 24, 2024

cc @pandas-dev/pandas-core

from pandas.

WillAyd avatar WillAyd commented on August 24, 2024

This sounds reasonable and I think could help simplify the implementation

from pandas.

bashtage avatar bashtage commented on August 24, 2024

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.

Pranav-Wadhwa avatar Pranav-Wadhwa commented on August 24, 2024

take

from pandas.

Pranav-Wadhwa avatar Pranav-Wadhwa commented on August 24, 2024

Based on discussions, I will update to_datetime to always use nanoseconds in the given scenarios.

from pandas.

Pranav-Wadhwa avatar Pranav-Wadhwa commented on August 24, 2024

@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.

WillAyd avatar WillAyd commented on August 24, 2024

@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.

jbrockmendel avatar jbrockmendel commented on August 24, 2024

Iā€™m fine with OP suggestion as long as we are internally consistent, I.e. Timestamp constructor

from pandas.

Pranav-Wadhwa avatar Pranav-Wadhwa commented on August 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.