I'm trying to write a function in C++ that returns a random float/double in between 0 and 1 every time with a different value every time.
I've tried a few different orientations of srand, rand, an

View details »

I am trying to create this memory game in ReactJS and I have made an array in which I add 4 random numbers. Now everytime I press play game I need to fill the array with 4 random numbers 0 to 3 but

View details »

I know this for normal integers, but is there for such a thing as indices?
Random dice = new Random();
int n = dice.nextInt(6);
System.out.println(n);

View details »

I'm writing some code to find patterns in pseudo random numbers. I would like to print these numbers as they are added to a list. How do I get the last generated int?
I've looked through the docume

View details »

I am working on simulating a random-effects-model for comparison of the DerSimonian-Laird-method vs. Hartung-Knapp-Sidik-Jonkman-method in R. To do so, I chose different combinations of mu (true tre

View details »

Suppose I have a Pandas dataframe, df, which has the following structure:-
Column 1 Column 2 .... Column 100
Row 1 0.233 0.555 0
Row 2 0.231

View details »

I've been using the == operator in my program to compare all my strings so far.
However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.
Is == bad? When should i

View details »

I have an idea to make an application/program to help with music theory. It would spit out random chords of a certain key, and then you have to type in which key they come from. It would be an amazi

View details »

I have df like below,
+----+----------------+--------------+
| | column_name | data_type |
+----+----------------+--------------+
| 0 | time | TIMESTAMP |
| 1 | id

View details »

So I want to shorten my code and I asked myself if there is any possibilty that a Random Lettergenrator in Java is as short as in phyton?

View details »

So if I use randomColor to generate a pretty random variation of "green", I get this for example:
This is a bit chaotic for my liking, I would instead like to get a list of green colors that have

View details »

I have a list and an iterator that contain the same data. I have the list so that I can return the random element using random.choice. I have made an iterator from the list using the itertools.cycle

View details »

I have saved an optimised H2ORandomForestEstimator model using h2o.save_model() (python API). I now want to load this model and re-train it with different variants of my data, whilst maintaining the

View details »

I tried to code a coinToss simulator which was pretty easy for a beginner but then, I tried implementing a percentage system that calculates how much percentage of the total flips were heads or tail

View details »

I would like to know how to deal with correlated variables when building a Random Forest for feature selection
So I need to do some feature selection on different datasets that contain categorical

View details »

I wanted this dice program to simulate the roll of a six sided die everytime I roll the six sided die ten times using a forloop.
As I stated, I wrote a for loop and specified the number of times I

View details »

I've written the following code to create a random number between 0.0 and 10.0.
const minRand = 0
const maxRand = 10
v := minRand + rand.Float64()*(maxRand-minRand)
However I would like to set th

View details »

I'm making a world generator in java. The algorithm works by first setting various positions with high points (ranges) and low points (trenches), then it averages it all out by going through every t

View details »

Given a matrix A, I want to apply different random shuffles for different row of A; for example, [[1,2,3],[4,5,6],[7,8,9]] becomes [[1,3,2],[6,5,4],[7,9,8]].
Of course we can loop through the matri

View details »

I would like to generate a few random numbers. But LHS only returns continuous numbers.
Note: I know that if I use functions like floor, they violate the underlying assumptions of the method.

View details »