@@ -225,33 +225,37 @@ class PercentileTests {
225225 @[Test Suppress (" ktlint:standard:argument-list-wrapping" )]
226226 fun `dataframe percentile` () {
227227 val df = dataFrameOf(
228- " a" , " b" , " c" ,
228+ " a" , " b" , " c" , " d " ,
229229 )(
230- 1 , 2f , 3.0 ,
231- 4 , 5f , 6.0 ,
232- 7 , 8f , 9.0 ,
230+ 1 , 2f , 3.0 , 1 .toBigInteger(),
231+ 4 , 5f , 6.0 , 2 .toBigInteger(),
232+ 7 , 8f , 9.0 , 4 .toBigInteger(),
233233 )
234234
235235 // Get row with percentile values for each column
236236 val percentiles50 = df.percentile(50.0 )
237- percentiles50[" a" ] shouldBe 4
238- percentiles50[" b" ] shouldBe 5f
237+ percentiles50[" a" ] shouldBe 4.0
238+ percentiles50[" b" ] shouldBe 5.0
239239 percentiles50[" c" ] shouldBe 6.0
240+ percentiles50[" d" ] shouldBe 2 .toBigInteger() // not interpolated!
240241
241242 val percentiles25 = df.percentile(25.0 )
242243 percentiles25[" a" ] shouldBe 1.5000000000000002
243- percentiles25[" b" ] shouldBe 2.5f
244+ percentiles25[" b" ] shouldBe 2.5
244245 percentiles25[" c" ] shouldBe 3.5
246+ percentiles25[" d" ] shouldBe 1 .toBigInteger() // not interpolated!
245247
246248 val percentiles75 = df.percentile(75.0 )
247249 percentiles75[" a" ] shouldBe 6.5
248- percentiles75[" b" ] shouldBe 7.5f
250+ percentiles75[" b" ] shouldBe 7.5
249251 percentiles75[" c" ] shouldBe 8.5
252+ percentiles75[" d" ] shouldBe 2 .toBigInteger() // not interpolated!
250253
251254 // Test percentile for specific columns
252- val percentileFor50 = df.percentileFor(50.0 , " a" , " c" )
253- percentileFor50[" a" ] shouldBe 4
255+ val percentileFor50 = df.percentileFor(50.0 , " a" , " c" , " d " )
256+ percentileFor50[" a" ] shouldBe 4.0
254257 percentileFor50[" c" ] shouldBe 6.0
258+ percentileFor50[" d" ] shouldBe 2 .toBigInteger() // not interpolated!
255259 }
256260
257261 @[Test Suppress (" ktlint:standard:argument-list-wrapping" )]
0 commit comments