@@ -148,14 +148,15 @@ class StatisticsTests {
148148 " city" ,
149149 " name" ,
150150 " age" ,
151+ " weight" ,
151152 " height" ,
152- " yearsToRetirement"
153- ) // TODO: why double values from weight are not in the list? are they not Comparable?
153+ " yearsToRetirement" ,
154+ )
154155
155156 val median01 = res0[" age" ][0 ] as Int
156157 median01 shouldBe 22
157- // val median02 = res0["weight"][0] as Double
158- // median02 shouldBe 66.0
158+ // val median02 = res0["weight"][0] as Double
159+ // median02 shouldBe 66.0
159160
160161 // scenario #1: particular column
161162 val res1 = personsDf.groupBy(" city" ).medianFor(" age" )
@@ -276,14 +277,15 @@ class StatisticsTests {
276277 " city" ,
277278 " name" ,
278279 " age" ,
280+ " weight" ,
279281 " height" ,
280- " yearsToRetirement"
281- ) // TODO: why it's working for height and doesn't work for Double column weight
282+ " yearsToRetirement" ,
283+ )
282284
283285 val min01 = res0[" age" ][0 ] as Int
284286 min01 shouldBe 15
285- // val min02 = res0["weight"][0] as Double
286- // min02 shouldBe 38.85756039691633
287+ // val min02 = res0["weight"][0] as Double
288+ // min02 shouldBe 38.85756039691633
287289
288290 // scenario #1: particular column
289291 val res1 = personsDf.groupBy(" city" ).minFor(" age" )
@@ -342,7 +344,7 @@ class StatisticsTests {
342344 " age" ,
343345 " weight" ,
344346 " height" ,
345- " yearsToRetirement"
347+ " yearsToRetirement" ,
346348 ) // TODO: why is here weight presented? looks like inconsitency
347349
348350 val min41 = res4[" age" ][0 ] as Int
@@ -362,12 +364,12 @@ class StatisticsTests {
362364 fun `max on GroupBy` () {
363365 // scenario #0: all numerical columns
364366 val res0 = personsDf.groupBy(" city" ).max()
365- res0.columnNames() shouldBe listOf (" city" , " name" , " age" , " height" , " yearsToRetirement" ) // TODO: DOUBLE weight?
367+ res0.columnNames() shouldBe listOf (" city" , " name" , " age" , " weight " , " height" , " yearsToRetirement" )
366368
367369 val max01 = res0[" age" ][0 ] as Int
368370 max01 shouldBe 35
369- // val max02 = res0["weight"][0] as Double
370- // max02 shouldBe 140.0
371+ // val max02 = res0["weight"][0] as Double
372+ // max02 shouldBe 140.0
371373
372374 // scenario #1: particular column
373375 val res1 = personsDf.groupBy(" city" ).maxFor(" age" )
@@ -426,7 +428,7 @@ class StatisticsTests {
426428 " age" ,
427429 " weight" ,
428430 " height" ,
429- " yearsToRetirement"
431+ " yearsToRetirement" ,
430432 ) // TODO: weight is here?
431433
432434 val max41 = res4[" age" ][0 ] as Int
@@ -442,4 +444,3 @@ class StatisticsTests {
442444 max51 shouldBe 35
443445 }
444446}
445-
0 commit comments