Skip to content

Instantly share code, notes, and snippets.

View gunzapper's full-sized avatar
🏠
Working from home

Pietro Brunetti gunzapper

🏠
Working from home
View GitHub Profile
@gunzapper
gunzapper / gist:852e32ecea3a44527ff7
Created February 19, 2016 11:21 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""quick way to create a data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case"""
"""to get an array from a data frame or a series use values, note it is not a function here, so no parans ()"""
point = df_allpoints[df_allpoints['names'] == given_point] # extract one point row.
point = point['desc'].values[0] # get its descriptor in array form.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gunzapper
gunzapper / tmux.md
Last active August 29, 2015 14:15 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a