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 pathlib | |
| import subprocess | |
| figures_in = list(pathlib.Path('figures/').glob('*')) | |
| for fig_path in figures_in: | |
| out_path = (pathlib.Path('figures_eps') / | |
| pathlib.Path(fig_path.stem).with_suffix('.eps')) | |
| subprocess.run(["inkscape", fig_path, "-o", out_path, | |
| "--export-ps-level=3"]) |
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
| presents = { | |
| 1: 'A partridge in a pear tree', | |
| 2: 'Two turtle doves', | |
| 3: 'Three french hens', | |
| 4: 'Four calling birds', | |
| 5: 'Five golden rings', | |
| 6: 'Six geese a-laying', | |
| 7: 'Seven swans a-swimming', | |
| 8: 'Eight maids a-milking', | |
| 9: 'Nine ladies dancing', |
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 os | |
| import glob | |
| import pandas as pd | |
| from tqdm import tqdm | |
| import numpy as np | |
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| from sparse_dot_topn import awesome_cossim_topn | |
| import string | |
| from nltk.corpus import stopwords |
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 os | |
| import re | |
| def replace_text_in_files(directory_path, search_pattern, replace_pattern): | |
| for root, dirs, files in os.walk(directory_path): | |
| for file_name in files: | |
| if file_name.endswith(".md"): | |
| file_path = os.path.join(root, file_name) |
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
| from datetime import datetime | |
| output_fname = f"prefix_{datetime.now().strftime('%Y_%m_%d-%p%I_%M_%S')}.csv" |
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
| # /// script | |
| # python = ">=3.10" | |
| # dependencies = [ | |
| # "numpy>=1.21.0", | |
| # "pandas>=1.3.0", | |
| # "statsmodels>=0.13.0", | |
| # "pyfixest>=0.11.0", | |
| # "matplotlib>=3.4.0" | |
| # ] | |
| # /// |