When I call random.sample(arr,length)
an error returns random_sample() takes at most 1 positional argument (2 given). After some Googling I found out I’m calling Numpy’s random sample function when I want to call the sample function of the random module. I’ve tried importing numpy under a different name, which doesn’t fix the problem. I need Numpy for the rest of the program, though.
Any thoughts? Thanks
Sounds like you have something like
and
randomis getting clobbered by the numpy import. If you want to keep theimport *then you’ll need to renamerandom:Alternatively, and probably better, is to import numpy as a module instead of just yanking it all into your module’s namespace: