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
cargo test --package polars --test it --all-features -- core::pivot::test_pivot_new |
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 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 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 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() |
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
deactivate | |
cp bytecode-parsing-tests.sh ../../temporary-polars-files/ | |
cp just-make-it-anew.sh ../../temporary-polars-files/ | |
cp pre-commit.sh ../../temporary-polars-files/ | |
cp repl.sh ../../temporary-polars-files/ | |
cp ../.vscode/settings.json ../../temporary-polars-files/ | |
git clean -fxfd ../. | |
cargo clean | |
rustup self uninstall | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
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
ipython -i -c 'import pandas as pd; \ | |
from pandas.core.arrays import *; \ | |
import polars as pl; \ | |
from datetime import datetime, timezone, timedelta; \ | |
from pandas._libs.tslibs.parsing import guess_datetime_format; \ | |
from dateutil.parser import parse as du_parse; \ | |
import datetime as dt; \ | |
import numpy as np; \ | |
from pandas import *; \ | |
import pandas; \ |
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
// ==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 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
# usage: | |
# python -m cProfile -o out.prof perf.py | |
# snakeviz out.prof --server | |
import pandas as pd | |
dates = pd.date_range("1900", "2000").tz_localize("+01:00").strftime("%Y-%d-%m %H:%M:%S%z").tolist() | |
dates.append("2020-01-01 00:00:00+02:00") | |
def main(): |
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 sys | |
import subprocess | |
import re | |
import shlex | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('command') | |
parser.add_argument('action', choices=['pull', 'push']) | |
args = parser.parse_args() |
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 bornly as bns | |
import numpy as np | |
import pandas as pd | |
from pmdarima import auto_arima | |
from statsmodels.tsa.statespace.sarimax import SARIMAX | |
flights = bns.load_dataset("flights") | |
flights["t"] = np.arange(len(flights)) | |
PERIOD = 12 | |
n_steps = 12 |
NewerOlder