updates JenksTests to reflect expectations without nulls

This commit is contained in:
Andy Eschbacher 2017-12-06 08:10:09 -05:00
parent 2fe02d8154
commit 4b937de415
2 changed files with 26 additions and 22 deletions

View File

@ -1,11 +1,19 @@
WITH data AS (
SELECT array_agg(x::numeric) s FROM generate_series(1,300) x
WHERE x % 5 != 0 AND x % 7 != 0
SELECT Array[0.99, 1.0, 1.01,
4.99, 5.01,
10.01, 10.01,
15.01, 14.99,
20.1, 19.9]::numeric[] AS s
)
SELECT unnest(CDB_JenksBins(s, 7)) FROM data;
SELECT round(unnest(CDB_JenksBins(s, 5))) FROM data;
WITH data_nulls AS (
SELECT array_agg(CASE WHEN x % 2 != 0 THEN x ELSE NULL END::numeric) s FROM generate_series(1,300) x
WHERE x % 5 != 0 AND x % 7 != 0
SELECT Array[0.99, 1.0, 1.01,
4.99, 5.01,
null, null,
10.01, 10.01,
15.01, 14.99,
null, null,
20.1, 19.9]::numeric[] AS s
)
SELECT unnest(CDB_JenksBins(s, 7)) FROM data_nulls;
SELECT round(unnest(CDB_JenksBins(s, 5))) FROM data_nulls;

View File

@ -1,14 +1,10 @@
43
86
129
172
213
257
299
37
51
97
157
213
241
1
5
10
15
20
1
5
10
15
20