0

I have 10 sample data (array of int) and now I want to make it 100 and mean while I don’t want to just copy it 10 times. Data = [0, 1,2,3,4,5,6,7,8,9]

So I want to create 90 more data and if I copy it 9 times than each frequency will be 10 or evenly distributed. Which I don’t want but some other way where frequency randomly or at least not evenly distributed.

CrazyC
  • 1,840
  • 6
  • 39
  • 60
  • 1
    It's not clear what you're asking. Please [edit] your question to show a [mcve] with a sample of your input data and your expected output, as well as code for what you've tried based on your own research – G. Anderson May 10 '21 at 16:42
  • Thanks edited it and make more clear. – CrazyC May 10 '21 at 21:37
  • See [Select one element from a list using python following the normal distribution ](https://stackoverflow.com/questions/35472461/select-one-element-from-a-list-using-python-following-the-normal-distribution) – G. Anderson May 10 '21 at 21:57
  • The requester wants 100 samples from a uniform distribution from 0-9 inclusive in an array as integers based on the description - I believe the use or "normal" in the title was an error. – katardin May 10 '21 at 22:19

1 Answers1

0

If I understand the question correctly (which I am not sure I do) then you should look at using the numpy module which has easy built in ways of generating data with a normal distribution using numpy.random.normal

You can look at the documentation and tweak it by adding the mean SD and number of values you need - 90 arranged into groups of 10?

import numpy as np

mu, sigma = 0, 0.1 # mean and standard deviation
s = np.random.normal(mu, sigma, [10,9]) # [10,9] is the shape of data. 

This leaves you with a numpy array (s) of the data, which is easy to access in the list format that you seem to be after.

Callum
  • 65
  • 1
  • 7