Skip to content

Instantly share code, notes, and snippets.

View alaudet's full-sized avatar

Al Audet alaudet

View GitHub Profile
@alaudet
alaudet / install virtualenv ubuntu 16.04.md
Created April 14, 2019 11:24 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@alaudet
alaudet / toggle_code_jupyter
Created May 29, 2019 11:54
Toggle Code View in Jupyter
# Source: https://stackoverflow.com/questions/27934885/how-to-hide-code-from-cells-in-ipython-notebook-visualized-with-nbviewer
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
@alaudet
alaudet / nosetests
Created June 8, 2019 12:40
Nose Tests Pydocs
NAME
nose.tools
DESCRIPTION
Tools for testing
-----------------
nose.tools provides a few convenience functions to make writing tests
easier. You don't have to use them; nothing in the rest of nose depends
on any of these methods.
@alaudet
alaudet / pandas_date_handling_from_excel.py
Last active August 9, 2022 08:43
Converting Excel dates in 5 number format for python
import datetime
# When dumping to csv excel puts date in 5 digit float format (e.g. 39856.0)
# function converts series of dates to date string.
def date_to_string(digit_date):
new_form = []
for d in digit_date:
try:
x = datetime.date(1899,12,30) + datetime.timedelta(days=float(d))
new_form.append(x.strftime('%Y-%m-%d'))