Skip to content

Commit 02b749c

Browse files
authored
Merge pull request #350 from rianoc-kx/patch-2
Fix scov example and xrank description
2 parents a28e42a + 15344d6 commit 02b749c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/ref/cov.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Applies to all numeric data types and signals an error with temporal types, char
7474

7575
```q
7676
q)2 3 5 7 scov 3 3 5 9
77-
8
77+
6f
7878
q)2 3 5 7 scov 4 3 0 2
7979
-2.416667
8080
q)select price scov size by sym from trade

docs/ref/xrank.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ Where
2222

2323
returns for each item in `y` the bucket into which it falls, represented as a long from 0 to `x-1`.
2424

25-
If the total number of items is evenly divisible by `x`, then each bucket will have the same number of items; otherwise the first items of the result are longer.
25+
If the total number of items is evenly divisible by `x`, then each bucket will have the same number of items; otherwise some bucket sizes will differ by 1 dispersed throughout the result.
2626

2727
`xrank` is right-uniform.
2828

2929
```q
3030
q)4 xrank til 8 / equal size buckets
3131
0 0 1 1 2 2 3 3
32-
q)4 xrank til 9 / first bucket has extra
32+
q)4 xrank til 9 / 1 bucket size differs
3333
0 0 0 1 1 2 2 3 3
34+
q)7 xrank til 9 / multiple bucket sizes differ
35+
0 0 1 2 3 3 4 5 6
3436
q)
3537
q)3 xrank 1 37 5 4 0 3 / outlier 37 does not get its own bucket
3638
0 2 2 1 0 1

0 commit comments

Comments
 (0)