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 io | |
| import polars as pl | |
| new = """aiohappyeyeballs==2.6.1 | |
| aiohttp==3.12.13 | |
| aiosignal==1.3.2 | |
| annotated-types==0.7.0 | |
| anthropic==0.55.0 | |
| anyio==4.9.0 | |
| anywidget==0.9.18 |
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
| // ==UserScript== | |
| // @name myshipit | |
| // @author marcogorelli | |
| // @match https://github.com/* | |
| // adapted from https://github.com/chriskuehl/shipit/blob/master/shipit.user.js, | |
| // but I removed a handful of gifs (like the pikachu one) which I didn't like | |
| // ==/UserScript== | |
| (function () { | |
| var urls = [ |
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
| git name-rev --tags --name-only <SHA> |
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
| WITH unique_symbols AS ( | |
| SELECT DISTINCT symbol | |
| FROM df | |
| ), | |
| unique_dates AS ( | |
| SELECT DISTINCT date | |
| FROM df | |
| ), | |
| all_rows AS ( | |
| SELECT * |
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
| """ | |
| Example usage: | |
| python3 get_size_of.py polars altair | |
| """ | |
| import sys | |
| import subprocess | |
| import os | |
| args = ' '.join(sys.argv[1:]) |
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 polars as pl | |
| import numpy as np | |
| from sklego.pandas_utils import add_lags | |
| rng = np.random.default_rng(1) | |
| N = 10_000_000 | |
| a = rng.integers(0, 10, size=N) | |
| b = rng.integers(0, 10, size=N) | |
| c = rng.integers(0, 10, size=N) | |
| df = pl.DataFrame({'a': a, 'b': b, 'c': c}) |
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
| cargo test --package polars --test it --all-features -- core::pivot::test_pivot_new |
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 | |
| from matplotlib.cm import get_cmap | |
| import numpy as np | |
| fig, ax = plt.subplots() | |
| timings = np.array([11, 360, 573, 758]) | |
| total_timings = np.vstack([timings, 1000 - timings]) | |
| inner = total_timings[:, 0] | |
| mid = total_timings[:, 1] |
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
| # ruff: noqa | |
| import sys | |
| """ | |
| Find cases where docstring bullet points will not render correctly in the documentation. | |
| Do this: | |
| ``` | |
| Here is a list of things: | |
| - thing 1 | |
| - thing 2 |
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
| if __name__ == "__main__": | |
| files = subprocess.run( | |
| ["git", "ls-files"], capture_output=True, text=True | |
| ).stdout.split() | |
| ret = 0 | |
| for file in files: | |
| if not file.endswith(".py"): | |
| continue | |
| with open(file) as fd: | |
| content = fd.read() |
NewerOlder