|
|
- #!/usr/bin/env python3
- import matplotlib.pyplot as plt
- import seaborn as sns
- import numpy as np
-
- import random
-
- from util.script import frange
-
- from collections import Counter
-
-
- def main():
- #alpha_range = frange(0.5, 10, 0.1)
- #k = 50
-
- #alphas = _get_bins(k, alpha_range)
-
-
- alphas = []
-
- k = 25
-
- for v in range(5, 50):
- alphas.append(round(k/v, 2))
-
-
- num_bins =len(np.unique(alphas))
-
- print(num_bins)
-
- sns.set()
- plt.hist(alphas, bins=num_bins)
- plt.show()
-
- def _get_bins(k, alpha_range):
- bins = {}
-
- alphas = []
-
- for a in alpha_range:
- v = int(k/a)
- real_alpha = (k / v)
-
- alphas.append(round(real_alpha, 2))
-
- return alphas
-
- if __name__ == "__main__":
- main()
|