Skip to content

Instantly share code, notes, and snippets.

View tritemio's full-sized avatar

Antonino Ingargiola tritemio

View GitHub Profile
@tritemio
tritemio / matplotlib bug backend switching.ipynb
Last active June 27, 2016 23:05
Matplotlib notebook bug while switching backend inline <-> notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tritemio
tritemio / ipython notebook error log
Created September 10, 2015 16:22
ipython notebook error
[W 18:42:14.631 NotebookApp] WebSocket ping timeout after 8895168 ms.
[W 18:42:28.588 NotebookApp] WebSocket ping timeout after 8912305 ms.
[E 18:42:32.639 NotebookApp] Uncaught exception GET /api/kernels/0057f989-3be1-47d6-9c45-c2e9f4090f56/channels?session_id=36FCE332E3374711BAC31245B311D11C (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/0057f989-3be1-47d6-9c45-c2e9f4090f56/channels?session_id=36FCE332E3374711BAC31245B311D11C', version='HTTP/1.1', remote_ip='::1', headers={'Connection': 'keep-alive, Upgrade', 'Host': 'localhost:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Sec-Websocket-Key': '4HDkCm1669Wv1RaGMTL5OA==', 'Sec-Websocket-Version': '13', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Pragma': 'no-cache', 'Origin': 'http://localhost:8888', 'Sec-Websocket-Extensions': 'permessage-deflate', 'Upgrade': 'websocket', 'Cache-Control': 'no-cache', 'User-Agent': 'Mozilla/5.0 (Windows NT
<?xml version="1.0" encoding="UTF-16"?>
<WERReportMetadata>
<OSVersionInformation>
<WindowsNTVersion>6.1</WindowsNTVersion>
<Build>7601 Service Pack 1</Build>
<Product>(0x4): Windows 7 Enterprise</Product>
<Edition>Enterprise</Edition>
<BuildString>7601.18933.amd64fre.win7sp1_gdr.150715-0600</BuildString>
<Revision>1130</Revision>
<Flavor>Multiprocessor Free</Flavor>
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="python.exe" FILTER="CMI_FILTER_PRIVACY">
<MATCHING_FILE NAME="python.exe" SIZE="40960" CHECKSUM="0xBCD8C813" MODULE_TYPE="WIN32" PE_CHECKSUM="0xA500" LINKER_VERSION="0x0" LINK_DATE="03/06/2015 18:06:11" UPTO_LINK_DATE="03/06/2015 18:06:11" EXE_WRAPPER="0x0" />
<MATCHING_FILE NAME="python34.dll" SIZE="4058624" CHECKSUM="0xDAC8FABC" BIN_FILE_VERSION="3.4.3150.1013" BIN_PRODUCT_VERSION="3.4.3150.1013" PRODUCT_VERSION="3.4.3" FILE_DESCRIPTION="Python Core" COMPANY_NAME="Python Software Foundation" PRODUCT_NAME="Python" FILE_VERSION="3.4.3" ORIGINAL_FILENAME="python34.dll" INTERNAL_NAME="Python DLL" LEGAL_COPYRIGHT="Copyright © 2001-2015 Python Software Foundation. Copyright © 2000 BeOpen.com. Copyright © 1995-2001 CNRI. Copyright © 1991-1995 SMC." VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x3EDF55" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="3.4.3150.1013" UPTO_BIN_PRODUCT_VERSION="3.
@tritemio
tritemio / open file dialog
Created June 24, 2015 00:25
Open file dialog for default ipython notebook in Anaconda
def openfile_dialog():
from PyQt4 import QtGui
app = QtGui.QApplication([dir])
fname = QtGui.QFileDialog.getOpenFileName(None, "Select a file...", '.', filter="All files (*)")
return str(fname)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tritemio
tritemio / matplotlib spectrogram
Last active August 29, 2015 14:15
matplotlib spectrogram
{
"metadata": {
"name": "",
"signature": "sha256:f2f3593c1d178e2336d96bcb978c3642ce5e0a5943dbf554e24448310bff2a7b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@tritemio
tritemio / 2-Gaussian mixture fit Bayes vs NLS.ipynb
Created October 14, 2014 18:48
2-Gaussian mixture fit Bayes vs NLS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tritemio
tritemio / decay_fit.py
Last active August 29, 2015 14:02
Exponential decay fit - lmfit issues
'''
This script fits 1D noisy data (function of time) to a model function that has
2 shape parameters (lifetime or exponetial decay: `tau`, amplitude: `ampl`)
and one `offset` parameter for the translation in time.
'''
#%%
import numpy as np
import scipy
import scipy.stats
{
"metadata": {
"name": "",
"signature": "sha256:dd9ac9500d76bd6e4f223aa5277e5008fc30d9ad1df9ccab4997b0cbe52860c7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [