Issue #7 closed
Former user created an issue

Originally reported on Google Code with ID 7

One feature I miss is create a distribution from a list.

Reported by dtrillo on 2014-11-24 16:14:48

Comments (8)

  1. Former user Account Deleted
    Simply put an asterisk in front of the list (or tuple or iterator or...):
    
    >>> die = Lea.fromVals(*[1,2,3,4,5,6])
    >>> die
    1 : 1/6
    2 : 1/6
    3 : 1/6
    4 : 1/6
    5 : 1/6
    6 : 1/6
    
    OK. This question has been raised by one other user. Probably, this must be more detailed
    in the tutorial.
    

    Reported by pde@n-side.com on 2014-11-25 23:20:49 - Status changed: Invalid

  2. Former user Account Deleted
    Tutorial wiki page has been updated with examples on this topic.
    

    Reported by pde@n-side.com on 2014-11-25 23:35:13 - Status changed: Accepted

  3. Former user Account Deleted
    Why don't you simply add a method:
    
    def fromList(you_list):
         return Lea.fromVals(*your_list)
    
    It's simple, and it let users to use list!
    
    I reject using LEA because I couldn't get a simple method that use a list. My thought
    was: if I coundn't, I leave it.
    
    List is almost the only objets I use in Python!
    

    Reported by dtrillo on 2014-11-27 10:54:51

  4. Former user Account Deleted
    OK. This is then a "convenience" method.
    I will add this in forthcoming version 2. For the sake of generality I propose to call
    this method
    fromSeq(...)
    because it could be used not only with lists, but any Python sequence (lists, tuples,
    iterators, ...).
    

    Reported by pde@n-side.com on 2014-12-16 18:04:24

  5. Former user Account Deleted
    Done in Lea 2
    

    Reported by pde@n-side.com on 2014-12-25 23:08:02 - Status changed: Verified

  6. Former user Account Deleted

    Reported by pde@n-side.com on 2015-07-17 13:02:38 - Labels added: Type-Enhancement - Labels removed: Type-Defect

  7. Log in to comment