Skip to content

Instantly share code, notes, and snippets.

@lschwetlick
lschwetlick / ci_error.ipynb
Created September 24, 2024 19:51
psignifit_issue_demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / makeplot.py
Last active January 6, 2023 18:47
How to procrastinate writing your thesis
import os
import pandas as pd
import time
import seaborn as sns
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
label_dict = {
"0_preface/abstract.tex" : "thesis noncontent",
'0_preface/abstractGerman.tex' : "thesis noncontent",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / A Script to Download Music from a Telegram Conversation
Last active January 13, 2022 13:26
Download Music from a Telegram Conversation
Download Music from a Telegram Conversation
- youtube-dl lives here https://github.com/ytdl-org
- telegram data can be downloaded in the desktop app via preferences -> advanced -> export
@lschwetlick
lschwetlick / get_gallery.py
Created July 23, 2021 06:41
Download all Images from Flickr Gallery
@lschwetlick
lschwetlick / music_theory.py
Created April 23, 2021 10:54 — forked from mvanga/music_theory.py
Basic Music Theory in ~200 Lines of Python
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lschwetlick
lschwetlick / colors2cmap.py
Created March 17, 2021 15:24
New matplotlib cmap from color list
import matplotlib.colors
def colors2cmap(*args, name=None):
"""Create a colormap from a list of given colors.
Parameters:
*args: Arbitrary number of colors (Named color, HEX or RGB).
name (str): Name with which the colormap is registered.
Returns:
@lschwetlick
lschwetlick / multiexplode2.ipynb
Last active September 15, 2021 20:52
Multi-Column Explode idea
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / reciprobit.R
Created January 6, 2021 17:20
How to generate a reciprobit plot (used in LATER models) in R
# We want to generate a reciprobit plot like it is used in the context of LATER models.
# Here, we generate normally distributed data. In the reciprobit plot that should appear linear
rm(list=ls())
library(ggplot2)
N = 1000
f = rnorm(N,mean=300,sd=50)
x = sort(1/f,decreasing=T)
y = (1:N)/N
@lschwetlick
lschwetlick / sk1.ipynb
Last active February 28, 2020 17:19
Scikit-learn problem with PCA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.