Skip to content

Instantly share code, notes, and snippets.

from fbm import FBM
from fbm import fbm, fgn, times
from fbm import MBM
from fbm import mbm, mgn, times
import math
def MMAR(K, simulated_H, simulated_lambda, simulated_sigma, original_price_history, magnitude_parameter, GRAPHS):
# --- VARIABLES ---
import re
from scrapy import log
from scrapy.http import Request
from scrapy.exceptions import IgnoreRequest
from scrapy.utils.httpobj import urlparse_cached
from scrapy.contrib.downloadermiddleware.redirect import RedirectMiddleware
class RedirectOffsiteMiddleware(RedirectMiddleware):
@bsweger
bsweger / useful_pandas_snippets.md
Last active March 4, 2026 19:59
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)