Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
enumerate instead of range(len())
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiBapchya committed Dec 5, 2018
1 parent 4328e30 commit 3b1abae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ def chi_square_check(generator, buckets, probs, nsamples=1000000):
if continuous_dist:
sample_bucket_ids = sample_bucket_ids // 2
obs_freq = np.zeros(shape=len(buckets), dtype=np.int)
for i in range(len(buckets)):
for i, _ in enumerate(buckets):
obs_freq[i] = (sample_bucket_ids == buckets[i]).sum()
_, p = ss.chisquare(f_obs=obs_freq, f_exp=expected_freq)
return p, obs_freq, expected_freq
Expand Down

0 comments on commit 3b1abae

Please sign in to comment.