Re: Is `wsample` a proper name for a function like this?

2012-10-13 Thread Joshua Landau
On 12 October 2012 03:22, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote: I think if a programmer has used the built-in `random` module before, he would expect a function with sample in its name to return a population

Re: Is `wsample` a proper name for a function like this?

2012-10-11 Thread Steven D'Aprano
On Wed, 10 Oct 2012 20:33:16 -0700, Satoru Logic wrote: I came across a function named `wsample` in a `utils` package of my workplace recently. The w in `wsample` stands for `weighted`, and it randomly selects an element from a container according to relative weights of all the elements.

Re: Is `wsample` a proper name for a function like this?

2012-10-11 Thread suzaku
On Thursday, October 11, 2012 2:29:37 PM UTC+8, Steven D'Aprano wrote: On Wed, 10 Oct 2012 20:33:16 -0700, Satoru Logic wrote: I came across a function named `wsample` in a `utils` package of my workplace recently. The w in `wsample` stands for `weighted`, and it randomly

Re: Is `wsample` a proper name for a function like this?

2012-10-11 Thread Steven D'Aprano
On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote: I think if a programmer has used the built-in `random` module before, he would expect a function with sample in its name to return a population sequence. I have used the random module for about fifteen years, and I still write random.sample

Re: Is `wsample` a proper name for a function like this?

2012-10-11 Thread suzaku
On Friday, October 12, 2012 10:22:16 AM UTC+8, Steven D'Aprano wrote: On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote: I think if a programmer has used the built-in `random` module before, he would expect a function with sample in its name to return a population sequence.

Is `wsample` a proper name for a function like this?

2012-10-10 Thread Satoru Logic
I came across a function named `wsample` in a `utils` package of my workplace recently. The w in `wsample` stands for `weighted`, and it randomly selects an element from a container according to relative weights of all the elements. In most articles and codes I saw online, a function like this

Re: Is `wsample` a proper name for a function like this?

2012-10-10 Thread Terry Reedy
On 10/10/2012 11:33 PM, Satoru Logic wrote: I came across a function named `wsample` in a `utils` package of my workplace recently. The w in `wsample` stands for `weighted`, and it randomly selects an element from a container according to relative weights of all the elements. I agree that

Re: Is `wsample` a proper name for a function like this?

2012-10-10 Thread alex23
On Oct 11, 1:33 pm, Satoru Logic satorulo...@gmail.com wrote: I came across a function named `wsample` in a `utils` package of my workplace recently. The w in `wsample` stands for `weighted`, and it randomly selects an element from a container according to relative weights of all the