Skip to content

Instantly share code, notes, and snippets.

View ladyrassilon's full-sized avatar

Gemma Hentsch ladyrassilon

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ladyrassilon
ladyrassilon / import_data_into_hdf5.py
Created June 15, 2016 09:54
Import Companies House basic bulk data into compressed hdf5
import datetime
import requests
from bs4 import BeautifulSoup
import requests
import pandas as pd
import zipfile
import StringIO
import numpy as np
def download_companies_house(
@ladyrassilon
ladyrassilon / Team allocations.ipynb
Created June 10, 2016 16:00
Calculating team allocations for euro cup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ladyrassilon
ladyrassilon / OrthologuesIDs
Created April 27, 2016 12:37 — forked from GenDataPro/OrthologuesIDs
Use a list of Ensembl human gene IDs to generate the related orthologue IDs
import requests
import json
from collections import Counter
import pandas as pd
file_name = "/Users/Dani/OneDrive/GenDataPro/TFs.txt"
with open(file_name) as gene_text:
gene_file = gene_text.read()
gene_ids = gene_file.split()
@ladyrassilon
ladyrassilon / Age of Presidents.ipynb
Created January 29, 2016 01:47
Age of US Presidents
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
echo 'cloning the repo'
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'adding the magic to your bash profile'
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'export TMPDIR=~/.tmp' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'reloading the bash profile'
#!/bin/bash
echo 'cloning the repo'
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'adding the magic to your bash profile'
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'export TMPDIR=~/.tmp' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'reloading the bash profile'
source ~/.bash_profile
@ladyrassilon
ladyrassilon / clean_exponent.py
Created November 10, 2015 19:03
Simplifies "messy" large numbers
from decimal import Decimal, DecimalTuple
NUMBER_EXPONENT_PLACES = 4
def clean_exponent(number, places=NUMBER_EXPONENT_PLACES, round_up=True):
"""
Simplifies messy large numbers
Example
@ladyrassilon
ladyrassilon / mutable_global_scope_in_class_definitions.ipynb
Last active November 17, 2015 14:00
The Global Problems with definiing Mutable Objects in Class Scope
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.