[Python-Dev] PEP 450 adding statistics module (original) (raw)
Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Sep 8 19:45:32 CEST 2013
- Previous message: [Python-Dev] PEP 450 adding statistics module
- Next message: [Python-Dev] PEP 450 adding statistics module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Sep 8, 2013 at 9:32 PM, Guido van Rossum <guido at python.org> wrote:
- Parallel arrays or arrays of tuples? I think the API should require an array of tuples. It is trivial to zip up parallel arrays to the required format, while if you have an array of tuples, extracting the parallel arrays is slightly more cumbersome.
I agree with your conclusion but not with the rationale: converting between array of tuples and parallel arrays is trivial both ways:
at = [(1,2,3), (4,5,6), (7,8,9), (10, 11, 12)] zip(*at) [(1, 4, 7, 10), (2, 5, 8, 11), (3, 6, 9, 12)] zip(*) [(1, 2, 3), (4, 5, 6), (7, 8, 9), (10, 11, 12)]
(Note that zip(*x) is basically transpose(x).) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130908/8d85efc9/attachment.html>
- Previous message: [Python-Dev] PEP 450 adding statistics module
- Next message: [Python-Dev] PEP 450 adding statistics module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]