Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create 10,000 random coordinates in python? [closed]

Hello I've been set a project where I have to generate 10,000 random coordinates (x,y), using the random module in python and then output them all. The coordinates HAVE to be decimal numbers between 0 and 2. I've had a look around on the internet but I can't seem to find anything that is helping me. Can anyone on here help me? Thank you.

like image 460
Sarah Avatar asked Apr 15 '26 10:04

Sarah


1 Answers

Or use numpy:

import numpy as np

coords = np.random.rand(10000, 2) * 2