Skip to content

Instantly share code, notes, and snippets.

Avatar

jamespeterschinner

View GitHub Profile
View Example categorical bar plot
import matplotlib.pyplot as plt
from statistics import mean
def chunks(l, n=2):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
View pBR322
ttctcatgtttgacagcttatcatcgataagctttaatgcggtagtttatcacagttaaattgctaacgcagtcaggcac
cgtgtatgaaatctaacaatgcgctcatcgtcatcctcggcaccgtcaccctggatgctgtaggcataggcttggttatg
ccggtactgccgggcctcttgcgggatatcgtccattccgacagcatcgccagtcactatggcgtgctgctagcgctata
tgcgttgatgcaatttctatgcgcacccgttctcggagcactgtccgaccgctttggccgccgcccagtcctgctcgctt
cgctacttggagccactatcgactacgcgatcatggcgaccacacccgtcctgtggatcctctacgccggacgcatcgtg
gccggcatcaccggcgccacaggtgcggttgctggcgcctatatcgccgacatcaccgatggggaagatcgggctcgcca
cttcgggctcatgagcgcttgtttcggcgtgggtatggtggcaggccccgtggccgggggactgttgggcgccatctcct
tgcatgcaccattccttgcggcggcggtgctcaacggcctcaacctactactgggctgcttcctaatgcaggagtcgcat
aagggagagcgtcgaccgatgcccttgagagccttcaacccagtcagctccttccggtgggcgcggggcatgactatcgt
cgccgcacttatgactgtcttctttatcatgcaactcgtaggacaggtgccggcagcgctctgggtcattttcggcgagg
@jamespeterschinner
jamespeterschinner / Lineweaver-burk plot.py
Last active May 15, 2019
Example lineweaver-burk plot of competitive inhibition
View Lineweaver-burk plot.py
import numpy as np
from itertools import chain
from statistics import mean
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.formula.api as sfa
@jamespeterschinner
jamespeterschinner / text_array.py
Last active Mar 23, 2018
Nice Character array wrapper
View text_array.py
import numpy as np
def horizontal_index(n, offset=0):
"""Create horizontal index with vertically aligned numbers"""
index = [' ' * offset for _ in range(len(str(n)))]
for number in map(str, range(n)):
for idx, n in enumerate(number):
index[idx] += n + '|'
pad = max(map(len, index))
return '\n'.join(i.rjust(pad, ' ') for i in reversed(index))
View client_benchmark.py
import asyncio
from time import time
from async_v20 import OandaClient
class Time(object):
def __enter__(self):
self.start = time()
return self
You can’t perform that action at this time.