Skip to content
Advertisement

Create a dataframe containing all weekends in a given year

Good afternoon,

I would like to create a function that, given a year, would return a dataframe with all the dates in Timestamp format related to the Saturdays and Sundays of that year. That is to say:

JavaScript

The function would return:

JavaScript

If you can tell me an optimal way to get that dataframe I would be grateful.

Advertisement

Answer

Well here’s my finished code. I think yours wasn’t working because you didn’t write anything.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement