Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Dates estimator using Python

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

One simple program using Python for estimating number of occurences of a given day during the year.

  • use this program if you want to estimate a specific day of a given year.
  • in our program we'll try to guess all fridays of the year 2019
  • Refer to for the program and to for a solution

Getting Started

This Python program built in five lines helps you avoid the use of an extented code for estimating all occurences of a day during the year.

  • (#) and (''') are used to comment the following gist.


I am using Jupyter Notebook on localhost (Ubuntu 18.04 bionic).
Make sure to have Jupyter Notebook installed on your operating system or launch it on remote servers (see Tips).


If you are not using Linux/Unix and still want to try this simple Python program:

Basic commands in Jupyter Notebook

  • Note that in Jupyter you add new lines by typing "b" from your keyboard whilst the notebook is opened.
  • Avoid runing the entire code in a single cell in order to understand the steps.
  • Use "ctrl + enter" to execute each line if you want to get the output.
  • Use "dd" outside a cell to delete it.
  • Use "a" outside a cell to add a new cell above it.
  • Use "b" outside as cell to add a new cell below it.
  • Running the last cell should execute the permutations as program output.

Whilst your Python Notebook is open... Use this line of code in your first cell

import pandas as pd

This loads requested package
and library in your notebook

Use this lines of code in your second cell

def allfridays(year):
    return pd.date_range(start=str(year), end=str(year+1),


This will print out all fridays of the year 2019. Note that we've set the program to run on 52 weeks of a regular year. You can set the program to any number of weeks or to another year.

Running the tests

  • I used Ubuntu (18.04 bionic) to launch Jupyter Notebook on localhost.
  • Localhost instantiates while using $ jupyter notebook in the terminal.
  • Check if Jupyter is correctly installed: $ jupyter --version

Built With

  • Jupyter - An open source software for creating notebooks
  • Pandas - A high-level data manipulation tool developed by Wes McKinney


I used no vesioning system for this gist, which repos status is flagged as concept because it is intended to be a demo or POC (proof-of-concept).


  • Isaac Arnault - Suggesting a minified code from Initial work zhenyi2697


All public gists
Copyright 2018, Isaac Arnault
MIT License,


Write a simple Python programm that outputs:

  • full date and time of the current day (as shown by your Linux shell using $ date)
  • current year
  • current month
  • current week number
  • current day in the current week


Dates estimator using Python







No releases published


No packages published