skelouse / jupyter_multiplication_table

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncomment the below to enable extension, and install libraries

#!jupyter nbextension enable --py widgetsnbextension
#!pip install numpy pandas ipywidgets
from __future__ import print_function
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import pandas as pd
import numpy as np
@interact(size=list(range(1, 21)))
def main(size):
    if not isinstance(size, int):
        size = 12
    final = np.zeros((size, size))
    for i in range(size):
        for k in range(size):
            final[i, k] = ((i+1) * (k+1))
    display(pd.DataFrame(final.astype(int)))

img

About


Languages

Language:Jupyter Notebook 86.8%Language:Python 13.2%