emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org table: one column of random numbers (but natural ones)


From: Stig Brautaset
Subject: Re: org table: one column of random numbers (but natural ones)
Date: Thu, 28 May 2020 21:26:02 +0100

>    > In row 67 you would have a random integer in the range [0..67)
>    > f0 format removes any fractional part leaving only an integer number
>
> Aha thanks, a minor thing, which I thank, cannot be really done:
>
> Is it possible to avoid number repetition?
>
> So I want a random sequence of the column 67 but I don't want numbers to
> be repeated.

To avoid duplicates you could generate a sequence from [0..67), shuffle
it[1], then use the row number as an index into that list. (Or pop off the
front.) How to do that from an org table function I have no idea,
however.

[1]: Emacs lisp "Knuth shuffle" implementation: 
https://stackoverflow.com/a/49505968/5950

Regards,
Stig




reply via email to

[Prev in Thread] Current Thread [Next in Thread]