About 6,050,000 results
Open links in new tab
  1. python - Generate random integers between 0 and 9 - Stack …

    How can I generate random integers between 0 and 9 (inclusive) in Python? For example, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

  2. What does `random.seed()` do in Python? - Stack Overflow

    random.seed(a, version) in python is used to initialize the pseudo-random number generator (PRNG). PRNG is algorithm that generates sequence of numbers approximating the …

  3. Shuffle an array with python, randomize array item order with …

    Aug 28, 2017 · When dealing with regular Python lists, random.shuffle() will do the job just as the previous answers show. But when it come to ndarray (numpy.array), random.shuffle seems to …

  4. How exactly does random.random() work in python? - Stack …

    Feb 2, 2017 · The random () method is implemented in C, executes in a single Python step, and is, therefore, threadsafe. The _random is a compiled C library that contains few basic …

  5. python - How can I randomly select (choose) an item from a list …

    As of Python 3.6 you can use the secrets module, which is preferable to the random module for cryptography or security uses. To print a random element from a list:

  6. Generate random number in range excluding some numbers

    Mar 24, 2017 · 37 Is there a simple way in Python to generate a random number in a range excluding some subset of numbers in that range? For example, I know that you can generate …

  7. How to generate a random date between two other dates?

    The way the question is presented at the moment it isn't clear whether or not you only want the date or the time to be random. Your example suggests that you are looking for a time. If it has …

  8. How to create a GUID/UUID in Python - Stack Overflow

    Feb 10, 2009 · How do I create a GUID/UUID in Python that is platform independent? I hear there is a method using ActivePython on Windows but it's Windows only because it uses COM. Is …

  9. python - Generate random colors (RGB) - Stack Overflow

    Mar 12, 2015 · I just picked up image processing in python this past week at the suggestion of a friend to generate patterns of random colors. I found this piece of script online that generates a …

  10. python - How to get a random number between a float range

    May 22, 2011 · random.randrange(start, stop) only takes integer arguments. So how would I get a random number between two float values?