red_amber 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +58 -0
- data/README.md +38 -24
- data/doc/DataFrame.md +212 -80
- data/doc/Vector.md +7 -18
- data/doc/examples_of_red_amber.ipynb +2720 -524
- data/lib/red_amber/data_frame.rb +23 -4
- data/lib/red_amber/data_frame_displayable.rb +3 -3
- data/lib/red_amber/data_frame_reshaping.rb +10 -10
- data/lib/red_amber/data_frame_selectable.rb +53 -9
- data/lib/red_amber/data_frame_variable_operation.rb +44 -13
- data/lib/red_amber/vector.rb +1 -1
- data/lib/red_amber/vector_functions.rb +21 -24
- data/lib/red_amber/vector_selectable.rb +9 -8
- data/lib/red_amber/version.rb +1 -1
- metadata +2 -2
data/doc/DataFrame.md
CHANGED
@@ -155,7 +155,25 @@ Class `RedAmber::DataFrame` represents 2D-data. A `DataFrame` consists with:
|
|
155
155
|
|
156
156
|
### `indices`, `indexes`
|
157
157
|
|
158
|
-
- Returns
|
158
|
+
- Returns indexes in an Array.
|
159
|
+
Accepts an option `start` as the first of indexes.
|
160
|
+
|
161
|
+
```ruby
|
162
|
+
df = RedAmber::DataFrame.new(x: [1, 2, 3, 4, 5])
|
163
|
+
df.indices
|
164
|
+
|
165
|
+
# =>
|
166
|
+
[0, 1, 2, 3, 4]
|
167
|
+
|
168
|
+
df.indices(1)
|
169
|
+
|
170
|
+
# =>
|
171
|
+
[1, 2, 3, 4, 5]
|
172
|
+
|
173
|
+
df.indices(:a)
|
174
|
+
# =>
|
175
|
+
[:a, :b, :c, :d, :e]
|
176
|
+
```
|
159
177
|
|
160
178
|
### `to_h`
|
161
179
|
|
@@ -372,13 +390,13 @@ penguins.to_rover
|
|
372
390
|
|
373
391
|
### `pick ` - pick up variables by key label -
|
374
392
|
|
375
|
-
Pick up some
|
393
|
+
Pick up some columns (variables) to create a sub DataFrame.
|
376
394
|
|
377
395
|
![pick method image](doc/../image/dataframe/pick.png)
|
378
396
|
|
379
397
|
- Keys as arguments
|
380
398
|
|
381
|
-
`pick(keys)` accepts keys as arguments in an Array.
|
399
|
+
`pick(keys)` accepts keys as arguments in an Array or a Range.
|
382
400
|
|
383
401
|
```ruby
|
384
402
|
penguins.pick(:species, :bill_length_mm)
|
@@ -398,9 +416,31 @@ penguins.to_rover
|
|
398
416
|
344 Gentoo 49.9
|
399
417
|
```
|
400
418
|
|
401
|
-
-
|
419
|
+
- Indices as arguments
|
420
|
+
|
421
|
+
`pick(indices)` accepts indices as arguments. Indices should be Integers, Floats or Ranges of Integers.
|
422
|
+
|
423
|
+
```ruby
|
424
|
+
penguins.pick(0..2, -1)
|
425
|
+
|
426
|
+
# =>
|
427
|
+
#<RedAmber::DataFrame : 344 x 4 Vectors, 0x0000000000055ce4>
|
428
|
+
species island bill_length_mm year
|
429
|
+
<string> <string> <double> <uint16>
|
430
|
+
1 Adelie Torgersen 39.1 2007
|
431
|
+
2 Adelie Torgersen 39.5 2007
|
432
|
+
3 Adelie Torgersen 40.3 2007
|
433
|
+
4 Adelie Torgersen (nil) 2007
|
434
|
+
5 Adelie Torgersen 36.7 2007
|
435
|
+
: : : : :
|
436
|
+
342 Gentoo Biscoe 50.4 2009
|
437
|
+
343 Gentoo Biscoe 45.2 2009
|
438
|
+
344 Gentoo Biscoe 49.9 2009
|
439
|
+
```
|
440
|
+
|
441
|
+
- Booleans as arguments
|
402
442
|
|
403
|
-
`pick(booleans)` accepts booleans as
|
443
|
+
`pick(booleans)` accepts booleans as arguments in an Array. Booleans must be same length as `n_keys`.
|
404
444
|
|
405
445
|
```ruby
|
406
446
|
penguins.pick(penguins.types.map { |type| type == :string })
|
@@ -420,9 +460,9 @@ penguins.to_rover
|
|
420
460
|
344 Gentoo Biscoe male
|
421
461
|
```
|
422
462
|
|
423
|
-
|
463
|
+
- Keys or booleans by a block
|
424
464
|
|
425
|
-
`pick {block}` is also acceptable. We can't use both arguments and a block at a same time. The block should return keys, or a boolean Array with a same length as `n_keys`. Block is called in the context of self.
|
465
|
+
`pick {block}` is also acceptable. We can't use both arguments and a block at a same time. The block should return keys, indices or a boolean Array with a same length as `n_keys`. Block is called in the context of self.
|
426
466
|
|
427
467
|
```ruby
|
428
468
|
penguins.pick { keys.map { |key| key.end_with?('mm') } }
|
@@ -444,21 +484,25 @@ penguins.to_rover
|
|
444
484
|
|
445
485
|
### `drop ` - pick and drop -
|
446
486
|
|
447
|
-
Drop some
|
487
|
+
Drop some columns (variables) to create a remainer DataFrame.
|
448
488
|
|
449
489
|
![drop method image](doc/../image/dataframe/drop.png)
|
450
490
|
|
451
491
|
- Keys as arguments
|
452
492
|
|
453
|
-
`drop(keys)` accepts keys as arguments in an Array.
|
493
|
+
`drop(keys)` accepts keys as arguments in an Array or a Range.
|
494
|
+
|
495
|
+
- Indices as arguments
|
454
496
|
|
455
|
-
|
497
|
+
`drop(indices)` accepts indices as a arguments. Indices should be Integers, Floats or Ranges of Integers.
|
456
498
|
|
457
|
-
|
499
|
+
- Booleans as arguments
|
500
|
+
|
501
|
+
`drop(booleans)` accepts booleans as an argument in an Array. Booleans must be same length as `n_keys`.
|
458
502
|
|
459
503
|
- Keys or booleans by a block
|
460
504
|
|
461
|
-
`drop {block}` is also acceptable. We can't use both arguments and a block at a same time. The block should return keys, or a boolean Array with a same length as `n_keys`. Block is called in the context of self.
|
505
|
+
`drop {block}` is also acceptable. We can't use both arguments and a block at a same time. The block should return keys, indices or a boolean Array with a same length as `n_keys`. Block is called in the context of self.
|
462
506
|
|
463
507
|
- Notice for nil
|
464
508
|
|
@@ -493,9 +537,20 @@ penguins.to_rover
|
|
493
537
|
[1, 2, 3]
|
494
538
|
```
|
495
539
|
|
540
|
+
A simple key name is usable as a method of the DataFrame if the key name is acceptable as a method name.
|
541
|
+
It returns a Vector same as `[]`.
|
542
|
+
|
543
|
+
```ruby
|
544
|
+
df.a
|
545
|
+
|
546
|
+
# =>
|
547
|
+
#<RedAmber::Vector(:uint8, size=3):0x000000000000f258>
|
548
|
+
[1, 2, 3]
|
549
|
+
```
|
550
|
+
|
496
551
|
### `slice ` - to cut vertically is slice -
|
497
552
|
|
498
|
-
Slice and select
|
553
|
+
Slice and select rows (observations) to create a sub DataFrame.
|
499
554
|
|
500
555
|
![slice method image](doc/../image/dataframe/slice.png)
|
501
556
|
|
@@ -526,7 +581,7 @@ penguins.to_rover
|
|
526
581
|
|
527
582
|
- Booleans as an argument
|
528
583
|
|
529
|
-
`slice(booleans)` accepts booleans as
|
584
|
+
`slice(booleans)` accepts booleans as an argument in an Array, a Vector or an Arrow::BooleanArray . Booleans must be same length as `size`.
|
530
585
|
|
531
586
|
```ruby
|
532
587
|
vector = penguins[:bill_length_mm]
|
@@ -603,7 +658,7 @@ penguins.to_rover
|
|
603
658
|
|
604
659
|
### `remove`
|
605
660
|
|
606
|
-
Slice and reject
|
661
|
+
Slice and reject rows (observations) to create a remainer DataFrame.
|
607
662
|
|
608
663
|
![remove method image](doc/../image/dataframe/remove.png)
|
609
664
|
|
@@ -632,7 +687,7 @@ penguins.to_rover
|
|
632
687
|
|
633
688
|
- Booleans as an argument
|
634
689
|
|
635
|
-
`remove(booleans)` accepts booleans as
|
690
|
+
`remove(booleans)` accepts booleans as an argument in an Array, a Vector or an Arrow::BooleanArray . Booleans must be same length as `size`.
|
636
691
|
|
637
692
|
```ruby
|
638
693
|
# remove all observation contains nil
|
@@ -660,10 +715,12 @@ penguins.to_rover
|
|
660
715
|
|
661
716
|
```ruby
|
662
717
|
penguins.remove do
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
718
|
+
# We will use another style shown in slice
|
719
|
+
# self.bill_length_mm returns Vector
|
720
|
+
mean = bill_length_mm.mean
|
721
|
+
min = mean - bill_length_mm.std
|
722
|
+
max = mean + bill_length_mm.std
|
723
|
+
bill_length_mm.to_a.map { |e| (min..max).include? e }
|
667
724
|
end
|
668
725
|
|
669
726
|
# =>
|
@@ -680,6 +737,7 @@ penguins.to_rover
|
|
680
737
|
139 Gentoo Biscoe 50.4 15.7 222 ... 2009
|
681
738
|
140 Gentoo Biscoe 49.9 16.1 213 ... 2009
|
682
739
|
```
|
740
|
+
|
683
741
|
- Notice for nil
|
684
742
|
- When `remove` used with booleans, nil in booleans is treated as false. This behavior is aligned with Ruby's `nil#!`.
|
685
743
|
|
@@ -772,15 +830,19 @@ penguins.to_rover
|
|
772
830
|
|
773
831
|
# =>
|
774
832
|
#<RedAmber::DataFrame : 3 x 2 Vectors, 0x0000000000062804>
|
775
|
-
name age
|
776
|
-
<string> <uint8>
|
777
|
-
1 Yasuko 68
|
778
|
-
2 Rui 49
|
833
|
+
name age
|
834
|
+
<string> <uint8>
|
835
|
+
1 Yasuko 68
|
836
|
+
2 Rui 49
|
779
837
|
3 Hinata 28
|
780
838
|
|
781
839
|
# update :age and add :brother
|
782
|
-
|
783
|
-
|
840
|
+
df.assign do
|
841
|
+
{
|
842
|
+
age: age + 29,
|
843
|
+
brother: ['Santa', nil, 'Momotaro']
|
844
|
+
}
|
845
|
+
end
|
784
846
|
|
785
847
|
# =>
|
786
848
|
#<RedAmber::DataFrame : 3 x 3 Vectors, 0x00000000000658b0>
|
@@ -799,7 +861,8 @@ penguins.to_rover
|
|
799
861
|
df = RedAmber::DataFrame.new(
|
800
862
|
index: [0, 1, 2, 3, nil],
|
801
863
|
float: [0.0, 1.1, 2.2, Float::NAN, nil],
|
802
|
-
string: ['A', 'B', 'C', 'D', nil]
|
864
|
+
string: ['A', 'B', 'C', 'D', nil]
|
865
|
+
)
|
803
866
|
df
|
804
867
|
|
805
868
|
# =>
|
@@ -821,13 +884,13 @@ penguins.to_rover
|
|
821
884
|
|
822
885
|
# =>
|
823
886
|
#<RedAmber::DataFrame : 5 x 3 Vectors, 0x00000000000dfffc>
|
824
|
-
index float string
|
825
|
-
<uint8> <double> <string>
|
826
|
-
1 0 -0.0 A
|
827
|
-
2 1 -1.1 B
|
828
|
-
3 2 -2.2 C
|
829
|
-
4 3 NaN D
|
830
|
-
5 (nil) (nil) (nil)
|
887
|
+
index float string
|
888
|
+
<uint8> <double> <string>
|
889
|
+
1 0 -0.0 A
|
890
|
+
2 1 -1.1 B
|
891
|
+
3 2 -2.2 C
|
892
|
+
4 3 NaN D
|
893
|
+
5 (nil) (nil) (nil)
|
831
894
|
|
832
895
|
# Or we can use assigner by a Hash
|
833
896
|
df.assign do
|
@@ -852,7 +915,7 @@ penguins.to_rover
|
|
852
915
|
`assign_left` method accepts the same parameters and block as `assign`, but append new columns from leftside.
|
853
916
|
|
854
917
|
```ruby
|
855
|
-
df.assign_left(new_index:
|
918
|
+
df.assign_left(new_index: df.indices(1))
|
856
919
|
|
857
920
|
# =>
|
858
921
|
#<RedAmber::DataFrame : 5 x 4 Vectors, 0x000000000001787c>
|
@@ -865,6 +928,74 @@ penguins.to_rover
|
|
865
928
|
5 5 (nil) (nil) (nil)
|
866
929
|
```
|
867
930
|
|
931
|
+
### `slice_by(key, keep_key: false) { block }`
|
932
|
+
|
933
|
+
`slice_by` accepts a key and a block to select rows.
|
934
|
+
|
935
|
+
(Since 0.2.1)
|
936
|
+
|
937
|
+
```ruby
|
938
|
+
df = RedAmber::DataFrame.new(
|
939
|
+
index: [0, 1, 2, 3, nil],
|
940
|
+
float: [0.0, 1.1, 2.2, Float::NAN, nil],
|
941
|
+
string: ['A', 'B', 'C', 'D', nil]
|
942
|
+
)
|
943
|
+
df
|
944
|
+
|
945
|
+
# =>
|
946
|
+
#<RedAmber::DataFrame : 5 x 3 Vectors, 0x0000000000069e60>
|
947
|
+
index float string
|
948
|
+
<uint8> <double> <string>
|
949
|
+
1 0 0.0 A
|
950
|
+
2 1 1.1 B
|
951
|
+
3 2 2.2 C
|
952
|
+
4 3 NaN D
|
953
|
+
5 (nil) (nil) (nil)
|
954
|
+
|
955
|
+
df.slice_by(:string) { ["A", "C"] }
|
956
|
+
|
957
|
+
# =>
|
958
|
+
#<RedAmber::DataFrame : 2 x 2 Vectors, 0x000000000001b1ac>
|
959
|
+
index float
|
960
|
+
<uint8> <double>
|
961
|
+
1 0 0.0
|
962
|
+
2 2 2.2
|
963
|
+
```
|
964
|
+
|
965
|
+
It is the same behavior as;
|
966
|
+
|
967
|
+
```ruby
|
968
|
+
df.slice { [string.index("A"), string.index("C")] }.drop(:string)
|
969
|
+
```
|
970
|
+
|
971
|
+
`slice_by` also accepts a Range.
|
972
|
+
|
973
|
+
```ruby
|
974
|
+
df.slice_by(:string) { "A".."C" }
|
975
|
+
|
976
|
+
# =>
|
977
|
+
#<RedAmber::DataFrame : 3 x 2 Vectors, 0x0000000000069668>
|
978
|
+
index float
|
979
|
+
<uint8> <double>
|
980
|
+
1 0 0.0
|
981
|
+
2 1 1.1
|
982
|
+
3 2 2.2
|
983
|
+
```
|
984
|
+
|
985
|
+
When the option `keep_key: true` used, the column `key` will be preserved.
|
986
|
+
|
987
|
+
```ruby
|
988
|
+
df.slice_by(:string, keep_key: true) { "A".."C" }
|
989
|
+
|
990
|
+
# =>
|
991
|
+
#<RedAmber::DataFrame : 3 x 3 Vectors, 0x0000000000073c44>
|
992
|
+
index float string
|
993
|
+
<uint8> <double> <string>
|
994
|
+
1 0 0.0 A
|
995
|
+
2 1 1.1 B
|
996
|
+
3 2 2.2 C
|
997
|
+
```
|
998
|
+
|
868
999
|
## Updating
|
869
1000
|
|
870
1001
|
### `sort`
|
@@ -874,11 +1005,11 @@ penguins.to_rover
|
|
874
1005
|
- "-key" denotes descending order
|
875
1006
|
|
876
1007
|
```ruby
|
877
|
-
df = RedAmber::DataFrame.new(
|
1008
|
+
df = RedAmber::DataFrame.new(
|
878
1009
|
index: [1, 1, 0, nil, 0],
|
879
1010
|
string: ['C', 'B', nil, 'A', 'B'],
|
880
1011
|
bool: [nil, true, false, true, false],
|
881
|
-
|
1012
|
+
)
|
882
1013
|
df.sort(:index, '-bool')
|
883
1014
|
|
884
1015
|
# =>
|
@@ -1035,7 +1166,7 @@ penguins.to_rover
|
|
1035
1166
|
|
1036
1167
|
### `transpose`
|
1037
1168
|
|
1038
|
-
Creates transposed DataFrame for wide
|
1169
|
+
Creates transposed DataFrame for the wide (messy) dataframe.
|
1039
1170
|
|
1040
1171
|
```ruby
|
1041
1172
|
import_cars = RedAmber::DataFrame.load('test/entity/import_cars.tsv')
|
@@ -1044,31 +1175,30 @@ penguins.to_rover
|
|
1044
1175
|
#<RedAmber::DataFrame : 5 x 6 Vectors, 0x000000000000d520>
|
1045
1176
|
Year Audi BMW BMW_MINI Mercedes-Benz VW
|
1046
1177
|
<int64> <int64> <int64> <int64> <int64> <int64>
|
1047
|
-
1
|
1048
|
-
2
|
1178
|
+
1 2017 28336 52527 25427 68221 49040
|
1179
|
+
2 2018 26473 50982 25984 67554 51961
|
1049
1180
|
3 2019 24222 46814 23813 66553 46794
|
1050
|
-
4
|
1051
|
-
5
|
1052
|
-
|
1053
|
-
import_cars.transpose
|
1181
|
+
4 2020 22304 35712 20196 57041 36576
|
1182
|
+
5 2021 22535 35905 18211 51722 35215
|
1183
|
+
import_cars.transpose(:Manufacturer)
|
1054
1184
|
|
1055
1185
|
# =>
|
1056
1186
|
#<RedAmber::DataFrame : 5 x 6 Vectors, 0x000000000000ef74>
|
1057
|
-
|
1058
|
-
<dictionary> <
|
1059
|
-
1 Audi
|
1060
|
-
2 BMW
|
1061
|
-
3 BMW_MINI
|
1062
|
-
4 Mercedes-Benz
|
1063
|
-
5 VW
|
1187
|
+
Manufacturer 2017 2018 2019 2020 2021
|
1188
|
+
<dictionary> <uint32> <uint32> <uint32> <uint16> <uint16>
|
1189
|
+
1 Audi 28336 26473 24222 22304 22535
|
1190
|
+
2 BMW 52527 50982 46814 35712 35905
|
1191
|
+
3 BMW_MINI 25427 25984 23813 20196 18211
|
1192
|
+
4 Mercedes-Benz 68221 67554 66553 57041 51722
|
1193
|
+
5 VW 49040 51961 46794 36576 35215
|
1064
1194
|
```
|
1065
1195
|
|
1066
1196
|
The leftmost column is created by original keys. Key name of the column is
|
1067
|
-
named by
|
1197
|
+
named by parameter `:name`. If `:name` is not specified, `:N` is used for the key.
|
1068
1198
|
|
1069
1199
|
### `to_long(*keep_keys)`
|
1070
1200
|
|
1071
|
-
Creates a 'long' DataFrame.
|
1201
|
+
Creates a 'long' (tidy) DataFrame from a 'wide' DataFrame.
|
1072
1202
|
|
1073
1203
|
- Parameter `keep_keys` specifies the key names to keep.
|
1074
1204
|
|
@@ -1077,21 +1207,21 @@ penguins.to_rover
|
|
1077
1207
|
|
1078
1208
|
# =>
|
1079
1209
|
#<RedAmber::DataFrame : 25 x 3 Vectors, 0x0000000000012750>
|
1080
|
-
Year
|
1210
|
+
Year N V
|
1081
1211
|
<uint16> <dictionary> <uint32>
|
1082
|
-
1
|
1083
|
-
2
|
1084
|
-
3
|
1085
|
-
4
|
1086
|
-
5
|
1212
|
+
1 2017 Audi 28336
|
1213
|
+
2 2017 BMW 52527
|
1214
|
+
3 2017 BMW_MINI 25427
|
1215
|
+
4 2017 Mercedes-Benz 68221
|
1216
|
+
5 2017 VW 49040
|
1087
1217
|
: : : :
|
1088
|
-
23
|
1089
|
-
24
|
1090
|
-
25
|
1218
|
+
23 2021 BMW_MINI 18211
|
1219
|
+
24 2021 Mercedes-Benz 51722
|
1220
|
+
25 2021 VW 35215
|
1091
1221
|
```
|
1092
1222
|
|
1093
|
-
- Option `:name`
|
1094
|
-
- Option `:value`
|
1223
|
+
- Option `:name` is the key of the column which came **from key names**.
|
1224
|
+
- Option `:value` is the key of the column which came **from values**.
|
1095
1225
|
|
1096
1226
|
```ruby
|
1097
1227
|
import_cars.to_long(:Year, name: :Manufacturer, value: :Num_of_imported)
|
@@ -1100,38 +1230,40 @@ penguins.to_rover
|
|
1100
1230
|
#<RedAmber::DataFrame : 25 x 3 Vectors, 0x0000000000017700>
|
1101
1231
|
Year Manufacturer Num_of_imported
|
1102
1232
|
<uint16> <dictionary> <uint32>
|
1103
|
-
1
|
1104
|
-
2
|
1105
|
-
3
|
1106
|
-
4
|
1107
|
-
5
|
1233
|
+
1 2017 Audi 28336
|
1234
|
+
2 2017 BMW 52527
|
1235
|
+
3 2017 BMW_MINI 25427
|
1236
|
+
4 2017 Mercedes-Benz 68221
|
1237
|
+
5 2017 VW 49040
|
1108
1238
|
: : : :
|
1109
|
-
23
|
1110
|
-
24
|
1111
|
-
25
|
1239
|
+
23 2021 BMW_MINI 18211
|
1240
|
+
24 2021 Mercedes-Benz 51722
|
1241
|
+
25 2021 VW 35215
|
1112
1242
|
```
|
1113
1243
|
|
1114
1244
|
### `to_wide`
|
1115
1245
|
|
1116
|
-
Creates a 'wide' DataFrame.
|
1246
|
+
Creates a 'wide' (messy) DataFrame from a 'long' DataFrame.
|
1117
1247
|
|
1118
|
-
- Option `:name`
|
1119
|
-
- Option `:value`
|
1248
|
+
- Option `:name` is the key of the column which will be expanded **to key names**.
|
1249
|
+
- Option `:value` is the key of the column which will be expanded **to values**.
|
1120
1250
|
|
1121
1251
|
```ruby
|
1122
1252
|
import_cars.to_long(:Year).to_wide
|
1123
|
-
# import_cars.to_long(:Year).to_wide(name: :
|
1253
|
+
# import_cars.to_long(:Year).to_wide(name: :N, value: :V)
|
1124
1254
|
# is also OK
|
1125
1255
|
|
1126
1256
|
# =>
|
1127
1257
|
#<RedAmber::DataFrame : 5 x 6 Vectors, 0x000000000000f0f0>
|
1128
1258
|
Year Audi BMW BMW_MINI Mercedes-Benz VW
|
1129
1259
|
<uint16> <uint16> <uint16> <uint16> <uint32> <uint16>
|
1130
|
-
1
|
1131
|
-
2
|
1260
|
+
1 2017 28336 52527 25427 68221 49040
|
1261
|
+
2 2018 26473 50982 25984 67554 51961
|
1132
1262
|
3 2019 24222 46814 23813 66553 46794
|
1133
|
-
4
|
1134
|
-
5
|
1263
|
+
4 2020 22304 35712 20196 57041 36576
|
1264
|
+
5 2021 22535 35905 18211 51722 35215
|
1265
|
+
|
1266
|
+
# == import_cars
|
1135
1267
|
```
|
1136
1268
|
|
1137
1269
|
## Combine
|
data/doc/Vector.md
CHANGED
@@ -187,8 +187,8 @@ boolean.all(skip_nulls: false) #=> false
|
|
187
187
|
| ✓ `-@` | | ✓ | | |as `-vector`|
|
188
188
|
| ✓ `negate` | | ✓ | | |`-@` |
|
189
189
|
| ✓ `abs` | | ✓ | | | |
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
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.
|
@@ -309,15 +307,6 @@ double.round(n_digits: -1)
|
|
309
307
|
|
310
308
|
### `sort_indexes`, `sort_indices`, `array_sort_indices`
|
311
309
|
|
312
|
-
### [ ] `sort`, `sort_by`
|
313
|
-
### [ ] argmin, argmax
|
314
|
-
### [ ] (array functions)
|
315
|
-
### [ ] (strings functions)
|
316
|
-
### [ ] (temporal functions)
|
317
|
-
### [ ] (conditional functions)
|
318
|
-
### [ ] (index functions)
|
319
|
-
### [ ] (other functions)
|
320
|
-
|
321
310
|
## Coerce
|
322
311
|
|
323
312
|
```ruby
|