New sortBy method

Issue #27 closed
Pierre Denis
repo owner created an issue

A sortBy instance method, with multi-arguments, should be added to change the default order of display. Example:

>>> Lea.cprod(surname,gender,height)
('Humphries', 'female', 123.0) : 1/6
    ('McGovern', 'male', 91.0) : 1/6
    ('Nunez', 'female', 126.0) : 1/6
     ('Seguin', 'male', 118.0) : 1/6
      ('Vaz', 'female', 126.0) : 1/6
        ('West', 'male', 93.0) : 1/6
>>> Lea.cprod(surname,gender,height).sortBy(gender,height)
('Humphries', 'female', 123.0) : 1/6
    ('Nunez', 'female', 126.0) : 1/6
      ('Vaz', 'female', 126.0) : 1/6
    ('McGovern', 'male', 91.0) : 1/6
        ('West', 'male', 93.0) : 1/6
     ('Seguin', 'male', 118.0) : 1/6

Comments (5)

  1. Log in to comment