Skip to content

Instantly share code, notes, and snippets.

View Dexter1618's full-sized avatar
💭
Hamiltonians with 無為

Debayan Das Dexter1618

💭
Hamiltonians with 無為
View GitHub Profile
@tvst
tvst / SessionState.py
Last active April 14, 2024 20:24
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@aahoo
aahoo / A Github Flavored Theme for Ipython or Jupyter Notebook.md
Last active May 20, 2022 09:02
Github Flavored Theme for Ipython/Jupyter Notebook

Github Flavored Theme for Ipython/Jupyter Notebook

Put custom.css in .jupyter/custom/ (if you are running recent version of Jupyter).

Note: Tested only on Chrome. Let me know if something is not working.

img1 img1 img1

@greydanus
greydanus / dynamic_plotting.py
Created October 14, 2016 18:20
Dynamic plotting for matplotlib
"Dynamic plotting in matplotlib. Copy and paste into a Jupyter notebook."
# written October 2016 by Sam Greydanus
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
import time
def plt_dynamic(x, y, ax, colors=['b']):
for color in colors:
ax.plot(x, y, color)
@BaxterEaves
BaxterEaves / bhc.py
Created July 16, 2015 21:20
Bayesian hierarchical clustering
"""
Copyright (C) 2015 Baxter Eaves
License: Do what the fuck you want to public license (WTFPL) V2
Bayesian hierarchical clustering.
Heller, K. A., & Ghahramani, Z. (2005). Bayesian Hierarchical Clustering.
Neuroscience, 6(section 2), 297–304. doi:10.1145/1102351.1102389
"""
import itertools as it