From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QF5zNK0e0F5aIQAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 20:27:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +OhhMK0e0F5HcwAAB5/wlQ (envelope-from ) for ; Thu, 28 May 2020 20:27:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7CFA994053A for ; Thu, 28 May 2020 20:27:24 +0000 (UTC) Received: from localhost ([::1]:47534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeP7Z-0007cu-Um for larch@yhetil.org; Thu, 28 May 2020 16:27:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeP6a-0007bw-9u for emacs-orgmode@gnu.org; Thu, 28 May 2020 16:26:20 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:37909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeP6Z-0005V9-2J for emacs-orgmode@gnu.org; Thu, 28 May 2020 16:26:19 -0400 X-Originating-IP: 82.69.109.251 Received: from localhost (82-69-109-251.dsl.in-addr.zen.co.uk [82.69.109.251]) (Authenticated sender: stig@brautaset.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C2DF91BF203; Thu, 28 May 2020 20:26:13 +0000 (UTC) From: Stig Brautaset To: Uwe Brauer , emacs-orgmode@gnu.org Subject: Re: org table: one column of random numbers (but natural ones) In-Reply-To: <87lflbhq7a.fsf@mat.ucm.es> References: <87mu5taz7a.fsf@mat.ucm.es> <52b74175-5b6a-a78d-7d1f-8e3da16f184a@free.fr> <87lflbhq7a.fsf@mat.ucm.es> Date: Thu, 28 May 2020 21:26:02 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.201; envelope-from=stig@brautaset.org; helo=relay8-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 15:24:12 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: aCrLlAwjFrCZ > > 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