Skip to main content

Recently Updated Pages

Idioms and words

Miscellaneous

everything but the kitchen sink through thick and thin stowaway joust scrape the bottom of the ba...

Updated 2 weeks ago by Kevin Woo

Working with Dates and Times

PostgreSQL Practical SQL

Data Types for Dates and Times data type description timestamp records date and time times...

Updated 2 weeks ago by Kevin Woo

Statistical Functions in SQL

PostgreSQL Practical SQL

Correlation SELECT corr(med_hh_inc, pct_bach_higher) FROM acs_2014_2018_stats; corr --...

Updated 2 weeks ago by Kevin Woo

Modifying Data + Transactions

PostgreSQL Practical SQL

Modifying Tables with ALTER TABLE -- add a column ALTER TABLE table_name ADD COLUMN column_name d...

Updated 2 weeks ago by Kevin Woo

Primary Keys & Foreign Keys

PostgreSQL Practical SQL

Primary Keys Natural Keys CREATE TABLE natural_key_example ( license_id text CONSTRAINT license...

Updated 3 weeks ago by Kevin Woo

JOIN and Set Operators

PostgreSQL Practical SQL

JOIN Types Type Description JOIN =INNER JOIN, returns rows from both tables where matching...

Updated 3 weeks ago by Kevin Woo

Basic Math and Stats with SQL

PostgreSQL Practical SQL

Median with percentile functions CREATE TABLE percentile_test ( numbers integer ); INSER...

Updated 3 weeks ago by Kevin Woo

Importing and Exporting Data

PostgreSQL Practical SQL

Import COPY COPY table_name FROM `/var/lib/postgres/data/spot_qt.csv' with (format csv, header) ...

Updated 3 weeks ago by Kevin Woo

Creating Table

PostgreSQL Practical SQL

Creating a Table create table spot_qt( year int, qt int, revenue numeric,...

Updated 3 weeks ago by Kevin Woo

Pandas Part V: Data Loading, Storage, and File Formats

Python for Data Analysis Pandas

Reading and Writing Data in Text Format Function Description read_csv csv read_clipboard...

Updated 2 months ago by Kevin Woo

matplotlib Part III: seaborn

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

seaborn import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot ...

Updated 2 months ago by Kevin Woo

Some bash commands I find useful

Miscellaneous

find . -type f -name "*.nfo" -o "*.edl" -delete find . -type f -name "*.nof" -o "*.edl" -exec mv...

Updated 4 months ago by Kevin Woo

matplotlib Cheat Sheet

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

figure class matplotlib.figure.Figure(figsize=None, dpi=None, *, facecolor=None, ...

Updated 5 months ago by Kevin Woo

numpy Cheat Sheet

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

random random.randn np.random.randn(d0, d1, ... , dn) randn returns a sample (or samples) from t...

Updated 5 months ago by Kevin Woo

pandas Cheat Sheet

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

pandas concat pandas.concat(objs, *, axis=0, join='outer', ignore_index=False, keys=None, levels=...

Updated 5 months ago by Kevin Woo

matplotlib Part I: Basics

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

Manipulating matplotlib import matplotlib as mpl mpl.rcParams['lines.linewidth'] = 3 mpl.rcParams...

Updated 5 months ago by Kevin Woo

matplotlib Part II: Bar Charts and Scatter Charts

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

Bar Charts labels = ['Physics', 'Chemistry', 'Literature', 'Peace'] foo_data = [3, 6, 10, 4] bar...

Updated 5 months ago by Kevin Woo

Cleaning Data with pandas

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

Reading Data df = pd.read_json('data/nobel_winners_dirty.json') df.info() <class 'pandas.core.fra...

Updated 5 months ago by Kevin Woo

Numpy, Pandas

Data Visualization with Python and Java... Cleaning and Exploring Data (numpy, pan...

Numpy # Moving Average def moving_average(arr, n=3): """ returns n-moving average(default=3) ar...

Updated 5 months ago by Kevin Woo

Moving Average

Algorithms

Simple Moving Average (SMA) SMA is the unweighted mean of the previous $k$ data-points.

Updated 5 months ago by Kevin Woo