Skip to content

Commit d61a05d

Browse files
committed
restructure add.md to enable navigation
1 parent 5d0b973 commit d61a05d

File tree

1 file changed

+20
-20
lines changed
  • docs/StardustDocs/topics

1 file changed

+20
-20
lines changed

docs/StardustDocs/topics/add.md

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

55
Returns `DataFrame` which contains all columns from original `DataFrame` followed by newly added columns. Original `DataFrame` is not modified.
66

7-
**Create new column and add it to `DataFrame`:**
7+
## Create new column and add it to `DataFrame`
88

99
```text
1010
add(columnName: String) { rowExpression }
@@ -55,7 +55,7 @@ df.add("fibonacci") {
5555

5656
<!---END-->
5757

58-
**Create and add several columns to `DataFrame`:**
58+
## Create and add several columns to `DataFrame`
5959

6060
```kotlin
6161
add {
@@ -130,41 +130,41 @@ df.add {
130130
</tab></tabs>
131131
<!---END-->
132132

133-
**Add existing column to `DataFrame`:**
133+
### Create columns using intermediate result
134134

135-
<!---FUN addExisting-->
135+
<!---FUN addCalculated-->
136136

137137
```kotlin
138-
val score by columnOf(4, 3, 5, 2, 1, 3, 5)
139-
140-
df.add(score)
141-
df + score
138+
val personWithCityInfo = df.add {
139+
val cityInfo = city.map { queryCityInfo(it) }
140+
"cityInfo" {
141+
cityInfo.map { it.location } into CityInfo::location
142+
cityInfo.map { it.population } into "population"
143+
}
144+
}
142145
```
143146

144147
<!---END-->
145148

146-
**Add all columns from another `DataFrame`:**
149+
## Add existing column to `DataFrame`
147150

148-
<!---FUN addDfs-->
151+
<!---FUN addExisting-->
149152

150153
```kotlin
151-
df.add(df1, df2)
154+
val score by columnOf(4, 3, 5, 2, 1, 3, 5)
155+
156+
df.add(score)
157+
df + score
152158
```
153159

154160
<!---END-->
155161

156-
**Add columns using intermediate result:**
162+
## Add all columns from another `DataFrame`
157163

158-
<!---FUN addCalculated-->
164+
<!---FUN addDfs-->
159165

160166
```kotlin
161-
val personWithCityInfo = df.add {
162-
val cityInfo = city.map { queryCityInfo(it) }
163-
"cityInfo" {
164-
cityInfo.map { it.location } into CityInfo::location
165-
cityInfo.map { it.population } into "population"
166-
}
167-
}
167+
df.add(df1, df2)
168168
```
169169

170170
<!---END-->

0 commit comments

Comments
 (0)