question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: option to set week starting on Sunday instead of Monday

See original GitHub issue

Problem description

Currently, calling pd.Series.dt.weekday returns Monday = 0, Sunday = 6. It would be nice to have a settable option that allows Sunday to be the beginning of the week, e.g.

my_series.dt.weekday  # Monday = 0, Sunday = 6
pd.options.week_start = 'Sunday'
my_series.dt.weekday  # Sunday = 0, Saturday = 6

Pandas version 1.0.1.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
guidopetricommented, Feb 14, 2020

It is an easy workaround - but pandas is all about convenience, right? 😉

Here’s what I’m currently doing:

pd.Series.replace(6, -1, inplace=True)
0reactions
guidopetricommented, Feb 16, 2020

You’re correct in that date.weekday() returns the same output as pandas currently does - however, datetime also allows for strftime() to be called with %w for Sunday-first (or compare %W and %U). Is this the recommended route when dealing with pandas datetimes, too? It seems silly to convert to string then back for a library meant for efficiency, but I’ll accept it as long as it works…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the first day of the week in my calendar
Step 3. Under the "First Day Of The Week" select your first day of the week to be Monday or Sunday according to...
Read more >
Change Week Start Date - Lose It! Support
There's no way to adjust the weekly start day within Lose It!. For example, you cannot edit the program to start your week...
Read more >
Ability to define the start of the week like Outlook Calendar
I define my start of week as Monday instead of Sunday, ... Feature Request: Ability to define the start of the week like...
Read more >
Weeks start on Sunday, not Monday - Visual Studio Feedback
I agree that this is set up incorrectly . Monday should be the default value of the week start for non-US countries. The...
Read more >
Change first day of week to MONDAY, instead of SUNDAY
Hello! I found that in 2015 there was a request to give users option when the week should begin. In some countries it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found