Giter Club home page Giter Club logo

Comments (2)

iofall avatar iofall commented on July 3, 2024

Hi @yaoyuan12. The docstring for next_workday says that the function returns next workday used for observances. Hence it will always give the "next working day". You can use weekend_to_monday or next_monday to achieve your desired result.

However, I think the confusion arises from the docs defined here: https://pandas.pydata.org/docs/dev/user_guide/timeseries.html, where the next_workday is defined as move Saturday and Sunday to Monday which contradicts the docstring.

We could either update the docs or try to deprecate the functions that give similar outputs. What do you think @mroeschke?

from pandas.

yaoyuan12 avatar yaoyuan12 commented on July 3, 2024

Hm at the least based on the docs, weekend_to_monday is defined to be the same as next_workday, so that is definitely wrong.

I seem to have an impression that when I wrote the code, I checked and next_workday did indeed produce the same effect as weekend_to_monday, so was that code changed somewhen along the way? Or I could be dreaming.

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.