This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Flip a fair coin 100 times—it gives a sequence of heads (H) | |
and tails (T). For each HH in the sequence of flips, Alice | |
gets a point; for each HT, Bob does, so e.g. for the | |
sequence THHHT Alice gets 2 points and Bob gets 1 point. | |
Who is most likely to win? | |
https://x.com/littmath/status/1769044719034647001 |
This file contains 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
name: ori-py | |
channels: | |
- conda-forge | |
dependencies: | |
- python | |
- numpy | |
- scipy | |
- matplotlib | |
- jupyterlab | |
- pyvista |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 numpy as np | |
from numpy.polynomial import Polynomial | |
rng = np.random.default_rng() | |
x = np.arange(10) | |
y = np.arange(10) + 0.01*rng.standard_normal(10) | |
p_fitted = np.polynomial.Polynomial.fit(x, y, deg=1) |
This file contains 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
# -*- coding: utf-8 -*- | |
import matplotlib.pyplot as plt | |
from wordcloud import WordCloud, STOPWORDS | |
#%% | |
f = open('output_file.txt', 'r', encoding="utf8") | |
text = f.read() | |
f.close() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
from skimage import measure | |
y, x, z = np.mgrid[-2:2:100j, -2:2:100j, -2:2:100j] | |
f = (x**2 + 9/4*y**2 + z**2 - 1)**3 - x**2 * z**3 - 9/80*y**2*z**3 | |
verts, faces, _, _ = measure.marching_cubes(f, 0, spacing=(0.1, 0.1, 0.1)) | |
fig = plt.figure() |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Eigenvalues for matrices with random entries with values of 1 or -1 | |
@author: Nicolás Guarín-Zapata | |
@date: November 2022 | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt |
![nonstandard_fd.png](https://gist.github.com/nicoguaro/e2f030527ae92d9963727fb48fb1e769/raw/51b7f78094e39a96e786f09e6df50316defeb16d/nonstandard_fd.png)
![pumpkin.png](https://gist.github.com/nicoguaro/1c6a1ffc74c6fcb8a2bfe82d34b0e1ef/raw/a0ea59d3a9b771b9d3dc1210b8beca5f51810372/pumpkin.png)
NewerOlder