Skip to content

Instantly share code, notes, and snippets.

View thoo's full-sized avatar

Thein Oo thoo

  • University of Pittsburgh Medical Center
  • Pittsburgh, PA
View GitHub Profile
@thoo
thoo / pickle
Last active February 22, 2019 21:23
#save_object #pickle
# pickle has a bug which won't let you save more than large (GB) files
import joblib
def save_obj(obj, name, name_dir='data' ):
"""
Save to pickle.
Parameters
----------
obj : any object
@thoo
thoo / pandas_validation_errors.ipynb
Created February 4, 2019 02:28 — forked from kynan/pandas_validation_errors.ipynb
Pandas documentation validation errors
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thoo
thoo / 2017-03-USC-Career-Conference-Supplementary.md
Created May 17, 2017 18:33 — forked from jbwhit/2017-03-USC-Career-Conference-Supplementary.md
Here are the supplementary materials for my USC Career Conference Keynote.
@thoo
thoo / 00-about-search-api-examples.md
Created March 26, 2017 22:49 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@thoo
thoo / multiclass_roc.ipynb
Created March 23, 2017 02:12 — forked from kathyxchen/multiclass_roc.ipynb
starting on an example for multiclass one-vs-one and one-vs-rest ROC AUC score approximations, issue#3298
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thoo
thoo / plot_roc.py
Created March 22, 2017 16:57 — forked from code-of-kpp/plot_roc.py
Python pyplot receiver operating characteristic (ROC) curve with colorbar
import numbers
import six
import numpy
import matplotlib.collections
from matplotlib import pyplot
# using example from
# http://nbviewer.ipython.org/github/dpsanders/matplotlib-examples/blob/master/colorline.ipynb
@thoo
thoo / README-Template.md
Created March 9, 2017 20:25 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@thoo
thoo / README-Template.md
Created March 9, 2017 20:25 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@thoo
thoo / pg_copy_from.py
Created March 7, 2017 18:47 — forked from jsheedy/pg_copy_from.py
benchmark for postgres inserts using copy_from and IteratorFile from https://gist.github.com/jsheedy/ed81cdf18190183b3b7d
import time
import psycopg2
from iter_file import IteratorFile
conn = psycopg2.connect(host="localhost", database="test")
# args = [(1,2), (3,4), (5,6)]
args = [(i,i+1) for i in range(1,1*10**4,2)]