Skip to content

Commit d5280cc

Browse files
authored
Merge pull request #398 from Kotlin/fix_grammar
Fix missing articles and grammer in docs
2 parents b2f96b2 + ba9c183 commit d5280cc

21 files changed

+120
-83
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ This table shows the mapping between main library components versions and minimu
101101

102102
| Kotlin DataFrame Version | Minimum Java Version | Kotlin Version | Kotlin Jupyter Version | OpenAPI version | Apache Arrow version |
103103
|--------------------------|----------------------|----------------|------------------------|-----------------|----------------------|
104-
| 0.10.0 | 8 |1.8.20 | 0.11.0-358 |2.1.13 | 11.0.0 |
105-
| 0.10.1 | 8 |1.8.20 | 0.11.0-358 |2.1.13 | 11.0.0 |
104+
| 0.10.0 | 8 |1.8.20 | 0.11.0-358 | 3.0.0 | 11.0.0 |
105+
| 0.10.1 | 8 |1.8.20 | 0.11.0-358 | 3.0.0 | 11.0.0 |
106106

107107
## Usage example
108108

docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@
491491
/*<!--*/
492492
call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: "<span title=\"name: String\">name</span>", children: [], rightAlign: false, values: ["firstName","lastName","age","city","weight","isHappy"] },
493493
{ name: "<span title=\"path: ColumnPath\">path</span>", children: [], rightAlign: false, values: ["<span class=\"formatted\" title=\"name\nfirstName\"><span class=\"structural\">[</span>name<span class=\"structural\">, </span>firstName<span class=\"structural\">]</span></span>","<span class=\"formatted\" title=\"name\nlastName\"><span class=\"structural\">[</span>name<span class=\"structural\">, </span>lastName<span class=\"structural\">]</span></span>","<span class=\"formatted\" title=\"age\"><span class=\"structural\">[</span>age<span class=\"structural\">]</span></span>","<span class=\"formatted\" title=\"city\"><span class=\"structural\">[</span>city<span class=\"structural\">]</span></span>","<span class=\"formatted\" title=\"weight\"><span class=\"structural\">[</span>weight<span class=\"structural\">]</span></span>","<span class=\"formatted\" title=\"isHappy\"><span class=\"structural\">[</span>isHappy<span class=\"structural\">]</span></span>"] },
494-
{ name: "<span title=\"type: Any\">type</span>", children: [], rightAlign: false, values: ["String","String","Int","String","Int","Boolean"] },
494+
{ name: "<span title=\"type: Any\">type</span>", children: [], rightAlign: false, values: ["String","String","Int","String?","Int?","Boolean"] },
495495
{ name: "<span title=\"count: Int\">count</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>"] },
496496
{ name: "<span title=\"unique: Int\">unique</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">3</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">7</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">5</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">6</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">2</span></span>"] },
497497
{ name: "<span title=\"nulls: Int\">nulls</span>", children: [], rightAlign: true, values: ["<span class=\"formatted\" title=\"\"><span class=\"numbers\">0</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">0</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">0</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">1</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">2</span></span>","<span class=\"formatted\" title=\"\"><span class=\"numbers\">0</span></span>"] },

docs/StardustDocs/topics/ColumnSelectors.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.Access-->
44

5-
[`DataFrame`](DataFrame.md) provides DSL for selecting arbitrary set of columns.
5+
[`DataFrame`](DataFrame.md) provides a DSL for selecting an arbitrary set of columns.
66

77
Column selectors are used in many operations:
88

docs/StardustDocs/topics/access.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ df.values() // Sequence<Any?>
1818
**Learn how to:**
1919
* [Access data by index](indexing.md)
2020
* [Iterate over data](iterate.md)
21-
* [Get single row](getRow.md)
21+
* [Get a single row](getRow.md)
2222
* [Get single column](getColumns.md)

docs/StardustDocs/topics/add.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Returns [`DataFrame`](DataFrame.md) which contains all columns from original [`DataFrame`](DataFrame.md) followed by newly added columns.
66
Original [`DataFrame`](DataFrame.md) is not modified.
77

8-
## Create new column and add it to [`DataFrame`](DataFrame.md)
8+
## Create a new column and add it to [`DataFrame`](DataFrame.md)
99

1010
```text
1111
add(columnName: String) { rowExpression }
@@ -44,7 +44,8 @@ df.add("year of birth") { 2021 - "age"<Int>() }
4444

4545
See [row expressions](DataRow.md#row-expressions)
4646

47-
You can use `newValue()` function to access value that was already calculated for preceding row. It is helpful for recurrent computations:
47+
You can use the `newValue()` function to access value that was already calculated for the preceding row.
48+
It is helpful for recurrent computations:
4849

4950
<!---FUN addRecurrent-->
5051

@@ -223,7 +224,9 @@ df.add(df1, df2)
223224

224225
## addId
225226

226-
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).
227+
Adds a column with sequential values 0, 1, 2,...
228+
The new column will be added in the beginning of the column list
229+
and will become the first column in [`DataFrame`](DataFrame.md).
227230

228231
```
229232
addId(name: String = "id")

docs/StardustDocs/topics/adjustSchema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[//]: # (title: Adjust schema)
22

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

77
Another place where this argument has a special role is in [interop with data classes](collectionsInterop.md#interop-with-data-classes):

docs/StardustDocs/topics/apiLevels.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

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

5-
By nature data frames are dynamic objects, column labels depend on the input source and also new columns could be added
6-
or deleted while wrangling. Kotlin, in contrast, is a statically typed language and all types are defined and verified
7-
ahead of execution. That's why creating a flexible, handy, and, at the same time, safe API to a data frame is tricky.
5+
By nature, data frames are dynamic objects;
6+
column labels depend on the input source and new columns can be added
7+
or deleted while wrangling.
8+
Kotlin, in contrast, is a statically typed language where all types are defined and verified
9+
ahead of execution.
810

9-
In the Kotlin DataFrame library we provide four different ways to access columns, and, while they are essentially different, they
11+
That's why creating a flexible, handy, and, at the same time, safe API to a data frame is tricky.
12+
13+
In the Kotlin DataFrame library, we provide four different ways to access columns,
14+
and, while they are essentially different, they
1015
look pretty similar in the data wrangling DSL.
1116

1217
## List of Access APIs
@@ -128,9 +133,9 @@ df.add("lastName") { name.split(",").last() }
128133

129134
</tabs>
130135

131-
The `titanic.csv` file could be found [here](https://github.com/Kotlin/dataframe/blob/master/data/titanic.csv).
136+
The `titanic.csv` file can be found [here](https://github.com/Kotlin/dataframe/blob/master/data/titanic.csv).
132137

133-
# Comparing the APIs
138+
# Comparing APIs
134139

135140
The [String API](stringApi.md) is the simplest and unsafest of them all. The main advantage of it is that it can be
136141
used at any time, including when accessing new columns in chain calls. So we can write something like:
@@ -142,19 +147,19 @@ df.add("weight") { ... } // add a new column `weight`, calculated by some expres
142147

143148
We don't need to interrupt a function call chain and declare a column accessor or generate new properties.
144149

145-
In contrast, generated [extension properties](extensionPropertiesApi.md) are the most convenient and the safest API.
146-
Using it, you can always be sure that you work with correct data and types.
147-
But its bottleneck is the moment of generation.
148-
To get new extension properties you have to run a cell in a notebook,
150+
In contrast, generated [extension properties](extensionPropertiesApi.md) form the most convenient and the safest API.
151+
Using them, you can always be sure that you work with correct data and types.
152+
However, there's a bottleneck at the moment of generation.
153+
To get new extension properties, you have to run a cell in a notebook,
149154
which could lead to unnecessary variable declarations.
150-
Currently, we are working on compiler a plugin that generates these properties on the fly while typing!
155+
Currently, we are working on a compiler plugin that generates these properties on the fly while typing!
151156

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

156-
The [KProperties API](KPropertiesApi.md) is useful when you already have declared classed in your application business
157-
logic with fields that correspond columns of a data frame.
161+
The [KProperties API](KPropertiesApi.md) is useful when you already have declared classed in your business
162+
logic with fields that correspond to columns of a data frame.
158163

159164
<table>
160165
<tr>

docs/StardustDocs/topics/cast.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
[//]: # (title: cast)
22
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Modify-->
33

4-
Changes type argument of [`DataFrame`](DataFrame.md) without changing its contents.
4+
Changes the type argument of the [`DataFrame`](DataFrame.md) instance without changing its contents.
55

66
```kotlin
77
cast<T>(verify = false)
88
```
99

1010
**Parameters:**
11-
* `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.
11+
* `verify: Boolean = false`
12+
when `true`, the function throws an exception if the [`DataFrame`](DataFrame.md) instance doesn't match the given schema.
13+
Otherwise, it just changes the format type without actual data checks.
1214

13-
Use this operation to change formal type of [`DataFrame`](DataFrame.md) to match expected schema and enable generated [extension properties](extensionPropertiesApi.md) for it.
15+
Use this operation to change the formal type of a [`DataFrame`](DataFrame.md) instance
16+
to match the expected schema and enable generated [extension properties](extensionPropertiesApi.md) for it.
1417

1518
```kotlin
1619
@DataSchema

docs/StardustDocs/topics/collectionsInterop.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@ _Kotlin DataFrame_ and _Kotlin Collection_ represent two different approaches to
77
* [`DataFrame`](DataFrame.md) stores data by fields/columns
88
* `Collection` stores data by records/rows
99

10-
Although [`DataFrame`](DataFrame.md) doesn't implement [`Collection`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/#kotlin.collections.Collection) or [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/) interface, it has many similar operations,
11-
such as [`filter`](filter.md), [`take`](sliceRows.md#take), [`first`](first.md), [`map`](map.md), [`groupBy`](groupBy.md) etc.
10+
Although [`DataFrame`](DataFrame.md)
11+
doesn't implement the [`Collection`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/#kotlin.collections.Collection)
12+
or [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/)
13+
interface, it has many similar operations,
14+
such as [`filter`](filter.md), [`take`](sliceRows.md#take),
15+
[`first`](first.md), [`map`](map.md), [`groupBy`](groupBy.md) etc.
1216

1317
[`DataFrame`](DataFrame.md) has two-way compatibility with [`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/) and [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/):
1418
* `List<T>` -> `DataFrame<T>`: [toDataFrame](createDataFrame.md#todataframe)
1519
* `DataFrame<T>` -> `List<T>`: [toList](toList.md)
1620
* `Map<String, List<*>>` -> `DataFrame<*>`: [toDataFrame](createDataFrame.md#todataframe)
1721
* `DataFrame<*>` -> `Map<String, List<*>>`: [toMap](toMap.md)
1822

19-
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:
23+
Columns, rows, and values of [`DataFrame`](DataFrame.md)
24+
can be accessed as [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/),
25+
[`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/)
26+
and [`Sequence`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/) accordingly:
2027

2128
<!---FUN getRowsColumns-->
2229

@@ -54,7 +61,8 @@ val df = list.toDataFrame()
5461

5562
<!---END-->
5663

57-
Mark original data class with [`DataSchema`](schemas.md) annotation to get [extension properties](extensionPropertiesApi.md) and perform data transformations.
64+
Mark the original data class with [`DataSchema`](schemas.md)
65+
annotation to get [extension properties](extensionPropertiesApi.md) and perform data transformations.
5866

5967
<!---FUN listInterop3-->
6068

@@ -69,12 +77,12 @@ val df2 = df.add("c") { a + b }
6977

7078
<tip>
7179

72-
To enable extension properties generation you should use [dataframe plugin](schemasGradle.md)
73-
for Gradle or [Kotlin jupyter kernel](installation.md)
80+
To enable extension properties generation, you should use the [DataFrame plugin](schemasGradle.md)
81+
for Gradle or the [Kotlin Jupyter kernel](installation.md)
7482

7583
</tip>
7684

77-
After data is transformed, [`DataFrame`](DataFrame.md) can be exported
85+
After your data is transformed, [`DataFrame`](DataFrame.md) instances can be exported
7886
into [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/) of another data class using [toList](toList.md) or [toListOf](toList.md#tolistof) extensions:
7987

8088
<!---FUN listInterop4-->
@@ -87,6 +95,6 @@ val result = df2.toListOf<Output>()
8795

8896
<!---END-->
8997

90-
### Converting columns with objects instances to ColumnGroup
98+
### Converting columns with object instances to ColumnGroup
9199

92100
[unfold](unfold.md) can be used as [`toDataFrame()`](createDataFrame.md#todataframe) analogue for specific columns inside existing dataframes

docs/StardustDocs/topics/columnAccessorsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DataFrame.read("titanic.csv")
2929

3030
<!---END-->
3131

32-
The `titanic.csv` file could be found [here](https://github.com/Kotlin/dataframe/blob/master/data/titanic.csv).
32+
The `titanic.csv` file can be found [here](https://github.com/Kotlin/dataframe/blob/master/data/titanic.csv).
3333

3434
<warning>
3535
Note that it still doesn’t solve the problem of whether the column actually exists in a data frame, but reduces type casting.

0 commit comments

Comments
 (0)