Skip to content

Instantly share code, notes, and snippets.

@gka
gka / birth-transposed-2.csv
Created May 19, 2012 14:34
Daily Births Per Month in Germany, normalized by birth per day over the full year.
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 14 columns, instead of 11 in line 6.
Year,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,Total
1950,3091.48387097,3266.96428571,3325.90322581,3187.86666667,3160.58064516,3078.7,2958.09677419,2885.80645161,3056.83333333,2943.70967742,2912.8,2864.74193548,3059.45479452
1951,3029.5483871,3181.71428571,3210.74193548,3142.96666667,3196.41935484,3087.1,3017.0,2929.35483871,3022.56666667,2884.61290323,2806.4,2878.16129032,3031.17808219
1952,3072.0,3223.24137931,3268.4516129,3181.03333333,3115.93548387,2994.03333333,2973.5483871,2865.29032258,3070.0,2807.74193548,2860.5,2814.5483871,3027.62739726
1953,3052.90322581,3175.96428571,3248.19354839,3163.06666667,3142.83870968,3039.6,2975.5483871,2856.61290323,3061.5,2774.12903226,2679.63333333,2846.16129032,3000.07945205
1954,3074.06451613,3238.64285714,3172.93548387,3180.3,3243.35483871,3096.2,3021.51612903,2930.4516129,3054.9,2781.06451613,2848.86666667,2862.19354839,3040.39178082
1955,3058.03225806,3235.96428571,3286.93548387,3178.4,3151.77419355,3104.63333333,2988.51612903,2933.41935484,3064.06666667,287
@catawbasam
catawbasam / pandas_dbms.py
Last active May 26, 2024 05:32
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
@cjbayesian
cjbayesian / bayes_update.R
Created August 16, 2012 20:23
generate a video demonstrating Bayesian updating
## Corey Chivers, 2012 ##
sim_bayes<-function(p=0.5,N=100,y_lim=20,a_a=2,a_b=10,b_a=8,b_b=3)
{
## Simulate outcomes in advance
outcomes<-sample(1:0,N,prob=c(p,1-p),replace=TRUE)
success<-cumsum(outcomes)
for(frame in 1:N)
{
png(paste("plots/",1000+frame,".png",sep=""))
@panisson
panisson / ncp.py
Last active June 9, 2020 01:44
Nonnegative Tensor Factorization, based on the Matlab source code available at Jingu Kim's home page: https://sites.google.com/site/jingukim/home#ntfcode Requires the installation of Numpy and Scikit-Tensor (https://github.com/mnick/scikit-tensor). For examples, see main() function.
# Copyright (C) 2013 Istituto per l'Interscambio Scientifico I.S.I.
# You can contact us by email (isi@isi.it) or write to:
# ISI Foundation, Via Alassio 11/c, 10126 Torino, Italy.
#
# This work is licensed under a Creative Commons 4.0
# Attribution-NonCommercial-ShareAlike License
# You may obtain a copy of the License at
# http://creativecommons.org/licenses/by-nc-sa/4.0/
#
# This program was written by Andre Panisson <panisson@gmail.com> at
@robschmuecker
robschmuecker / README.md
Last active March 14, 2026 05:59
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@CamDavidsonPilon
CamDavidsonPilon / 538.json
Last active November 28, 2021 07:37
Use the two files below to mimic graphs on 538. www.dataorigami.net/blogs/fivethirtyeight-mpl
{
"lines.linewidth": 2.0,
"examples.download": true,
"patch.linewidth": 0.5,
"legend.fancybox": true,
"axes.color_cycle": [
"#30a2da",
"#fc4f30",
"#e5ae38",
"#6d904f",
@nebw
nebw / arXiv popularity scoring.ipynb
Created September 6, 2015 12:07
Popularity scoring for arXiv publications
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pirafrank
pirafrank / uninstall_office_2016.sh
Last active April 23, 2025 18:45
Uninstall Office 2016 from OS X completely
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "
ROOT PRIVILEDGES NEEDED!
You have to run this script as root.
Aborting...
"
exit 1
else
@balzer82
balzer82 / TimeSeries-Decomposition.ipynb
Last active June 20, 2022 14:38
TimeSeries Decomposition in Python with statsmodels and Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@subfuzion
subfuzion / curl.md
Last active April 2, 2026 08:34
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.