🐻❄️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hiplot as hip | |
| hip.Experiment.from_iterable(hiplt_data).display() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from operator import add | |
| def generate_sierpinski_triangle(n: int): | |
| sierpinski_triangle = [] # final list of points | |
| # initial points | |
| A = (0.0, 0.0) | |
| B = (0.5, 1.0) | |
| C = (1.0, 0.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import matplotlib.animation as animation | |
| def make_animation(sierpinski_triangle: list): | |
| num_points = len(sierpinski_triangle) | |
| points_split = list(zip(*sierpinski_triangle)) | |
| xx, yy = points_split[0], points_split[1] | |
| fig = plt.figure(figsize=(10, 10)) | |
| def init(): |
OlderNewer