enumerable-statistics 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69f55135e55fd08e3beda3b0935996ba719d2ad6d345f84321e7bb386e085ef2
4
- data.tar.gz: 9d94090f25eefbfe568acc8ddd3c168d04bcbc50d39d858ff2c5ffd2a02f0ab6
3
+ metadata.gz: e593e551f4f9b857a009db71093abab619e96680c4d15fc0eaa3a96c6e622bd4
4
+ data.tar.gz: eb449c789843e7e3e2c435890b8a9281d49cb6cdaad4ebbfc979b959413f617f
5
5
  SHA512:
6
- metadata.gz: 9d8fcb3f97e9852200f9d0735f4e25408303c6621680220c74caa519f1c268aa389ae3bfcb1b3d743867e9d4429d7f2c12c63ce26c573a1d3b401c4371876a5a
7
- data.tar.gz: c430bc88e14b6f438db7f234b20718047073199b4d905d7c8f771550790eb0e2891625d643bb35a3b43422dbf9e5fc67b10d4cb991348c787791fdc870510e23
6
+ metadata.gz: 8866ba9d47c0715b82ffe7370b1fe8f683e1c1a17fd2dfee50db06c536cfa25b469bbf94a0f23c24ce2179c9d81203b761f8d17beadf113752b4f89490a48a2f
7
+ data.tar.gz: 942e4dacc202cef906e631c38d9450045f9712ffed811b35f7f28fafeecc0e92f70196b0d8d8053423266d60210a1f556ed600d4c2c2b0ee5320aa97830cab47
@@ -1,4 +1,8 @@
1
- # 2.0.0-pre
1
+ # 2.0.1
2
+
3
+ - Fix a bug of `histogram` (#9)
4
+
5
+ # 2.0.0
2
6
 
3
7
  - Add `value_counts` method in Array, Hash, and Enumerable
4
8
  - Add `median` method in Array
@@ -2284,7 +2284,7 @@ ary_histogram(int argc, VALUE *argv, VALUE ary)
2284
2284
  {
2285
2285
  VALUE arg0, opts, edge, weights;
2286
2286
  int left_p;
2287
- long nbins;
2287
+ long nbins, nweights, i;
2288
2288
 
2289
2289
  rb_scan_args(argc, argv, "01:", &arg0, &opts);
2290
2290
  if (NIL_P(arg0)) {
@@ -2296,7 +2296,13 @@ ary_histogram(int argc, VALUE *argv, VALUE ary)
2296
2296
  left_p = opt_closed_left_p(opts);
2297
2297
 
2298
2298
  edge = ary_histogram_calculate_edge(ary, nbins, left_p);
2299
- weights = rb_ary_new_capa(RARRAY_LEN(edge) - 1);
2299
+
2300
+ nweights = RARRAY_LEN(edge) - 1;
2301
+ weights = rb_ary_new_capa(nweights);
2302
+ for (i = 0; i < nweights; ++i) {
2303
+ rb_ary_store(weights, i, INT2FIX(0));
2304
+ }
2305
+
2300
2306
  histogram_weights_push_values(weights, edge, ary, left_p);
2301
2307
 
2302
2308
  return rb_struct_new(cHistogram, edge, weights,
@@ -1,5 +1,5 @@
1
1
  module EnumerableStatistics
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
 
4
4
  module Version
5
5
  numbers, TAG = VERSION.split('-', 2)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumerable-statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-11 00:00:00.000000000 Z
11
+ date: 2020-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  - !ruby/object:Gem::Version
276
276
  version: '0'
277
277
  requirements: []
278
- rubygems_version: 3.0.4
278
+ rubygems_version: 3.1.2
279
279
  signing_key:
280
280
  specification_version: 4
281
281
  summary: Statistics features for Enumerable