Numpy Histogram Representing Floats with Approximate Values as The Same
问题 I have code that generates a certain value from -10 to 10 given a range from [0,1) The code takes the value from -10 to 10 and it will append it to a list, according to its probability. For example, -10 would be put in the list 0 times since it corresponds to the value 0, and 10 would be put 100 times (as a normalization) since it corresponds to 1 in the range. Here is the code: #!/usr/bin/env python import math import numpy as np import matplotlib.pyplot as plt pos = [] ceilingValue = 0.82