Skip to content

Instantly share code, notes, and snippets.

View tdicola's full-sized avatar

Tony DiCola tdicola

View GitHub Profile
@tdicola
tdicola / main.py
Created January 28, 2018 07:59
Cyber Flower digital valentine with Gemma M0 and CircuitPython.
# Cyber Flower Digital Valentine
#
# 'Roses are red,
# Violets are blue,
# This flower changes color,
# To show its love for you.'
#
# Load this on a Gemma M0 running CircuitPython and it will smoothly animate
# the DotStar LED between different color hues. Touch the D0 pad and it will
# cause the pixel to pulse like a heart beat. Try connecting aluminum foil or
@tdicola
tdicola / 00_none.py
Created May 14, 2016 01:15
Files used in 'Raspberry Pi & Python basic data storage with Tony D!' live stream.
# Python Data Storage Demos Example 0: No Data Storage
# Basic setup for demos which show different ways to store program state (data)
# using standard and other Python libraries. This example has no data storage
# and will always show default values when run.
#
# Author: Tony DiCola
# License: Public Domain
# Create a class to represent a person and their favorite color.
@tdicola
tdicola / pandas_query.py
Created February 29, 2012 09:59
SQL style query function for pandas
from pandas import *
import numpy as np
def query(select=None, from_=None, where=None, groupby=None, orderby=None,
ascending=True):
"""
SQL style query for columns of a DataFrame.
select List of column names to select in the final output. Aggregation
may be defined by specifying a list of [<aggregation function>,