Top "Random" questions

This tag is for questions pertaining to random numbers and their generators, whether pseudo-random or truly random.

Best way to create unique token in Rails?

Here's what I'm using. The token doesn't necessarily have to be heard to guess, it's more like a short url …

ruby-on-rails ruby-on-rails-3 random guid
Random word generator- Python

So i'm basically working on a project where the computer takes a word from a list of words and jumbles …

python random python-3.3
How to hash a string into 8 digits?

Is there anyway that I can hash a random string into a 8 digit number without implementing any algorithms myself?

python arrays algorithm random hash
scikit-learn random state in splitting dataset

Can anyone tell me why we set random state to zero in splitting train and test set. X_train, X_…

python random machine-learning scikit-learn
Random row selection in Pandas dataframe

Is there a way to select random rows from a DataFrame in Pandas. In R, using the car package, there …

python pandas random
Converting a Uniform Distribution to a Normal Distribution

How can I convert a uniform distribution (as most random number generators produce, e.g. between 0.0 and 1.0) into a normal …

algorithm language-agnostic random normal-distribution
In python, what is the difference between random.uniform() and random.random()?

In python for the random module, what is the difference between random.uniform() and random.random()? They both generate pseudo …

python random uniform
How to randomize (or permute) a dataframe rowwise and columnwise?

I have a dataframe (df1) like this. f1 f2 f3 f4 f5 d1 1 0 1 1 1 d2 1 0 0 1 0 d3 0 0 0 1 1 d4 0 1 0 0 1 The d1...d4 column …

r random permutation
How to Generate a random number of fixed length using JavaScript?

I'm trying to generate a random number that must have a fixed length of exactly 6 digits. I don't know if …

javascript random numbers
Get random sample from list while maintaining ordering of items?

I have a sorted list, let say: (its not really just numbers, its a list of objects that are sorted …

python list random sortedlist