red_amber 0.1.7 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/doc/Vector.md CHANGED
@@ -145,7 +145,7 @@ array[booleans]
145
145
  | ✓ `min_max` | ✓ | ✓ | ✓ | ✓ ScalarAggregate| |
146
146
  |[ ]`mode` | | [ ] | |[ ] Mode | |
147
147
  | ✓ `product` | ✓ | ✓ | | ✓ ScalarAggregate| |
148
- |[ ]`quantile`| | [ ] | |[ ] Quantile| |
148
+ | `quantile`| || | Quantile|Specify probability in (0..1) by a parameter (default=0.5)|
149
149
  | ✓ `sd ` | | ✓ | | |ddof: 1 at `stddev`|
150
150
  | ✓ `stddev` | | ✓ | | ✓ Variance|ddof: 0 by default|
151
151
  | ✓ `sum` | ✓ | ✓ | | ✓ ScalarAggregate| |
@@ -187,8 +187,8 @@ boolean.all(skip_nulls: false) #=> false
187
187
  | ✓ `-@` | | ✓ | | |as `-vector`|
188
188
  | ✓ `negate` | | ✓ | | |`-@` |
189
189
  | ✓ `abs` | | ✓ | | | |
190
- |[ ]`acos` | | [ ] | | | |
191
- |[ ]`asin` | | [ ] | | | |
190
+ | `acos` | || | | |
191
+ | `asin` | || | | |
192
192
  | ✓ `atan` | | ✓ | | | |
193
193
  | ✓ `bit_wise_not`| | (✓) | | |integer only|
194
194
  | ✓ `ceil` | | ✓ | | | |
@@ -197,10 +197,10 @@ boolean.all(skip_nulls: false) #=> false
197
197
  | ✓`fill_nil_forward` | ✓ | ✓ | ✓ | | |
198
198
  | ✓ `floor` | | ✓ | | | |
199
199
  | ✓ `invert` | ✓ | | | |`!`, alias `not`|
200
- |[ ]`ln` | | [ ] | | | |
201
- |[ ]`log10` | | [ ] | | | |
202
- |[ ]`log1p` | | [ ] | | | |
203
- |[ ]`log2` | | [ ] | | | |
200
+ | `ln` | || | | |
201
+ | `log10` | || | | |
202
+ | `log1p` | || | |Compute natural log of (1+x)|
203
+ | `log2` | || | | |
204
204
  | ✓ `round` | | ✓ | | ✓ Round (:mode, :n_digits)| |
205
205
  | ✓ `round_to_multiple`| | ✓ | | ✓ RoundToMultiple :mode, :multiple| multiple must be an Arrow::Scalar|
206
206
  | ✓ `sign` | | ✓ | | | |
@@ -267,7 +267,7 @@ double.round(n_digits: -1)
267
267
  | ✓ `is_valid` | ✓ | ✓ | ✓ | | |
268
268
  | ✓ `less` | ✓ | ✓ | ✓ | |`<`, alias `lt`|
269
269
  | ✓ `less_equal` | ✓ | ✓ | ✓ | |`<=`, alias `le`|
270
- |[ ]`logb` | | [ ] | | | |
270
+ | `logb` | || | |logb(b) Compute base `b` logarithm|
271
271
  |[ ]`mod` | | [ ] | | | `%` |
272
272
  | ✓ `multiply` | | ✓ | | | `*` |
273
273
  | ✓ `not_equal` | ✓ | ✓ | ✓ | |`!=`, alias `ne`|
@@ -283,8 +283,6 @@ double.round(n_digits: -1)
283
283
 
284
284
  Returns a new array with distinct elements.
285
285
 
286
- (Not impremented functions)
287
-
288
286
  ### `tally` and `value_counts`
289
287
 
290
288
  Compute counts of unique elements and return a Hash.
@@ -303,16 +301,11 @@ double.round(n_digits: -1)
303
301
 
304
302
  Returns index of specified element.
305
303
 
306
- ### `sort_indexes`, `sort_indices`, `array_sort_indices`
304
+ ### `quantiles(probs = [1.0, 0.75, 0.5, 0.25, 0.0], interpolation: :linear, skip_nils: true, min_count: 0)`
307
305
 
308
- ### [ ] `sort`, `sort_by`
309
- ### [ ] argmin, argmax
310
- ### [ ] (array functions)
311
- ### [ ] (strings functions)
312
- ### [ ] (temporal functions)
313
- ### [ ] (conditional functions)
314
- ### [ ] (index functions)
315
- ### [ ] (other functions)
306
+ Returns quantiles for specified probabilities in a DataFrame.
307
+
308
+ ### `sort_indexes`, `sort_indices`, `array_sort_indices`
316
309
 
317
310
  ## Coerce
318
311
 
@@ -500,3 +493,28 @@ vector.is_in(1, -1)
500
493
  #<RedAmber::Vector(:boolean, size=3):0x000000000000f320>
501
494
  [true, false, true]
502
495
  ```
496
+
497
+ ### `shift(amount = 1, fill: nil)`
498
+
499
+ Shift vector's values by specified `amount`. Shifted space is filled by value `fill`.
500
+
501
+ ```ruby
502
+ vector = RedAmber::Vector.new([1, 2, 3, 4, 5])
503
+ vector.shift
504
+
505
+ # =>
506
+ #<RedAmber::Vector(:uint8, size=5):0x00000000000072d8>
507
+ [nil, 1, 2, 3, 4]
508
+
509
+ vector.shift(-2)
510
+
511
+ # =>
512
+ #<RedAmber::Vector(:uint8, size=5):0x0000000000009970>
513
+ [3, 4, 5, nil, nil]
514
+
515
+ vector.shift(fill: Float::NAN)
516
+
517
+ # =>
518
+ #<RedAmber::Vector(:double, size=5):0x0000000000011d3c>
519
+ [NaN, 1.0, 2.0, 3.0, 4.0]
520
+ ```