Skip to content

Commit cfa9b4a

Browse files
committed
remaining docs for Nulls.kt
1 parent b87085d commit cfa9b4a

File tree

8 files changed

+594
-52
lines changed

8 files changed

+594
-52
lines changed

core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ plugins {
1414
id("org.jetbrains.kotlinx.kover")
1515
id("org.jmailen.kotlinter")
1616
id("org.jetbrains.kotlinx.dataframe")
17-
id("com.github.jolanrensen.docProcessorGradlePlugin") version "v0.1.0"
18-
// id("nl.jolanrensen.docProcessor") version "1.0-SNAPSHOT"
17+
// id("com.github.jolanrensen.docProcessorGradlePlugin") version "v0.1.0"
18+
id("nl.jolanrensen.docProcessor") version "0.1.1"
1919
}
2020

2121
group = "org.jetbrains.kotlinx"

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/DataColumnArithmetics.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ public infix fun <T> DataColumn<T>.neq(value: T): DataColumn<Boolean> = isMatchi
108108
public infix fun <T : Comparable<T>> DataColumn<T>.gt(value: T): DataColumn<Boolean> = isMatching { it > value }
109109
public infix fun <T : Comparable<T>> DataColumn<T>.lt(value: T): DataColumn<Boolean> = isMatching { it < value }
110110

111-
internal infix fun <T> DataColumn<T>.isMatching(predicate: Predicate<T>): DataColumn<Boolean> = map { predicate(it) }
111+
internal fun <T> DataColumn<T>.isMatching(predicate: Predicate<T>): DataColumn<Boolean> = map { predicate(it) }

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt

Lines changed: 401 additions & 16 deletions
Large diffs are not rendered by default.

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/flatten.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@ package org.jetbrains.kotlinx.dataframe.api
22

33
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
44
import org.jetbrains.kotlinx.dataframe.DataFrame
5+
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
56
import org.jetbrains.kotlinx.dataframe.impl.api.flattenImpl
7+
import org.jetbrains.kotlinx.dataframe.impl.columns.toColumns
8+
import kotlin.reflect.KProperty
69

710
// region DataFrame
811

912
public fun <T> DataFrame<T>.flatten(): DataFrame<T> = flatten { all() }
1013

11-
public fun <T, C> DataFrame<T>.flatten(
12-
columns: ColumnsSelector<T, C>
13-
): DataFrame<T> = flattenImpl(columns)
14+
public fun <T, C> DataFrame<T>.flatten(columns: ColumnsSelector<T, C>): DataFrame<T> = flattenImpl(columns)
15+
16+
public fun <T> DataFrame<T>.flatten(vararg columns: String): DataFrame<T> = flattenImpl { columns.toColumns() }
17+
18+
public fun <T, C> DataFrame<T>.flatten(vararg columns: KProperty<C>): DataFrame<T> = flattenImpl { columns.toColumns() }
19+
20+
public fun <T, C> DataFrame<T>.flatten(vararg columns: ColumnReference<C>): DataFrame<T> =
21+
flattenImpl { columns.toColumns() }
1422

1523
// endregion

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/group.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public fun <T> DataFrame<T>.group(vararg columns: KProperty<*>): GroupClause<T,
2222
@JvmName("intoString")
2323
@OverloadResolutionByLambdaReturnType
2424
@OptIn(ExperimentalTypeInference::class)
25-
public infix fun <T, C> GroupClause<T, C>.into(column: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> String): DataFrame<T> = df.move(columns).under { column(it).toColumnAccessor() }
25+
public fun <T, C> GroupClause<T, C>.into(column: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> String): DataFrame<T> = df.move(columns).under { column(it).toColumnAccessor() }
2626

