Skip to content

Commit

Permalink
Fix SyntaxError and TypeError in Examples (#336)
Browse files Browse the repository at this point in the history
lambda ... (id, name, bal, gend) ... SyntaxError: invalid syntax 
binop's TypeError: can only concatenate tuple (not "int") to tuple
  • Loading branch information
beenorgone authored and mrocklin committed Oct 20, 2016
1 parent c5d6d26 commit 14c7ab8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/source/streaming-analytics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These functions correspond to the SQL commands ``SELECT`` and ``WHERE``.
.. code::
>>> from toolz.curried import pipe, map, filter, get
>>> pipe(accounts, filter(lambda (id, name, balance, gender): balance > 150),
>>> pipe(accounts, filter(lambda acc: acc[2] > 150),
... map(get([1, 2])),
... list)
Expand Down Expand Up @@ -150,9 +150,9 @@ that adds up the balances for each group:

.. code::
>>> binop = lambda total, (id, name, bal, gend): total + bal
>>> binop = lambda total, account: total + account[2]
>>> reduceby(get(3), binop, accounts)
>>> reduceby(get(3), binop, accounts, 0)
{'F': 400, 'M': 400}
Expand Down

0 comments on commit 14c7ab8

Please sign in to comment.