Skip to content

Commit 3ff686e

Browse files
authored
Merge pull request #1226 from Kotlin/cs-dsl-links
Adding links to column selectors in docs
2 parents 2e7c909 + d9c884d commit 3ff686e

37 files changed

+99
-31
lines changed

docs/StardustDocs/topics/add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
44

5-
Returns [`DataFrame`](DataFrame.md) which contains all columns from original [`DataFrame`](DataFrame.md) followed by newly added columns.
5+
Returns [`DataFrame`](DataFrame.md) which contains all columns from the original [`DataFrame`](DataFrame.md) followed by newly added columns.
66
Original [`DataFrame`](DataFrame.md) is not modified.
77

88
`add` appends columns to the end of the dataframe by default.

docs/StardustDocs/topics/convert.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ colExpression = DataFrame.(DataColumn) -> DataColumn
1313
frameExpression: DataFrame.(DataFrame) -> DataFrame
1414
```
1515

16-
See [column selectors](ColumnSelectors.md) and [row expressions](DataRow.md#row-expressions)
16+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation and
17+
[row expressions](DataRow.md#row-expressions) for how to provide new values.
1718

1819
<!---FUN convert-->
1920

docs/StardustDocs/topics/corr.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ corr { columns1 }
99
.with { columns2 } | .withItself()
1010
```
1111

12+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
13+
1214
To compute pairwise correlation between all columns in the [`DataFrame`](DataFrame.md) use `corr` without arguments:
1315

1416
```kotlin
@@ -19,7 +21,7 @@ The function is available for numeric- and `Boolean` columns.
1921
`Boolean` values are converted into `1` for `true` and `0` for `false`.
2022
All other columns are ignored.
2123

22-
If a [`ColumnGroup`](DataColumn.md#columngroup) instance is passed as target column for correlation,
24+
If a [`ColumnGroup`](DataColumn.md#columngroup) instance is passed as the target column for correlation,
2325
it will be unpacked into suitable nested columns.
2426

2527
The resulting [`DataFrame`](DataFrame.md) will have `n1` rows and `n2+1` columns,

docs/StardustDocs/topics/cumSum.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ cumSum(skipNA = true) [ { columns } ]
1010

1111
Returns a [`DataFrame`](DataFrame.md) or [`DataColumn`](DataColumn.md) containing the cumulative sum.
1212

13+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
14+
1315
**Parameters:**
1416
* `skipNA` — when `true`, ignores [`NA` values](nanAndNa.md#na) (`null` or `NaN`).
1517
When `false`, all values after first `NA` will be `NaN` (for `Double` and `Float` columns) or `null` (for integer columns).

docs/StardustDocs/topics/distinct.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ df.distinct()
1616

1717
If columns are specified, resulting [`DataFrame`](DataFrame.md) will have only given columns with distinct values.
1818

19+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
20+
1921
<!---FUN distinctColumns-->
2022
<tabs>
2123
<tab title="Properties">
@@ -43,6 +45,8 @@ df.select("age", "name").distinct()
4345

4446
Keep only the first row for every group of rows grouped by some condition.
4547

48+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
49+
4650
<!---FUN distinctBy-->
4751
<tabs>
4852
<tab title="Properties">

docs/StardustDocs/topics/drop.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ df.drop { it["weight"] == null || it["city"] == null }
2727

2828
Remove rows with `null` values
2929

30+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
31+
3032
<!---FUN dropNulls-->
3133

3234
```kotlin
@@ -44,6 +46,8 @@ df.dropNulls(whereAllNull = true) { city and weight } // remove rows with null v
4446