2727
@JvmName("intoColumn")
28-
public infix fun <T, C> GroupClause<T, C>.into(column: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> AnyColumnReference): DataFrame<T> = df.move(columns).under(column)
29-
public infix fun <T, C> GroupClause<T, C>.into(column: String): DataFrame<T> = into(columnGroup().named(column))
30-
public infix fun <T, C> GroupClause<T, C>.into(column: AnyColumnGroupAccessor): DataFrame<T> = df.move(columns).under(column)
31-
public infix fun <T, C> GroupClause<T, C>.into(column: KProperty<*>): DataFrame<T> = into(column.columnName)
28+
public fun <T, C> GroupClause<T, C>.into(column: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> AnyColumnReference): DataFrame<T> = df.move(columns).under(column)
29+
public fun <T, C> GroupClause<T, C>.into(column: String): DataFrame<T> = into(columnGroup().named(column))
30+
public fun <T, C> GroupClause<T, C>.into(column: AnyColumnGroupAccessor): DataFrame<T> = df.move(columns).under(column)
31+
public fun <T, C> GroupClause<T, C>.into(column: KProperty<*>): DataFrame<T> = into(column.columnName)
3232

3333
// endregion

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C> = where { in
340340
* - [Update per col][org.jetbrains.kotlinx.dataframe.api.Update.perCol] to provide a new value for every selected cell giving its column.
341341
* @param expression The [Row Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression] to provide a new value for every selected cell giving its row and column.
342342
*/
343-
public infix fun <T, C> Update<T, C>.perRowCol(expression: RowColumnExpression<T, C, C>): DataFrame<T> =
343+
public fun <T, C> Update<T, C>.perRowCol(expression: RowColumnExpression<T, C, C>): DataFrame<T> =
344344
updateImpl { row, column, _ -> expression(row, column) }
345345

346346
/** [Update per row col][Update.perRowCol] to provide a new value for every selected cell giving its row and column. */
@@ -374,7 +374,7 @@ public typealias UpdateExpression<T, C, R> = AddDataRow<T>.(C) -> R
374374
* - [Update per row col][org.jetbrains.kotlinx.dataframe.api.Update.perRowCol] to provide a new value for every selected cell giving its row and column.
375375
* @param expression The [Row Value Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowValueExpression.WithExample] to update the rows with.
376376
*/
377-
public infix fun <T, C> Update<T, C>.with(expression: UpdateExpression<T, C, C?>): DataFrame<T> =
377+
public fun <T, C> Update<T, C>.with(expression: UpdateExpression<T, C, C?>): DataFrame<T> =
378378
updateImpl { row, _, value ->
379379
expression(row, value)
380380
}
@@ -394,7 +394,7 @@ private interface SeeAlsoWith
394394
* .`[asFrame][org.jetbrains.kotlinx.dataframe.api.asFrame]}
395395
* @param expression The [Data Frame Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenDataFrame.DataFrameExpression] to replace the selected column group with.
396396
*/
397-
public infix fun <T, C, R> Update<T, DataRow<C>>.asFrame(expression: DataFrameExpression<C, DataFrame<R>>): DataFrame<T> =
397+
public fun <T, C, R> Update<T, DataRow<C>>.asFrame(expression: DataFrameExpression<C, DataFrame<R>>): DataFrame<T> =
398398
asFrameImpl(expression)
399399

400400
@Deprecated(
@@ -758,4 +758,4 @@ public fun <T, C> Update<T, C>.withZero(): DataFrame<T> = updateWithValuePerColu
758758
*
759759
* @param value The value to set the selected rows to. In contrast to [with][Update.with], this must be the same exact type.
760760
*/
761-
public infix fun <T, C> Update<T, C>.withValue(value: C): DataFrame<T> = with { value }
761+
public fun <T, C> Update<T, C>.withValue(value: C): DataFrame<T> = with { value }

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/html.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ internal fun String.escapeHTML(): String {
261261
val str = this
262262
return buildString {
263263
for (c in str) {
264-
if (c.code > 127 || c == '"' || c == '\'' || c == '<' || c == '>' || c == '&') {
264+
if (c.code > 127 || c == '"' || c == '\'' || c == '<' || c == '>' || c == '&' || c == '\\') {
265265
append("&#")
266266
append(c.code)
267267
append(';')

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt

Lines changed: 169 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.toColumns
1010
import kotlin.reflect.KProperty
1111

1212
/**
13+
* ## `NaN`
1314
* [Floats][Float] or [Doubles][Double] can be represented as [Float.NaN] or [Double.NaN], respectively,
1415
* in cases where a mathematical operation is undefined, such as dividing by zero.
1516
*
@@ -21,6 +22,7 @@ import kotlin.reflect.KProperty
2122
internal interface NaN
2223

2324
/**
25+
* ## `NA`
2426
* `NA` in Dataframe can be seen as "[NaN] or `null`".
2527
*
2628
* [Floats][Float] or [Doubles][Double] can be represented as [Float.NaN] or [Double.NaN], respectively,
@@ -263,13 +265,21 @@ public fun <T, C> DataFrame<T>.fillNA(columns: Iterable<ColumnReference<C>>): Up
263265
/** @param columns The {@include [SelectingColumns.DslLink]} used to select the columns of this [DataFrame] to drop rows in. */
264266
private interface DropDslParam
265267

268+
/** @param columns The {@include [SelectingColumns.KPropertiesLink]} used to select the columns of this [DataFrame] to drop rows in. */
269+
private interface DropKPropertiesParam
270+
271+
/** @param columns The {@include [SelectingColumns.ColumnNamesLink]} used to select the columns of this [DataFrame] to drop rows in. */
272+
private interface DropColumnNamesParam
273+
274+
/** @param columns The {@include [SelectingColumns.ColumnAccessors]} used to select the columns of this [DataFrame] to drop rows in. */
275+
private interface DropColumnAccessorsParam
266276

267277
// region dropNulls
268278

269279
/**
270280
* ## The Drop Nulls Operation
271281
*
272-
* Removes rows with `null` values.
282+
* Removes rows with `null` values. Specific case of [drop][DataFrame.drop].
273283
*
274284
* Optionally, you can select which columns to operate on (see {@include [SelectingColumnsLink]}).
275285
* Also, you can supply `whereAllNull = true` to only drop rows where all selected cells are `null`. By default,
@@ -300,7 +310,6 @@ private interface CommonDropNullsFunctionDoc
300310
* @include [CommonDropNullsFunctionDoc]
301311
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNullsOperationArg]}
302312
* `df.`[dropNulls][dropNulls]`(whereAllNull = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }`
303-
*
304313
* @include [DropNulls.WhereAllNullParam]
305314
* @include [DropDslParam]
306315
*/
@@ -323,7 +332,7 @@ public fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false): DataFrame<
323332
* @include [SelectingColumns.KProperties.WithExample] {@include [SetDropNullsOperationArg]}
324333
* `df.`[dropNulls][dropNulls]`(Person::length, whereAllNull = true)`
325334
* @include [DropNulls.WhereAllNullParam]
326-
* @include [DropDslParam]
335+
* @include [DropKPropertiesParam]
327336
*/
328337
public fun <T> DataFrame<T>.dropNulls(vararg columns: KProperty<*>, whereAllNull: Boolean = false): DataFrame<T> =
329338
dropNulls(whereAllNull) { columns.toColumns() }
@@ -333,7 +342,7 @@ public fun <T> DataFrame<T>.dropNulls(vararg columns: KProperty<*>, whereAllNull
333342
* @include [SelectingColumns.ColumnNames.WithExample] {@include [SetDropNullsOperationArg]}
334343
* `df.`[dropNulls][dropNulls]`("length", whereAllNull = true)`
335344
* @include [DropNulls.WhereAllNullParam]
336-
* @include [DropDslParam]
345+
* @include [DropColumnNamesParam]
337346
*/
338347
public fun <T> DataFrame<T>.dropNulls(vararg columns: String, whereAllNull: Boolean = false): DataFrame<T> =
339348
dropNulls(whereAllNull) { columns.toColumns() }
@@ -343,7 +352,7 @@ public fun <T> DataFrame<T>.dropNulls(vararg columns: String, whereAllNull: Bool
343352
* @include [SelectingColumns.ColumnAccessors.WithExample] {@include [SetDropNullsOperationArg]}
344353
* `df.`[dropNulls][dropNulls]`(length, whereAllNull = true)`
345354
* @include [DropNulls.WhereAllNullParam]
346-
* @include [DropDslParam]
355+
* @include [DropColumnAccessorsParam]
347356
*/
348357
public fun <T> DataFrame<T>.dropNulls(vararg columns: AnyColumnReference, whereAllNull: Boolean = false): DataFrame<T> =
349358
dropNulls(whereAllNull) { columns.toColumns() }
@@ -353,7 +362,7 @@ public fun <T> DataFrame<T>.dropNulls(vararg columns: AnyColumnReference, whereA
353362
*/
354363
public fun <T> DataFrame<T>.dropNulls(
355364
columns: Iterable<AnyColumnReference>,
356-
whereAllNull: Boolean = false
365+
whereAllNull: Boolean = false,
357366
): DataFrame<T> =
358367
dropNulls(whereAllNull) { columns.toColumnSet() }
359368

@@ -369,28 +378,98 @@ public fun <T> DataColumn<T?>.dropNulls(): DataColumn<T> =
369378

370379
// region dropNA
371380

372-
public fun <T> DataFrame<T>.dropNA(whereAllNA: Boolean = false, selector: ColumnsSelector<T, *>): DataFrame<T> {
373-
val columns = this[selector]
381+
/**
382+
* ## The Drop `NA` Operation
383+
*
384+
* Removes rows with [`NA`][NA] values. Specific case of [drop][DataFrame.drop].
385+
*
386+
* Optionally, you can select which columns to operate on (see {@include [SelectingColumnsLink]}).
387+
* Also, you can supply `whereAllNA = true` to only drop rows where all selected cells are [`NA`][NA]. By default,
388+
* rows are dropped if any of the selected cells are [`NA`][NA].
389+
*
390+
* For more information: {@include [DocumentationUrls.Drop.DropNA]}
391+
*/
392+
internal interface DropNA {
393+
394+
/**
395+
* @param whereAllNA `false` by default.
396+
* If `true`, rows are dropped if all selected cells are [`NA`][NA].
397+
* If `false`, rows are dropped if any of the selected cells is [`NA`][NA].
398+
*/
399+
interface WhereAllNAParam
400+
}
401+
402+
/** {@arg [SelectingColumns.OperationArg] [dropNA][dropNA]} */
403+
private interface SetDropNAOperationArg
404+
405+
/**
406+
* @include [DropNA] {@comment Description of the dropNA operation.}
407+
* ## This Drop NA Overload
408+
*/
409+
private interface CommonDropNAFunctionDoc
374410

375-
return if (whereAllNA) drop { columns.all { this[it].isNA } }
376-
else drop { columns.any { this[it].isNA } }
411+
/**
412+
* @include [CommonDropNAFunctionDoc]
413+
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNAOperationArg]}
414+
* `df.`[dropNA][dropNA]`(whereAllNA = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }`
415+
* @include [DropNA.WhereAllNAParam]
416+
* @include [DropDslParam]
417+
*/
418+
public fun <T> DataFrame<T>.dropNA(whereAllNA: Boolean = false, columns: ColumnsSelector<T, *>): DataFrame<T> {
419+
val cols = this[columns]
420+
return if (whereAllNA) drop { cols.all { this[it].isNA } }
421+
else drop { cols.any { this[it].isNA } }
377422
}
378423

424+
/**
425+
* @include [CommonDropNAFunctionDoc]
426+
* @include [SelectingColumns.KProperties.WithExample] {@include [SetDropNAOperationArg]}
427+
* `df.`[dropNA][dropNA]`(Person::length, whereAllNA = true)`
428+
* @include [DropNA.WhereAllNAParam]
429+
* @include [DropKPropertiesParam]
430+
*/
379431
public fun <T> DataFrame<T>.dropNA(vararg columns: KProperty<*>, whereAllNA: Boolean = false): DataFrame<T> =
380432
dropNA(whereAllNA) { columns.toColumns() }
381433

434+
/**
435+
* @include [CommonDropNAFunctionDoc]
436+
* @include [SelectingColumns.ColumnNames.WithExample] {@include [SetDropNAOperationArg]}
437+
* `df.`[dropNA][dropNA]`("length", whereAllNA = true)`
438+
* @include [DropNA.WhereAllNAParam]
439+
* @include [DropColumnNamesParam]
440+
*/
382441
public fun <T> DataFrame<T>.dropNA(vararg columns: String, whereAllNA: Boolean = false): DataFrame<T> =
383442
dropNA(whereAllNA) { columns.toColumns() }
384443

444+
/**
445+
* @include [CommonDropNAFunctionDoc]
446+
* @include [SelectingColumns.ColumnAccessors.WithExample] {@include [SetDropNAOperationArg]}
447+
* `df.`[dropNA][dropNA]`(length, whereAllNA = true)`
448+
* @include [DropNA.WhereAllNAParam]
449+
* @include [DropColumnAccessorsParam]
450+
*/
385451
public fun <T> DataFrame<T>.dropNA(vararg columns: AnyColumnReference, whereAllNA: Boolean = false): DataFrame<T> =
386452
dropNA(whereAllNA) { columns.toColumns() }
387453

454+
/**
455+
* TODO will be deprecated
456+
*/
388457
public fun <T> DataFrame<T>.dropNA(columns: Iterable<AnyColumnReference>, whereAllNA: Boolean = false): DataFrame<T> =
389458
dropNA(whereAllNA) { columns.toColumnSet() }
390459

460+
/**
461+
* @include [CommonDropNAFunctionDoc]
462+
* This overload operates on all columns in the [DataFrame].
463+
* @include [DropNA.WhereAllNAParam]
464+
*/
391465
public fun <T> DataFrame<T>.dropNA(whereAllNA: Boolean = false): DataFrame<T> =
392466
dropNA(whereAllNA) { all() }
393467

468+
/**
469+
* ## The Drop `NA` Operation
470+
*
471+
* Removes [`NA`][NA] values from this [DataColumn], adjusting the type accordingly.
472+
*/
394473
public fun <T> DataColumn<T?>.dropNA(): DataColumn<T> =
395474
when (typeClass) {
396475
Double::class, Float::class -> filter { !it.isNA }.cast()
@@ -401,28 +480,98 @@ public fun <T> DataColumn<T?>.dropNA(): DataColumn<T> =
401480

402481
// region dropNaNs
403482

404-
public fun <T> DataFrame<T>.dropNaNs(whereAllNaN: Boolean = false, selector: ColumnsSelector<T, *>): DataFrame<T> {
405-
val cols = this[selector]
483+
/**
484+
* ## The Drop `NaN` Operation
485+
*
486+
* Removes rows with [`NaN`][Double.isNaN] values. Specific case of [drop][DataFrame.drop].
487+
*
488+
* Optionally, you can select which columns to operate on (see {@include [SelectingColumnsLink]}).
489+
* Also, you can supply `whereAllNaN = true` to only drop rows where all selected cells are [`NaN`][Double.isNaN]. By default,
490+
* rows are dropped if any of the selected cells are [`NaN`][Double.isNaN].
491+
*
492+
* For more information: {@include [DocumentationUrls.Drop.DropNaNs]}
493+
*/
494+
internal interface DropNaNs {
495+
496+
/**
497+
* @param whereAllNaN `false` by default.
498+
* If `true`, rows are dropped if all selected cells are [`NaN`][Double.isNaN].
499+
* If `false`, rows are dropped if any of the selected cells is [`NaN`][Double.isNaN].
500+
*/
501+
interface WhereAllNaNParam
502+
}
503+
504+
/** {@arg [SelectingColumns.OperationArg] [dropNaNs][dropNaNs]} */
505+
private interface SetDropNaNsOperationArg
406506

507+
/**
508+
* @include [DropNaNs] {@comment Description of the dropNaNs operation.}
509+
* ## This Drop NaNs Overload
510+
*/
511+
private interface CommonDropNaNsFunctionDoc
512+
513+
/**
514+
* @include [CommonDropNaNsFunctionDoc]
515+
* @include [SelectingColumns.Dsl.WithExample] {@include [SetDropNaNsOperationArg]}
516+
* `df.`[dropNaNs][dropNaNs]`(whereAllNaN = true) { `[colsOf][colsOf]`<`[Double][Double]`>() }`
517+
* @include [DropNaNs.WhereAllNaNParam]
518+
* @include [DropDslParam]
519+
*/
520+
public fun <T> DataFrame<T>.dropNaNs(whereAllNaN: Boolean = false, columns: ColumnsSelector<T, *>): DataFrame<T> {
521+
val cols = this[columns]
407522
return if (whereAllNaN) drop { cols.all { this[it].isNaN } }
408523
else drop { cols.any { this[it].isNaN } }
409524
}
410525

411-
public fun <T> DataFrame<T>.dropNaNs(vararg cols: KProperty<*>, whereAllNaN: Boolean = false): DataFrame<T> =
412-
dropNaNs(whereAllNaN) { cols.toColumns() }
526+
/**
527+
* @include [CommonDropNaNsFunctionDoc]
528+
* @include [SelectingColumns.KProperties.WithExample] {@include [SetDropNaNsOperationArg]}
529+
* `df.`[dropNaNs][dropNaNs]`(Person::length, whereAllNaN = true)`
530+
* @include [DropNaNs.WhereAllNaNParam]
531+
* @include [DropKPropertiesParam]
532+
*/
533+
public fun <T> DataFrame<T>.dropNaNs(vararg columns: KProperty<*>, whereAllNaN: Boolean = false): DataFrame<T> =
534+
dropNaNs(whereAllNaN) { columns.toColumns() }
413535

414-
public fun <T> DataFrame<T>.dropNaNs(vararg cols: String, whereAllNaN: Boolean = false): DataFrame<T> =
415-
dropNaNs(whereAllNaN) { cols.toColumns() }
536+
/**
537+
* @include [CommonDropNaNsFunctionDoc]
538+
* @include [SelectingColumns.ColumnNames.WithExample] {@include [SetDropNaNsOperationArg]}
539+
* `df.`[dropNaNs][dropNaNs]`("length", whereAllNaN = true)`
540+
* @include [DropNaNs.WhereAllNaNParam]
541+
* @include [DropColumnNamesParam]
542+
*/
543+
public fun <T> DataFrame<T>.dropNaNs(vararg columns: String, whereAllNaN: Boolean = false): DataFrame<T> =
544+
dropNaNs(whereAllNaN) { columns.toColumns() }
416545

417-
public fun <T> DataFrame<T>.dropNaNs(vararg cols: AnyColumnReference, whereAllNaN: Boolean = false): DataFrame<T> =
418-
dropNaNs(whereAllNaN) { cols.toColumns() }
546+
/**
547+
* @include [CommonDropNaNsFunctionDoc]
548+
* @include [SelectingColumns.ColumnAccessors.WithExample] {@include [SetDropNaNsOperationArg]}
549+
* `df.`[dropNaNs][dropNaNs]`(length, whereAllNaN = true)`
550+
* @include [DropNaNs.WhereAllNaNParam]
551+
* @include [DropColumnAccessorsParam]
552+
*/
553+
public fun <T> DataFrame<T>.dropNaNs(vararg columns: AnyColumnReference, whereAllNaN: Boolean = false): DataFrame<T> =
554+
dropNaNs(whereAllNaN) { columns.toColumns() }
419555

420-
public fun <T> DataFrame<T>.dropNaNs(cols: Iterable<AnyColumnReference>, whereAllNaN: Boolean = false): DataFrame<T> =
421-
dropNaNs(whereAllNaN) { cols.toColumnSet() }
556+
/**
557+
* TODO will be deprecated
558+
*/
559+
public fun <T> DataFrame<T>.dropNaNs(columns: Iterable<AnyColumnReference>, whereAllNaN: Boolean = false): DataFrame<T> =
560+
dropNaNs(whereAllNaN) { columns.toColumnSet() }
422561

562+
/**
563+
* @include [CommonDropNaNsFunctionDoc]
564+
* This overload operates on all columns in the [DataFrame].
565+
* @include [DropNaNs.WhereAllNaNParam]
566+
*/
423567
public fun <T> DataFrame<T>.dropNaNs(whereAllNaN: Boolean = false): DataFrame<T> =
424568
dropNaNs(whereAllNaN) { all() }
425569

570+
/**
571+
* ## The Drop `NaN` Operation
572+
*
573+
* Removes [`NaN`][NaN] values from this [DataColumn], adjusting the type accordingly.
574+
*/
426575
public fun <T> DataColumn<T>.dropNaNs(): DataColumn<T> =
427576
when (typeClass) {
428577
Double::class, Float::class -> filter { !it.isNaN }.cast()

0 commit comments

Comments
 (0)