start new:
tmux
start new with session name:
tmux new -s myname
import nltk | |
from collections import namedtuple | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.feature_extraction import FeatureHasher | |
Data = namedtuple('Data', [ | |
'word_i_minus_2', |
""" | |
http://en.wikipedia.org/wiki/ID3_algorithm | |
http://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm | |
""" | |
from collections import namedtuple, Counter, defaultdict | |
from math import log2 |
# coding: utf-8 | |
import scipy as sp | |
from sklearn.feature_extraction.text import CountVectorizer, HashingVectorizer | |
from sklearn.naive_bayes import BernoulliNB | |
from sklearn.linear_model import LogisticRegression | |
from sklearn import cross_validation | |
from sklearn import metrics | |
datafile = open("data.tsv") |
In [1]: %load test.py | |
In [2]: import pandas as pd | |
import numpy as np | |
frame = pd.read_csv("table.csv", engine="python", parse_dates=['since']) | |
print frame | |
d = pd.pivot_table(frame, index=pd.TimeGrouper(key='since', freq='1d'), values=["value"], columns=['id'], aggfunc=np.sum, fill_value=0) | |
print d | |
print "^that is not what I expected" |
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
[Desktop Entry] | |
Version=24.5 | |
Name=Emacs | |
Exec=env UBUNTU_MENUPROXY=0 /usr/local/bin/emacs-24.5 | |
Terminal=false | |
Icon=/usr/local/share/icons/hicolor/128x128/apps/emacs.png | |
Type=Application | |
Categories=IDE | |
X-Ayatana-Desktop-Shortcuts=NewWindow | |
[NewWindow Shortcut Group] |
package main | |
import ( | |
"fmt" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. | |
Fetch(url string) (body string, urls []string, err error) |
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by'); | |
typeof(options) != 'undefined' || (options = {}); | |
typeof(this.limit) != 'undefined' || (this.limit = 20); | |
typeof(this.offset) != 'undefined' || (this.offset = 0); | |
typeof(this.filter_options) != 'undefined' || (this.filter_options = {}); | |
typeof(this.sort_field) != 'undefined' || (this.sort_field = ''); |