4547
Remove rows with [`NaN` values](nanAndNa.md#nan) (`Double.NaN` or `Float.NaN`).
4648

49+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
50+
4751
<!---FUN dropNaNs-->
4852

4953
```kotlin
@@ -61,6 +65,8 @@ df.dropNaNs(whereAllNaN = true) { age and weight } // remove rows where both 'ag
6165

6266
Remove rows with [`NA` values](nanAndNa.md#na) (`null`, `Double.NaN`, or `Float.NaN`).
6367

68+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
69+
6470
<!---FUN dropNA-->
6571

6672
```kotlin

docs/StardustDocs/topics/explode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Splits list-like values in given columns and spreads them vertically. Values in
88
explode(dropEmpty = true) [ { columns } ]
99
```
1010

11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
12+
1113
**Parameters:**
1214
* `dropEmpty` — if `true`, removes rows with empty lists or [`DataFrame`](DataFrame.md) objects. Otherwise, they will be exploded into `null`.
1315

docs/StardustDocs/topics/fill.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Replace missing values.
88

99
Replaces `null` values with given value or expression.
1010

11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
12+
1113
<!---FUN fillNulls-->
1214

1315
```kotlin
@@ -23,6 +25,8 @@ df.update { colsOf<Int?>() }.where { it == null }.with { -1 }
2325

2426
Replaces [`NaN` values](nanAndNa.md#nan) (`Double.NaN` and `Float.NaN`) with given value or expression.
2527

28+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
29+
2630
<!---FUN fillNaNs-->
2731

2832
```kotlin
@@ -36,6 +40,8 @@ df.fillNaNs { colsOf<Double>() }.withZero()
3640

3741
Replaces [`NA` values](nanAndNa.md#na) (`null`, `Double.NaN`, and `Float.NaN`) with given value or expression.
3842

43+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
44+
3945
<!---FUN fillNA-->
4046

4147
```kotlin

docs/StardustDocs/topics/filter.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ df.filter { "age"<Int>() > 18 && "name"["firstName"]<String>().startsWith("A") }
2525

2626
## filterBy
2727

28-
Returns [`DataFrame`](DataFrame.md) with rows that have value `true` in given column of type `Boolean`.
28+
Returns [`DataFrame`](DataFrame.md) with rows that have value `true` in the given column of type `Boolean`.
29+
30+
See [column selectors](ColumnSelectors.md) for how to select the column for this operation.
2931

3032
<!---FUN filterBy-->
3133
<tabs>

docs/StardustDocs/topics/flatten.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ Returns [`DataFrame`](DataFrame.md) without column groupings under selected colu
88
flatten [ { columns } ]
99
```
1010

11-
Columns after flattening will keep their original names. Potential column name clashes are resolved by adding minimal possible name prefix from ancestor columns.
11+
Columns will keep their original names after flattening.
12+
Potential column name clashes are resolved by adding minimal possible name prefix from ancestor columns.
13+
14+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
1215

1316
<!---FUN flatten-->
1417
<tabs>

docs/StardustDocs/topics/gather.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Converts several columns into two columns `key` and `value`. `key` column will contain names of original columns, `value` column will contain values from original columns.
66

7-
This operation is reverse to [pivot](pivot.md)
7+
This operation is reverse to [](pivot.md)
88

99
```kotlin
1010
gather { columns }
@@ -21,7 +21,7 @@ keyTransform: (columnName: String) -> K
2121
valueTransform: (value) -> R
2222
```
2323

24-
See [column selectors](ColumnSelectors.md)
24+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
2525

2626
Configuration options:
2727
* `explodeLists` — gathered values of type [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/) will be exploded into their elements, so `where`, `cast`, `notNull` and `mapValues` will be applied to list elements instead of lists themselves

docs/StardustDocs/topics/group.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ groupNameExpression = DataColumn.(DataColumn) -> String
1515

1616
It is a special case of [`move`](move.md) operation.
1717

18+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
19+
1820
<!---FUN group-->
1921

2022
```kotlin

docs/StardustDocs/topics/groupBy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ pivot = .pivot { columns }
2424
pivotReducer | pivotAggregator
2525
```
2626

27-
See [column selectors](ColumnSelectors.md), [groupBy transformations](#transformation), [groupBy aggregations](#aggregation), [pivot+groupBy](pivot.md#pivot-groupby)
27+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation,
28+
[groupBy transformations](#transformation), [groupBy aggregations](#aggregation), and [pivot+groupBy](pivot.md#pivot-groupby).
2829

2930
<!---FUN groupBy-->
3031
<tabs>

docs/StardustDocs/topics/implode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Returns [`DataFrame`](DataFrame.md) where values in given columns are merged int
88
implode(dropNA = false) [ { columns } ]
99
```
1010

11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
12+
1113
**Parameters:**
1214
* `dropNA` — if `true`, removes `NA` values from merged lists.
1315

docs/StardustDocs/topics/inferType.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
44

5-
Changes type of the selected columns based on actual values stored in these columns. Resulting type of the column will be a nearest common supertype of all column values.
5+
Changes the type of the selected columns based on the runtime values stored in these columns.
6+
The resulting type of the column will be the nearest common supertype of all column values.
67

78
```text
89
inferType [ { columns } ]
910
```
11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.

docs/StardustDocs/topics/mean.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ df.pivot { city }.groupBy { name.lastName }.mean()
4343

4444
See [statistics](summaryStatistics.md#groupby-statistics) for details on complex data aggregations.
4545

46+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
47+
4648
### Type Conversion
4749

4850
The following automatic type conversions are performed for the `mean` operation:

docs/StardustDocs/topics/median.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ df.pivot { city }.groupBy { name.lastName }.median()
5151

5252
See [statistics](summaryStatistics.md#groupby-statistics) for details on complex data aggregations.
5353

54+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
55+
5456
### Type Conversion
5557

5658
The following automatic type conversions are performed for the `median` operation.

docs/StardustDocs/topics/merge.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ merge { columns }
1515
merger: (DataRow).List<T> -> Any
1616
```
1717

18+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
19+
1820
<!---FUN merge-->
1921

2022
```kotlin

docs/StardustDocs/topics/minmax.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ df.pivot { city }.groupBy { name.lastName }.min()
4242

4343
See [statistics](summaryStatistics.md#groupby-statistics) for details on complex data aggregations.
4444

45+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
46+
4547
### Type Conversion
4648

4749
The following automatic type conversions are performed for the `min` and `max` operations.

docs/StardustDocs/topics/move.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ move { columns }
1111
pathSelector: DataFrame.(DataColumn) -> ColumnPath
1212
```
1313

14-
See [Column Selectors](ColumnSelectors.md)
14+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
1515

16-
Can be used to change columns hierarchy by providing `ColumnPath` for every moved column
16+
Can be used to change column hierarchy by providing `ColumnPath` for every moved column.
1717

1818
<!---FUN move-->
1919

docs/StardustDocs/topics/percentile.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ df.pivot { city }.groupBy { name.lastName }.percentile(25.0)
7373

7474
See [statistics](summaryStatistics.md#groupby-statistics) for details on complex data aggregations.
7575

76+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
77+
7678
### Type Conversion
7779

7880
The following automatic type conversions are performed for the `percentile` operation.

docs/StardustDocs/topics/pivot.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Analyze-->
44

5-
Splits the rows of [`DataFrame`](DataFrame.md) and groups them horizontally into new columns based on values from one or several columns of original [`DataFrame`](DataFrame.md).
5+
Splits the rows of a [`DataFrame`](DataFrame.md) and groups them horizontally into new columns based on values from one or several columns of the original [`DataFrame`](DataFrame.md).
66

77
```text
88
pivot (inward = true) { pivotColumns }
@@ -16,8 +16,10 @@ reducer = .minBy { column } | .maxBy { column } | .first [ { rowCondition } ] |
1616
aggregator = .count() | .matches() | .frames() | .with { rowExpression } | .values { valueColumns } | .aggregate { aggregations } | .<stat> [ { columns } ]
1717
```
1818

19+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
20+
1921
**Parameters:**
20-
* `inward` — if `true` generated columns will be nested inside original column, otherwise they will be top-level
22+
* `inward` — if `true` generated columns are nested inside the original column, otherwise they will be top-level
2123
* `pivotColumns` — columns with values for horizontal data grouping and generation of new columns
2224
* `indexColumns` — columns with values for vertical data grouping
2325
* `defaultValue` — value to fill mismatched pivot-index column pairs
@@ -42,7 +44,7 @@ df.pivot("city")
4244
<inline-frame src="resources/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot.html" width="100%"/>
4345
<!---END-->
4446

45-
To pivot several columns at once you can combine them using `and` or `then` infix function:
47+
To pivot several columns at once, you can combine them using `and` or `then` infix function:
4648
* `and` will pivot columns independently
4749
* `then` will create column hierarchy from combinations of values from pivoted columns
4850

@@ -69,7 +71,8 @@ df.pivot { "city" then "name"["firstName"] }
6971

7072
## pivot + groupBy
7173

72-
To create matrix table that is expanded both horizontally and vertically, apply [`groupBy`](groupBy.md) transformation passing the columns for vertical grouping.
74+
To create a matrix table that is expanded both horizontally and vertically,
75+
apply [`groupBy`](groupBy.md) transformation passing the columns for vertical grouping.
7376
Reversed order of `pivot` and [`groupBy`](groupBy.md) will produce the same result.
7477

7578
<!---FUN pivotGroupBy-->
@@ -264,7 +267,7 @@ df.pivot("city").groupBy("name").aggregate {
264267
### Pivot inside aggregate
265268

266269
pivot transformation can be used inside [`aggregate`](groupBy.md#aggregation) function of [`groupBy`](groupBy.md).
267-
This allows to combine column pivoting with other [`groupBy`](groupBy.md) aggregations:
270+
This allows combining column pivoting with other [`groupBy`](groupBy.md) aggregations:
268271

269272
<!---FUN pivotInAggregate-->
270273
<tabs>

docs/StardustDocs/topics/remove.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Returns [`DataFrame`](DataFrame.md) without selected columns.
88
remove { columns }
99
```
1010

11-
See [Column Selectors](ColumnSelectors.md)
11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
1212

1313
<!---FUN remove-->
1414
<tabs>

docs/StardustDocs/topics/rename.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ df.rename { columns }.into { nameExpression }
1111
nameExpression = (DataColumn) -> String
1212
```
1313

14+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
15+
1416
<!---FUN rename-->
1517
<tabs>
1618
<tab title="Properties">

docs/StardustDocs/topics/reorder.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ reorder { columns }
1212
columnExpression: DataColumn.(DataColumn) -> Value
1313
```
1414

15+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
16+
1517
<!---FUN reorder-->
1618
<tabs>
1719
<tab title="Properties">

docs/StardustDocs/topics/replace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ replace { columns }
1010
columnExpression: DataFrame.(DataColumn) -> DataColumn
1111
```
1212

13-
See [column selectors](ColumnSelectors.md)
13+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
1414

1515
<!---FUN replace-->
1616

docs/StardustDocs/topics/reshape.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/StardustDocs/topics/sortBy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ By default, columns are sorted in ascending order with `null` values going first
88
* `.desc` — changes column sort order from ascending to descending
99
* `.nullsLast` — forces `null` values to be placed at the end of the order
1010

11+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
12+
1113
<!---FUN sortBy-->
1214
<tabs>
1315
<tab title="Properties">
@@ -35,6 +37,8 @@ df.sortBy { "weight".nullsLast() }
3537

3638
Returns [`DataFrame`](DataFrame.md) sorted by one or several columns in descending order.
3739

40+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
41+
3842
<!---FUN sortByDesc-->
3943
<tabs>
4044
<tab title="Properties">

docs/StardustDocs/topics/split.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
44

5-
This operation splits every value in the given columns into several values,
5+
This operation splits every value in the given columns into several values
66
and optionally spreads them horizontally or vertically.
77

88
```text
@@ -15,10 +15,12 @@ df.split { columns }
1515
splitter = DataRow.(T) -> Iterable<Any>
1616
columnNamesGenerator = DataColumn.(columnIndex: Int) -> String
1717
```
18-
The following types of columns can be split without any _splitter_ configuration:
19-
* `String`: split by `,` and trim
20-
* `List`: split into elements
21-
* [`DataFrame`](DataFrame.md): split into rows
18+
The following types of columns can be split easily:
19+
* `String`: for instance, by `","`
20+
* `List`: splits into elements, no `by` required!
21+
* [`DataFrame`](DataFrame.md): splits into rows, no `by` required!
22+
23+
See [column selectors](ColumnSelectors.md) for how to select the columns for this operation.
2224

2325
## Split in place
2426

0 commit comments

Comments
 (0)