Skip to content

Converted all the data type mentions to the links on the mentioned types #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/ColumnSelectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Access-->

`DataFrame` provides DSL for selecting arbitrary set of columns.
[`DataFrame`](DataFrame.md) provides DSL for selecting arbitrary set of columns.

Column selectors are used in many operations:

Expand Down
10 changes: 5 additions & 5 deletions docs/StardustDocs/topics/DataColumn.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[//]: # (title: DataColumn)
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Create-->

`DataColumn` represents a column of values. It can store objects of primitive or reference types, or other [`DataFrames`](DataFrame.md).
[`DataColumn`](DataColumn.md) represents a column of values. It can store objects of primitive or reference types, or other [`DataFrames`](DataFrame.md).

See [how to create columns](createColumn.md)

Expand All @@ -14,7 +14,7 @@ See [how to create columns](createColumn.md)
* `size: Int` — number of elements in the column

### Column kinds
`DataColumn` instances can be one of three subtypes: `ValueColumn`, `ColumnGroup` or `FrameColumn`
[`DataColumn`](DataColumn.md) instances can be one of three subtypes: `ValueColumn`, [`ColumnGroup`](DataColumn.md#columngroup) or [`FrameColumn`](DataColumn.md#framecolumn)

#### ValueColumn

Expand All @@ -30,13 +30,13 @@ Container for nested columns. Is used to create column hierarchy.

Special case of [`ValueColumn`](#valuecolumn) that stores other [`DataFrames`](DataFrame.md) as elements.

`DataFrames` stored in `FrameColumn` may have different schemas.
[`DataFrames`](DataFrame.md) stored in [`FrameColumn`](DataColumn.md#framecolumn) may have different schemas.

`FrameColumn` may appear after [reading](read.md) from JSON or other hierarchical data structures, or after grouping operations such as [groupBy](groupBy.md) or [pivot](pivot.md).
[`FrameColumn`](DataColumn.md#framecolumn) may appear after [reading](read.md) from JSON or other hierarchical data structures, or after grouping operations such as [groupBy](groupBy.md) or [pivot](pivot.md).

## Column accessors

`ColumnAccessors` are used for [typed data access](columnAccessorsApi.md) in `DataFrame`. `ColumnAccessor` stores column [`name`](#properties) (for top-level columns) or column path (for nested columns), has type argument that corresponds to [`type`](#properties) of thep column, but it doesn't contain any actual data.
`ColumnAccessors` are used for [typed data access](columnAccessorsApi.md) in [`DataFrame`](DataFrame.md). `ColumnAccessor` stores column [`name`](#properties) (for top-level columns) or column path (for nested columns), has type argument that corresponds to [`type`](#properties) of thep column, but it doesn't contain any actual data.

<!---FUN columnAccessorsUsage-->

Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/DataFrame.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[//]: # (title: DataFrame)

`DataFrame` represents a list of [`DataColumn`](DataColumn.md).
[`DataFrame`](DataFrame.md) represents a list of [`DataColumn`](DataColumn.md).

Columns in dataframe must have equal size and unique names.

Expand Down
10 changes: 5 additions & 5 deletions docs/StardustDocs/topics/DataRow.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Row functions

* `index(): Int` — sequential row number in `DataFrame`, starts from 0
* `index(): Int` — sequential row number in [`DataFrame`](DataFrame.md), starts from 0
* `prev(): DataRow?` — previous row (`null` for the first row)
* `next(): DataRow?` — next row (`null` for the last row)
* `diff { rowExpression }: T` — difference between results of [row expression](#row-expressions) calculated for current and previous rows
Expand All @@ -18,14 +18,14 @@
* `namedValuesOf<T>(): List<NameValuePair<T>>` — list of name-value pairs where value has given type
* `transpose(): DataFrame<NameValuePair<*>>` — dataframe of two columns: `name: String` is column names and `value: Any?` is cell values
* `transposeTo<T>(): DataFrame<NameValuePair<T>>`— dataframe of two columns: `name: String` is column names and `value: T` is cell values
* `getRow(Int): DataRow` — row from `DataFrame` by row index
* `getRow(Int): DataRow` — row from [`DataFrame`](DataFrame.md) by row index
* `getRows(Iterable<Int>): DataFrame` — dataframe with subset of rows selected by absolute row index.
* `relative(Iterable<Int>): DataFrame` — dataframe with subset of rows selected by relative row index: `relative(-1..1)` will return previous, current and next row. Requested indices will be coerced to the valid range and invalid indices will be skipped
* `get(column): T` — cell value by this row and given `column`
* `df()` — `DataFrame` that current row belongs to
* `df()` — [`DataFrame`](DataFrame.md) that current row belongs to

## Row expressions
Row expressions provide a value for every row of `DataFrame` and are used in [add](add.md), [filter](filter.md), [forEach](iterate.md), [update](update.md) and other operations.
Row expressions provide a value for every row of [`DataFrame`](DataFrame.md) and are used in [add](add.md), [filter](filter.md), [forEach](iterate.md), [update](update.md) and other operations.

<!---FUN expressions-->

Expand Down Expand Up @@ -75,7 +75,7 @@ The following [statistics](summaryStatistics.md) are available for `DataRow`:
* `rowMedian`

These statistics will be applied only to values of appropriate types and incompatible values will be ignored.
For example, if `DataFrame` has columns of type `String` and `Int`, `rowSum()` will successfully compute sum of `Int` values in a row and ignore `String` values.
For example, if [`DataFrame`](DataFrame.md) has columns of type `String` and `Int`, `rowSum()` will successfully compute sum of `Int` values in a row and ignore `String` values.

To apply statistics only to values of particular type use `-Of` versions:
* `rowMaxOf<T>`
Expand Down
5 changes: 3 additions & 2 deletions docs/StardustDocs/topics/KPropertiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.ApiLevels-->

`Kotlin Dataframe` can be used as an intermediate structure for data transformation between two data formats. If either source or destination is a Kotlin object, e.g. data class, it is convenient to use its properties for typed data access in `DataFrame`.
[`DataFrame`](DataFrame.md) can be used as an intermediate structure for data transformation between two data formats.
If either source or destination is a Kotlin object, e.g. data class, it is convenient to use its properties for typed data access in [`DataFrame`](DataFrame.md).
This can be done using `::` expression that provides [property references](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/)

<!---FUN kproperties1-->
Expand All @@ -28,7 +29,7 @@ val passengers = DataFrame.read("titanic.csv")

<!---END-->

By default, `DataFrame` uses `name` and `returnType` of `KProperty` for typed access to data. When column name differs from property name, use `ColumnName` annotation:
By default, [`DataFrame`](DataFrame.md) uses `name` and `returnType` of `KProperty` for typed access to data. When column name differs from property name, use `ColumnName` annotation:

<!---FUN kproperties2-->

Expand Down
13 changes: 7 additions & 6 deletions docs/StardustDocs/topics/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

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

Returns `DataFrame` which contains all columns from original `DataFrame` followed by newly added columns. Original `DataFrame` is not modified.
Returns [`DataFrame`](DataFrame.md) which contains all columns from original [`DataFrame`](DataFrame.md) followed by newly added columns.
Original [`DataFrame`](DataFrame.md) is not modified.

## Create new column and add it to `DataFrame`
## Create new column and add it to [`DataFrame`](DataFrame.md)

```text
add(columnName: String) { rowExpression }
Expand Down Expand Up @@ -55,7 +56,7 @@ df.add("fibonacci") {

<!---END-->

## Create and add several columns to `DataFrame`
## Create and add several columns to [`DataFrame`](DataFrame.md)

```kotlin
add {
Expand Down Expand Up @@ -191,7 +192,7 @@ val personWithCityInfo = df.add {
</tab></tabs>
<!---END-->

## Add existing column to `DataFrame`
## Add existing column to [`DataFrame`](DataFrame.md)

<!---FUN addExisting-->

Expand All @@ -204,7 +205,7 @@ df + score

<!---END-->

## Add all columns from another `DataFrame`
## Add all columns from another [`DataFrame`](DataFrame.md)

<!---FUN addDfs-->

Expand All @@ -216,7 +217,7 @@ df.add(df1, df2)

## addId

Adds column with sequential values 0, 1, 2,... New column will be added in the beginning of columns list and will become the first column in `DataFrame`.
Adds column with sequential values 0, 1, 2,... New column will be added in the beginning of columns list and will become the first column in [`DataFrame`](DataFrame.md).

```
addId(name: String = "id")
Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/addDf.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Returns `DataFrame` with union of columns from several given `DataFrames`.
Returns [`DataFrame`](DataFrame.md) with union of columns from several given [`DataFrames`](DataFrame.md).

<!---FUN addDfs-->

Expand Down
6 changes: 3 additions & 3 deletions docs/StardustDocs/topics/addRemove.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[//]: # (title: Add/map/remove columns)

* [`add`](add.md) columns to `DataFrame`
* [`map`](map.md) columns to new `DataFrame` or `DataColumn`
* [`remove`](remove.md) columns from `DataFrame`
* [`add`](add.md) columns to [`DataFrame`](DataFrame.md)
* [`map`](map.md) columns to new [`DataFrame`](DataFrame.md) or [`DataColumn`](DataColumn.md)
* [`remove`](remove.md) columns from [`DataFrame`](DataFrame.md)
10 changes: 5 additions & 5 deletions docs/StardustDocs/topics/adjustSchema.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[//]: # (title: Adjust schema)

`DataFrame` interface has type argument `T` that doesn't affect contents of `DataFrame`, but marks `DataFrame` with a type that represents data schema that this `DataFrame` is supposed to have.
[`DataFrame`](DataFrame.md) interface has type argument `T` that doesn't affect contents of `DataFrame`, but marks `DataFrame` with a type that represents data schema that this `DataFrame` is supposed to have.
This argument is used to generate [extension properties](extensionPropertiesApi.md) for typed data access.

Actual data in `DataFrame` may diverge from compile-time schema marker `T` due to dynamic nature of data inside `DataFrame`. However, at some points of code you may know exactly what `DataFrame` schema is expected.
To match your knowledge with expected real-time `DataFrame` contents you can use one of two functions:
* [`cast`](cast.md) — change type argument of `DataFrame` to the expected schema without changing data in `DataFrame`.
* [`convertTo`](convertTo.md) — convert `DataFrame` contents to match the expected schema.
Actual data in [`DataFrame`](DataFrame.md) may diverge from compile-time schema marker `T` due to dynamic nature of data inside `DataFrame`. However, at some points of code you may know exactly what `DataFrame` schema is expected.
To match your knowledge with expected real-time [`DataFrame`](DataFrame.md) contents you can use one of two functions:
* [`cast`](cast.md) — change type argument of [`DataFrame`](DataFrame.md) to the expected schema without changing data in `DataFrame`.
* [`convertTo`](convertTo.md) — convert [`DataFrame`](DataFrame.md) contents to match the expected schema.

6 changes: 3 additions & 3 deletions docs/StardustDocs/topics/apiLevels.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ By nature data frames are dynamic objects, column labels depend on the input sou
or deleted while wrangling. Kotlin, in contrast, is a statically typed language and all types are defined and verified
ahead of execution. That's why creating a flexible, handy, and, at the same time, safe API to a data frame is tricky.

In `Kotlin DataFrame` we provide four different ways to access columns, and, while they are essentially different, they
In Kotlin DataFrame library we provide four different ways to access columns, and, while they are essentially different, they
look pretty similar in the data wrangling DSL.

## List of Access APIs
Expand Down Expand Up @@ -147,10 +147,10 @@ Currently, we are working on compiler a plugin that generates these properties o

The [Column Accessors API](columnAccessorsApi.md) is a kind of trade-off between safety and needs to be written ahead of
the execution type declaration. It was designed to better be able to write code in an IDE without a notebook experience.
It provides type-safe access to columns but doesn't ensure that the columns really exist in a particular dataframe.
It provides type-safe access to columns but doesn't ensure that the columns really exist in a particular [`DataFrame`](DataFrame.md).

The [KProperties API](KPropertiesApi.md) is useful when you already have declared classed in your application business
logic with fields that correspond columns of dataframe.
logic with fields that correspond columns of [`DataFrame`](DataFrame.md).

<table>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/append.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[//]: # (title: append)

Adds one or several rows to `DataFrame`
Adds one or several rows to [`DataFrame`](DataFrame.md)
```kotlin
df.append (
"Mike", 15,
Expand Down
8 changes: 4 additions & 4 deletions docs/StardustDocs/topics/cast.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[//]: # (title: cast)
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->

Changes type argument of `DataFrame` without changing its contents.
Changes type argument of [`DataFrame`](DataFrame.md) without changing its contents.

```kotlin
cast<T>(verify = false)
```

**Parameters:**
* `verify: Boolean = false` — when `true`, throws exception if `DataFrame` doesn't match given schema. Otherwise, just changes format type without actual data check.
* `verify: Boolean = false` — when `true`, throws exception if [`DataFrame`](DataFrame.md) doesn't match given schema. Otherwise, just changes format type without actual data check.

Use this operation to change formal type of `DataFrame` to match expected schema and enable generated [extension properties](extensionPropertiesApi.md) for it.
Use this operation to change formal type of [`DataFrame`](DataFrame.md) to match expected schema and enable generated [extension properties](extensionPropertiesApi.md) for it.

```kotlin
@DataSchema
Expand All @@ -22,4 +22,4 @@ interface Person {
df.cast<Person>()
```

To convert `DataFrame` columns to match given schema, use [`convertTo`](convertTo.md) operation.
To convert [`DataFrame`](DataFrame.md) columns to match given schema, use [`convertTo`](convertTo.md) operation.
14 changes: 7 additions & 7 deletions docs/StardustDocs/topics/collectionsInterop.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Collections-->

_Kotlin DataFrame_ and _Kotlin Collection_ represent two different approaches to data storage:
* `DataFrame` stores data by fields/columns
* [`DataFrame`](DataFrame.md) stores data by fields/columns
* `Collection` stores data by records/rows

Although `DataFrame` doesn't implement `Collection` or `Iterable` interface, it has many similar operations, such as [`filter`](filter.md), [`take`](sliceRows.md#take), [`first`](first.md), [`map`](map.md), [`groupBy`](groupBy.md) etc.
Although [`DataFrame`](DataFrame.md) doesn't implement `Collection` or `Iterable` interface, it has many similar operations, such as [`filter`](filter.md), [`take`](sliceRows.md#take), [`first`](first.md), [`map`](map.md), [`groupBy`](groupBy.md) etc.

`DataFrame` has two-way compatibility with `Map` and `List`:
[`DataFrame`](DataFrame.md) has two-way compatibility with `Map` and `List`:
* `List<T>` -> `DataFrame<T>`: [toDataFrame](createDataFrame.md#todataframe)
* `DataFrame<T>` -> `List<T>`: [toList](toList.md)
* `Map<String, List<*>>` -> `DataFrame<*>`: [toDataFrame](createDataFrame.md#todataframe)
* `DataFrame<*>` -> `Map<String, List<*>>`: [toMap](toMap.md)

Columns, rows and values of `DataFrame` can be accessed as [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/), [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/) and [`Sequence`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/) accordingly:
Columns, rows and values of [`DataFrame`](DataFrame.md) can be accessed as [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/), [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/) and [`Sequence`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/) accordingly:

<!---FUN getRowsColumns-->

Expand All @@ -29,7 +29,7 @@ df.values() // Sequence<Any?>

## Interop with data classes

`DataFrame` can be used as an intermediate object for transformation from one data structure to another.
[`DataFrame`](DataFrame.md) can be used as an intermediate object for transformation from one data structure to another.

Assume you have a list of instances of some [data class](https://kotlinlang.org/docs/data-classes.html) that you need to transform into some other format.

Expand All @@ -43,7 +43,7 @@ val list = listOf(Input(1, 2), Input(3, 4))

<!---END-->

You can convert this list into `DataFrame` using [`toDataFrame()`](createDataFrame.md#todataframe) extension:
You can convert this list into [`DataFrame`](DataFrame.md) using [`toDataFrame()`](createDataFrame.md#todataframe) extension:

<!---FUN listInterop2-->

Expand Down Expand Up @@ -72,7 +72,7 @@ To enable extension properties generation you should use [dataframe plugin](grad

</tip>

After data is transformed, `DataFrame` can be exported into `List` of another data class using [toList](toList.md) or [toListOf](toList.md#tolistof) extensions:
After data is transformed, [`DataFrame`](DataFrame.md) can be exported into `List` of another data class using [toList](toList.md) or [toListOf](toList.md#tolistof) extensions:

<!---FUN listInterop4-->

Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/columnNames.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[//]: # (title: columnNames)

Returns list of names for top-level columns of `DataFrame`.
Returns list of names for top-level columns of [`DataFrame`](DataFrame.md).
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/columnTypes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[//]: # (title: columnTypes)

Returns list of types for top-level columns of `DataFrame`.
Returns list of types for top-level columns of [`DataFrame`](DataFrame.md).
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/columns.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[//]: # (title: columns)

Return top-level columns of `DataFrame` as `List<DataColumn<*>>`
Return top-level columns of [`DataFrame`](DataFrame.md) as `List<DataColumn<*>>`
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/columnsCount.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[//]: # (title: columnsCount)

Returns number of top-level columns in `DataFrame`.
Returns number of top-level columns in [`DataFrame`](DataFrame.md).
12 changes: 6 additions & 6 deletions docs/StardustDocs/topics/concat.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

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

Returns `DataFrame` with the union of rows from several given `DataFrames`.
Returns [`DataFrame`](DataFrame.md) with the union of rows from several given [`DataFrames`](DataFrame.md).

`concat` is available for:

`DataFrame`:
[`DataFrame`](DataFrame.md):

<!---FUN concatDfs-->

Expand All @@ -16,7 +16,7 @@ df.concat(df1, df2)

<!---END-->

`DataColumn`:
[`DataColumn`](DataColumn.md):

<!---FUN concatColumns-->

Expand Down Expand Up @@ -90,12 +90,12 @@ frameColumn.concat()

<!---END-->

If you want to union columns (not rows) from several `DataFrames`, see [`add`](add.md).
If you want to union columns (not rows) from several [`DataFrames`](DataFrame.md), see [`add`](add.md).

## Schema unification

If input `DataFrames` have different schemas, every column in resulting `DataFrame` will have the most common type of the original columns with the same name.
If input [`DataFrames`](DataFrame.md) have different schemas, every column in resulting [`DataFrames`](DataFrame.md) will have the most common type of the original columns with the same name.

For example, if one `DataFrame` has column `A: Int` and other `DataFrame` has column `A: Double`, resulting `DataFrame` will have column `A: Number`.
For example, if one [`DataFrame`](DataFrame.md) has column `A: Int` and other [`DataFrame`](DataFrame.md) has column `A: Double`, resulting `DataFrame` will have column `A: Number`.

Missing columns in dataframes will be filled with `null`.
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/concatDf.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Returns `DataFrame` with the union of rows from several given `DataFrames`.
Returns [`DataFrame`](DataFrame.md) with the union of rows from several given [`DataFrames`](DataFrame.md).

<!---FUN concatDfs-->

Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/convert.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[//]: # (title: convert)
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->

Returns `DataFrame` with changed values in some columns. Allows to change column types.
Returns [`DataFrame`](DataFrame.md) with changed values in some columns. Allows to change column types.

```text
convert { columnsSelector }
Expand Down
2 changes: 1 addition & 1 deletion docs/StardustDocs/topics/convertTo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[//]: # (title: convertTo)
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->

[Converts](convert.md) columns in `DataFrame` to match given schema `Schema`
[Converts](convert.md) columns in [`DataFrame`](DataFrame.md) to match given schema `Schema`

```kotlin
convertTo<Schema>(excessiveColumns = ExcessiveColumns.Keep)
Expand Down
Loading