@@ -34,7 +34,7 @@ These functions correspond to the SQL commands ``SELECT`` and ``WHERE``.
3434.. code ::
3535
3636 >>> from toolz.curried import pipe, map, filter, get
37- >>> pipe(accounts, filter(lambda (id, name, balance, gender): balance > 150),
37+ >>> pipe(accounts, filter(lambda acc: acc[2] > 150),
3838 ... map(get([1, 2])),
3939 ... list)
4040
@@ -150,9 +150,9 @@ that adds up the balances for each group:
150150
151151.. code ::
152152
153- >>> binop = lambda total, (id, name, bal, gend) : total + bal
153+ >>> binop = lambda total, account : total + account[2]
154154
155- >>> reduceby(get(3), binop, accounts)
155+ >>> reduceby(get(3), binop, accounts, 0 )
156156 {'F': 400, 'M': 400}
157157
158158
@@ -307,9 +307,9 @@ composition, ...) users interested in data analytics might be better served by
307307using projects specific to data analytics like Pandas _ or SQLAlchemy.
308308
309309
310- .. _groupby : http ://toolz.readthedocs.org /en/latest/api.html#toolz.itertoolz.groupby
311- .. _join : http ://toolz.readthedocs.org /en/latest/api.html#toolz.itertoolz.join
312- .. _reduceby : http ://toolz.readthedocs.org /en/latest/api.html#toolz.itertoolz.reduceby
313- .. _valmap : http ://toolz.readthedocs.org /en/latest/api.html#toolz.itertoolz .valmap
310+ .. _groupby : https ://toolz.readthedocs.io /en/latest/api.html#toolz.itertoolz.groupby
311+ .. _join : https ://toolz.readthedocs.io /en/latest/api.html#toolz.itertoolz.join
312+ .. _reduceby : https ://toolz.readthedocs.io /en/latest/api.html#toolz.itertoolz.reduceby
313+ .. _valmap : https ://toolz.readthedocs.io /en/latest/api.html#toolz.dicttoolz .valmap
314314.. _Pandas : http://pandas.pydata.org/pandas-docs/stable/groupby.html
315- .. _curried : http ://toolz.readthedocs.org /en/latest/curry.html
315+ .. _curried : https ://toolz.readthedocs.io /en/latest/curry.html
0 commit comments