Skip to content
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

Add emptyDataFrame to documentation #201

Merged
merged 1 commit into from
Dec 8, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.jetbrains.kotlinx.dataframe.api.add
import org.jetbrains.kotlinx.dataframe.api.column
import org.jetbrains.kotlinx.dataframe.api.columnGroup
import org.jetbrains.kotlinx.dataframe.api.columnOf
import org.jetbrains.kotlinx.dataframe.api.emptyDataFrame
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
import org.jetbrains.kotlinx.dataframe.api.filter
import org.jetbrains.kotlinx.dataframe.api.frameColumn
Expand Down Expand Up @@ -199,6 +200,15 @@ class Create : TestBase() {
// SampleEnd
}

@Test
fun createEmptyDataFrame() {
// SampleStart
val df = emptyDataFrame()
// SampleEnd
df.columnsCount() shouldBe 0
df.rowsCount() shouldBe 0
}

@Test
fun createDataFrameOf() {
// SampleStart
Expand Down
12 changes: 12 additions & 0 deletions docs/StardustDocs/topics/createDataFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@

This section describes ways to create [`DataFrame`](DataFrame.md).

### emptyDataFrame

Returns [`DataFrame`](DataFrame.md) with no rows and no columns.

<!---FUN createEmptyDataFrame-->

```kotlin
val df = emptyDataFrame()
```

<!---END-->

### dataFrameOf

Returns [`DataFrame`](DataFrame.md) with given column names and values.
Expand Down