diff --git a/.github/README_GH_ACTIONS.md b/.github/README_GH_ACTIONS.md index 48ae01de7a..ae927fd4ca 100644 --- a/.github/README_GH_ACTIONS.md +++ b/.github/README_GH_ACTIONS.md @@ -22,7 +22,7 @@ Anytime the source code changes on [master](https://github.com/Kotlin/dataframe/ this [GitHub Action](./workflows/generated-sources-master.yml) makes sure [`processKDocsMain`](../KDOC_PREPROCESSING.md), and `korro` are run. If there have been any changes in either [core/generated-sources](../core/generated-sources) or -[docs/StardustDocs/snippets](../docs/StardustDocs/snippets), these are auto-committed to the branch, to keep +[docs/StardustDocs/resources/snippets](../docs/StardustDocs/resources/snippets), these are auto-committed to the branch, to keep it up to date. ### Show generated code in PR diff --git a/.github/workflows/generated-sources-master.yml b/.github/workflows/generated-sources-master.yml index 058d762b79..230497702a 100644 --- a/.github/workflows/generated-sources-master.yml +++ b/.github/workflows/generated-sources-master.yml @@ -26,7 +26,7 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git add './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics' + git add './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/resources/snippets' './docs/StardustDocs/topics' git diff --staged --quiet || git commit -m "Automated commit of generated code" git push env: diff --git a/.github/workflows/generated-sources.yml b/.github/workflows/generated-sources.yml index e0339d89b2..89258b1aa1 100644 --- a/.github/workflows/generated-sources.yml +++ b/.github/workflows/generated-sources.yml @@ -42,14 +42,14 @@ jobs: - name: Check for changes in generated sources id: git-diff - run: echo "changed=$(if git diff --quiet './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics'; then echo 'false'; else echo 'true'; fi)" >> $GITHUB_OUTPUT + run: echo "changed=$(if git diff --quiet './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/resources/snippets' './docs/StardustDocs/topics'; then echo 'false'; else echo 'true'; fi)" >> $GITHUB_OUTPUT - name: Commit and push if changes id: git-commit if: steps.git-diff.outputs.changed == 'true' run: | git checkout -b generated-sources/docs-update-${{ github.run_number }} - git add './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/snippets' './docs/StardustDocs/topics' + git add './core/generated-sources' './dataframe-csv/generated-sources' './docs/StardustDocs/resources/snippets' './docs/StardustDocs/topics' git commit -m "Update generated sources with recent changes" git push origin generated-sources/docs-update-${{ github.run_number }} echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT diff --git a/KDOC_PREPROCESSING.md b/KDOC_PREPROCESSING.md index 2f494704d5..a387b09333 100644 --- a/KDOC_PREPROCESSING.md +++ b/KDOC_PREPROCESSING.md @@ -693,7 +693,7 @@ A fully interactive, single-source-of-truth grammar for the Columns Selection DS There's a special annotation, `@ExportAsHtml`, that allows you to export the content of the KDoc of the annotated function, interface, or class as HTML. The Markdown of the KDoc is rendered to HTML using [JetBrains/markdown](https://github.com/JetBrains/markdown) and, in -the case of DataFrame, put in [./docs/StardustDocs/snippets/kdocs](./docs/StardustDocs/snippets/kdocs). +the case of DataFrame, put in [./docs/StardustDocs/resources/snippets/kdocs](docs/StardustDocs/resources/snippets/kdocs). From there, the HTML can be included in any WriterSide page as an iFrame. This can be done using our custom `` tag. diff --git a/build.gradle.kts b/build.gradle.kts index 64743f78f5..8c7d94f639 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -154,6 +154,7 @@ val modulesUsingJava11 = with(projects) { dataframeJupyter, dataframeGeo, examples.ideaExamples.titanic, + tests, ) }.map { it.path } diff --git a/core/README.md b/core/README.md index 5f761ede11..24a199f50c 100644 --- a/core/README.md +++ b/core/README.md @@ -25,7 +25,7 @@ by [Korro](https://github.com/devcrocod/korro). Aside from code samples, `@TransformDataFrameExpressions` annotated test functions also generate sample dataframe HTML files that can be used as iFrames on the documentation website. -They are tested, generated, and copied over to [docs/StardustDocs/snippets](../docs/StardustDocs/snippets) by +They are tested, generated, and copied over to [docs/StardustDocs/resources/snippets](../docs/StardustDocs/resources/snippets) by our "explainer" [plugin callback proxy](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer), which hooks into [the TestBase class](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/TestBase.kt) and retrieves the intermediate DataFrame expressions thanks to our "explainer" compiler plugin @@ -33,7 +33,7 @@ retrieves the intermediate DataFrame expressions thanks to our "explainer" compi We can also generate "normal" DataFrame samples for the website. This can be done using the [OtherSamples class](./src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt). Generated -HTML files will be stored in [docs/StardustDocs/snippets/manual](../docs/StardustDocs/snippets/manual). +HTML files will be stored in [docs/StardustDocs/resources/snippets/manual](../docs/StardustDocs/resources/snippets/manual). ### KoDEx @@ -45,4 +45,4 @@ See the [KDoc Preprocessing Guide](../KDOC_PREPROCESSING.md) for more informatio KDocs can also be exported to HTML, for them to be reused on the website. Elements annotated with `@ExportAsHtml` will have their generated content be copied over to -[docs/StardustDocs/snippets/kdocs](../docs/StardustDocs/snippets/kdocs). +[docs/StardustDocs/resources/snippets/kdocs](../docs/StardustDocs/resources/snippets/kdocs). diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 3c519eb80c..0ce27ed919 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -145,7 +145,7 @@ val clearSamplesOutputs by tasks.creating { doFirst { delete { - val generatedSnippets = fileTree(file("../docs/StardustDocs/snippets")) + val generatedSnippets = fileTree(file("../docs/StardustDocs/resources/snippets")) .exclude("**/manual/**", "**/kdocs/**") delete(generatedSnippets) } @@ -155,7 +155,7 @@ val clearSamplesOutputs by tasks.creating { val addSamplesToGit by tasks.creating(GitTask::class) { directory = file(".") command = "add" - args = listOf("-A", "../docs/StardustDocs/snippets") + args = listOf("-A", "../docs/StardustDocs/resources/snippets") } val copySamplesOutputs = tasks.register("copySamplesOutputs") { @@ -218,7 +218,7 @@ val processKDocsMain by creatingRunKodexTask(processKDocsMainSources) { outputReadOnly = false exportAsHtml { - dir = file("../docs/StardustDocs/snippets/kdocs") + dir = file("../docs/StardustDocs/resources/snippets/kdocs") } finalizedBy("runKtlintFormatOverGeneratedSourcesSourceSet") } diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/PluginCallbackProxy.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/PluginCallbackProxy.kt index 2f90f193f5..dd74e411fa 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/PluginCallbackProxy.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/PluginCallbackProxy.kt @@ -131,7 +131,7 @@ object PluginCallbackProxy : PluginCallback { File(korro, group).writeText( """ - + """.trimIndent(), ) } diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/SampleAggregator.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/SampleAggregator.kt index 73ed43ca43..5111bbe534 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/SampleAggregator.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/SampleAggregator.kt @@ -13,7 +13,7 @@ fun main() { .groupBy { it.nameWithoutExtension.substringBefore("_") }.mapValues { (name, files) -> - val target = File("../docs/StardustDocs/snippets") + val target = File("../docs/StardustDocs/resources/snippets") val original = files .firstOrNull { it.nameWithoutExtension.contains("properties") } ?: files.first() diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt index 13f695f1bb..c875bd9fb5 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt @@ -21,7 +21,7 @@ class OtherSamples { } private fun writeTable(df: AnyFrame, name: String) { - val dir = File("../docs/StardustDocs/snippets/manual").also { it.mkdirs() } + val dir = File("../docs/StardustDocs/resources/snippets/manual").also { it.mkdirs() } val html = df.toStandaloneHtml(getFooter = WritersideFooter) + WritersideStyle html.writeHtml(File(dir, "$name.html")) } diff --git a/dataframe-csv/build.gradle.kts b/dataframe-csv/build.gradle.kts index 1a73328eed..b38f4bcb3c 100644 --- a/dataframe-csv/build.gradle.kts +++ b/dataframe-csv/build.gradle.kts @@ -91,7 +91,7 @@ val processKDocsMain by creatingRunKodexTask(processKDocsMainSources) { outputReadOnly = false exportAsHtml { - dir = file("../docs/StardustDocs/snippets/kdocs") + dir = file("../docs/StardustDocs/resources/snippets/kdocs") } finalizedBy("runKtlintFormatOverGeneratedSourcesSourceSet") } diff --git a/docs/README.md b/docs/README.md index 633c7d7d05..d3707288ae 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,7 +15,7 @@ Images all README files can be stored in [docs/imgs](./imgs). ### Explainer dataframes `@TransformDataFrameExpressions` annotated test functions generate sample dataframe HTML files that can be used as iFrames on the documentation website. -They are tested, generated, and copied over to [docs/StardustDocs/snippets](./StardustDocs/snippets) by +They are tested, generated, and copied over to [docs/StardustDocs/resources/snippets](StardustDocs/resources/snippets) by our "explainer" [plugin callback proxy](../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer), which hooks into [the TestBase class](../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/TestBase.kt) and retrieves the intermediate DataFrame expressions thanks to @@ -23,12 +23,12 @@ our "explainer" compiler plugin [:plugins:expressions-converter](../plugins/expr We can also generate "normal" DataFrame samples for the website. This can be done using the [OtherSamples class](../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/OtherSamples.kt). Generated -HTML files will be stored in [docs/StardustDocs/snippets/manual](./StardustDocs/snippets/manual). +HTML files will be stored in [docs/StardustDocs/resources/snippets/manual](StardustDocs/resources/snippets/manual). ### KDoc Preprocessor KDocs can also be exported to HTML, for them to be reused on the website. Elements annotated with `@ExportAsHtml` will have their generated content be copied over to -[docs/StardustDocs/snippets/kdocs](./StardustDocs/snippets/kdocs). +[docs/StardustDocs/resources/snippets/kdocs](StardustDocs/resources/snippets/kdocs). ### Korro code samples Code samples for the documentation website reside in [core/.../test/.../samples/api](../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api) diff --git a/docs/StardustDocs/cfg/buildprofiles.xml b/docs/StardustDocs/cfg/buildprofiles.xml index b209252a30..e2f73e51b7 100644 --- a/docs/StardustDocs/cfg/buildprofiles.xml +++ b/docs/StardustDocs/cfg/buildprofiles.xml @@ -16,6 +16,7 @@ resize-iframes.js true https://github.com/Kotlin/dataframe/edit/master/docs/StardustDocs/ + include-head.html diff --git a/docs/StardustDocs/cfg/include-head.html b/docs/StardustDocs/cfg/include-head.html new file mode 100644 index 0000000000..c5c5b30393 --- /dev/null +++ b/docs/StardustDocs/cfg/include-head.html @@ -0,0 +1 @@ + diff --git a/docs/StardustDocs/cfg/static/custom.js b/docs/StardustDocs/cfg/static/custom.js new file mode 100644 index 0000000000..5de1a722f7 --- /dev/null +++ b/docs/StardustDocs/cfg/static/custom.js @@ -0,0 +1,67 @@ +window.addEventListener('load', () => { + function updateIframeThemes(theme) { + const iframes = document.querySelectorAll('iframe'); + + iframes.forEach((iframe) => { + if (iframe.contentWindow && iframe.contentWindow.document) { + iframe.contentWindow.document.documentElement.setAttribute('theme', theme); + } + }); + } + + function observeHtmlClassChanges() { + const htmlElement = document.documentElement; + + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.type === 'attributes' && mutation.attributeName === 'class') { + const theme = htmlElement.classList.contains('theme-light') ? 'light' : 'dark'; + updateIframeThemes(theme); + } + }); + }); + + observer.observe(htmlElement, { attributes: true }); + } + + window.addEventListener('message', (event) => { + if (event.data.type === 'iframeHeight') { + document.querySelectorAll('iframe').forEach((iframe) => { + if (iframe.contentWindow === event.source) { + iframe.style.height = event.data.height + 'px'; + } + }); + } + }); + + function observeIframe(iframe) { + const theme = document.documentElement.classList.contains('theme-light') ? 'light' : 'dark'; + + function sendTheme() { + iframe.contentDocument.documentElement.setAttribute('theme', theme); + } + + iframe.addEventListener('load', sendTheme); + if (iframe.contentDocument.readyState === 'complete') sendTheme(); + } + + document.querySelectorAll('iframe').forEach(observeIframe); + + const bodyObserver = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((node) => { + if (node.tagName === 'IFRAME') observeIframe(node); + else if (node.querySelectorAll) { + node.querySelectorAll('iframe').forEach(observeIframe); + } + }); + }); + }); + + bodyObserver.observe(document.body, { childList: true, subtree: true }); + + observeHtmlClassChanges(); + + const initialTheme = document.documentElement.classList.contains('theme-light') ? 'light' : 'dark'; + updateIframeThemes(initialTheme); +}); diff --git a/docs/StardustDocs/d.tree b/docs/StardustDocs/d.tree index 95a3aa7cc3..bd30db31fe 100644 --- a/docs/StardustDocs/d.tree +++ b/docs/StardustDocs/d.tree @@ -5,8 +5,14 @@ + start-page="Home.topic"> + + + + + + @@ -191,4 +197,7 @@ + + diff --git a/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16.svg b/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16.svg new file mode 100644 index 0000000000..eda39a64ac --- /dev/null +++ b/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16.svg @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + kotlin + + + + + + + + + intellij-community + + + + + + + + + kotlin-native + + + + + + + + + compose-jb + + + + + + + + + ideavim + + + + + + + + + JetBrainsMono + + + + + + + + + Exposed + + + + + + + + + ring-ui + + + + + + + + + kotlinconf-app + + + + + + + + + create-react-kotlin-app + + + + + + + + + + + 0 + + + + + + + 5,000 + + + + + + + 10,000 + + + + + + + 15,000 + + + + + + + 20,000 + + + + + + + 25,000 + + + + + + + 30,000 + + + + + + + 35,000 + + + + + + + 40,000 + + + + + + + + + Top 10 JetBrains repositories by stars count + + + + + starsCount + + + + + name + + + + + + + + \ No newline at end of file diff --git a/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16_dark.svg b/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16_dark.svg new file mode 100644 index 0000000000..a1feb898ba --- /dev/null +++ b/docs/StardustDocs/images/guides/quickstart/notebook_test_quickstart_16_dark.svg @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + kotlin + + + + + + + + + intellij-community + + + + + + + + + kotlin-native + + + + + + + + + compose-jb + + + + + + + + + ideavim + + + + + + + + + JetBrainsMono + + + + + + + + + Exposed + + + + + + + + + ring-ui + + + + + + + + + kotlinconf-app + + + + + + + + + create-react-kotlin-app + + + + + + + + + + + 0 + + + + + + + 5,000 + + + + + + + 10,000 + + + + + + + 15,000 + + + + + + + 20,000 + + + + + + + 25,000 + + + + + + + 30,000 + + + + + + + 35,000 + + + + + + + 40,000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Top 10 JetBrains repositories by stars count + + + + + starsCount + + + + + name + + + + + + + + \ No newline at end of file diff --git a/docs/StardustDocs/resources/guides/quickstart.ipynb b/docs/StardustDocs/resources/guides/quickstart.ipynb new file mode 100644 index 0000000000..c320a7f179 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart.ipynb @@ -0,0 +1,8289 @@ +{ + "cells": [ + { + "metadata": {}, + "cell_type": "markdown", + "source": "# Quickstart" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "To start working with Kotlin DataFrame in a notebook, run the cell with the next code:" + }, + { + "cell_type": "code", + "metadata": { + "collapsed": true, + "ExecuteTime": { + "end_time": "2025-05-01T13:42:31.795685Z", + "start_time": "2025-05-01T13:42:24.748992Z" + } + }, + "source": [ + "%useLatestDescriptors\n", + "%use dataframe" + ], + "outputs": [], + "execution_count": 1 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "This will load all necessary DataFrame dependencies (of the latest stable version) and all imports, as well as DataFrame rendering. Learn more here" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Read DataFrame" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Kotlin DataFrame supports all popular data formats, including CSV, JSON and Excel, as well as reading from various databases. Read a CSV with the \"Jetbrains Repositories\" dataset into `df` variable:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.441575Z", + "start_time": "2025-05-01T13:42:31.823137Z" + } + }, + "cell_type": "code", + "source": [ + "val df = DataFrame.readCSV(\n", + " \"https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv\"\n", + ")" + ], + "outputs": [], + "execution_count": 2 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Display And Explore" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "To display your dataframe as a cell output, place it in the last line of the cell:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.538828Z", + "start_time": "2025-05-01T13:42:32.465804Z" + } + }, + "cell_type": "code", + "source": "df", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namehtml_urlstargazers_counttopicswatchers
JetBrains/JPShttps://github.com/JetBrains/JPS23[]23
JetBrains/YouTrackSharphttps://github.com/JetBrains/YouTrack...115[jetbrains, jetbrains-youtrack, youtr...115
JetBrains/colorSchemeToolhttps://github.com/JetBrains/colorSch...290[]290
JetBrains/ideavimhttps://github.com/JetBrains/ideavim6120[ideavim, intellij, intellij-platform...6120
JetBrains/youtrack-vcs-hookshttps://github.com/JetBrains/youtrack...5[]5
JetBrains/youtrack-rest-ruby-libraryhttps://github.com/JetBrains/youtrack...8[]8
JetBrains/emacs4ijhttps://github.com/JetBrains/emacs4ij47[]47
JetBrains/codereview4intellijhttps://github.com/JetBrains/coderevi...11[]11
JetBrains/teamcity-nuget-supporthttps://github.com/JetBrains/teamcity...41[nuget, nuget-feed, teamcity, teamcit...41
JetBrains/Grammar-Kithttps://github.com/JetBrains/Grammar-Kit534[]534
JetBrains/intellij-starteam-pluginhttps://github.com/JetBrains/intellij...6[]6
JetBrains/la-clojurehttps://github.com/JetBrains/la-clojure218[]218
JetBrains/MPShttps://github.com/JetBrains/MPS1241[domain-specific-language, dsl]1241
JetBrains/intellij-communityhttps://github.com/JetBrains/intellij...12926[code-editor, ide, intellij, intellij...12926
JetBrains/TeamCity.ServiceMessageshttps://github.com/JetBrains/TeamCity...39[c-sharp, teamcity, teamcity-service-...39
JetBrains/youtrack-rest-python-libraryhttps://github.com/JetBrains/youtrack...118[]118
JetBrains/intellij-scalahttps://github.com/JetBrains/intellij...1066[intellij-idea, intellij-plugin, scala]1066
JetBrains/teamcity-messageshttps://github.com/JetBrains/teamcity...125[]125
JetBrains/teamcity-cpphttps://github.com/JetBrains/teamcity...27[]27
JetBrains/kotlinhttps://github.com/JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...39402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"html_url\",\"stargazers_count\",\"topics\",\"watchers\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"java.net.URL\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":562,\"ncol\":5},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/JPS\",\"html_url\":\"https://github.com/JetBrains/JPS\",\"stargazers_count\":23,\"topics\":\"[]\",\"watchers\":23},{\"full_name\":\"JetBrains/YouTrackSharp\",\"html_url\":\"https://github.com/JetBrains/YouTrackSharp\",\"stargazers_count\":115,\"topics\":\"[jetbrains, jetbrains-youtrack, youtrack, youtrack-api]\",\"watchers\":115},{\"full_name\":\"JetBrains/colorSchemeTool\",\"html_url\":\"https://github.com/JetBrains/colorSchemeTool\",\"stargazers_count\":290,\"topics\":\"[]\",\"watchers\":290},{\"full_name\":\"JetBrains/ideavim\",\"html_url\":\"https://github.com/JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\",\"watchers\":6120},{\"full_name\":\"JetBrains/youtrack-vcs-hooks\",\"html_url\":\"https://github.com/JetBrains/youtrack-vcs-hooks\",\"stargazers_count\":5,\"topics\":\"[]\",\"watchers\":5},{\"full_name\":\"JetBrains/youtrack-rest-ruby-library\",\"html_url\":\"https://github.com/JetBrains/youtrack-rest-ruby-library\",\"stargazers_count\":8,\"topics\":\"[]\",\"watchers\":8},{\"full_name\":\"JetBrains/emacs4ij\",\"html_url\":\"https://github.com/JetBrains/emacs4ij\",\"stargazers_count\":47,\"topics\":\"[]\",\"watchers\":47},{\"full_name\":\"JetBrains/codereview4intellij\",\"html_url\":\"https://github.com/JetBrains/codereview4intellij\",\"stargazers_count\":11,\"topics\":\"[]\",\"watchers\":11},{\"full_name\":\"JetBrains/teamcity-nuget-support\",\"html_url\":\"https://github.com/JetBrains/teamcity-nuget-support\",\"stargazers_count\":41,\"topics\":\"[nuget, nuget-feed, teamcity, teamcity-plugin]\",\"watchers\":41},{\"full_name\":\"JetBrains/Grammar-Kit\",\"html_url\":\"https://github.com/JetBrains/Grammar-Kit\",\"stargazers_count\":534,\"topics\":\"[]\",\"watchers\":534},{\"full_name\":\"JetBrains/intellij-starteam-plugin\",\"html_url\":\"https://github.com/JetBrains/intellij-starteam-plugin\",\"stargazers_count\":6,\"topics\":\"[]\",\"watchers\":6},{\"full_name\":\"JetBrains/la-clojure\",\"html_url\":\"https://github.com/JetBrains/la-clojure\",\"stargazers_count\":218,\"topics\":\"[]\",\"watchers\":218},{\"full_name\":\"JetBrains/MPS\",\"html_url\":\"https://github.com/JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\",\"watchers\":1241},{\"full_name\":\"JetBrains/intellij-community\",\"html_url\":\"https://github.com/JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\",\"watchers\":12926},{\"full_name\":\"JetBrains/TeamCity.ServiceMessages\",\"html_url\":\"https://github.com/JetBrains/TeamCity.ServiceMessages\",\"stargazers_count\":39,\"topics\":\"[c-sharp, teamcity, teamcity-service-messages]\",\"watchers\":39},{\"full_name\":\"JetBrains/youtrack-rest-python-library\",\"html_url\":\"https://github.com/JetBrains/youtrack-rest-python-library\",\"stargazers_count\":118,\"topics\":\"[]\",\"watchers\":118},{\"full_name\":\"JetBrains/intellij-scala\",\"html_url\":\"https://github.com/JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\",\"watchers\":1066},{\"full_name\":\"JetBrains/teamcity-messages\",\"html_url\":\"https://github.com/JetBrains/teamcity-messages\",\"stargazers_count\":125,\"topics\":\"[]\",\"watchers\":125},{\"full_name\":\"JetBrains/teamcity-cpp\",\"html_url\":\"https://github.com/JetBrains/teamcity-cpp\",\"stargazers_count\":27,\"topics\":\"[]\",\"watchers\":27},{\"full_name\":\"JetBrains/kotlin\",\"html_url\":\"https://github.com/JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\",\"watchers\":39402}]}" + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 3 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Kotlin Notebook has special interactive outputs for `DataFrame`. Learn more about them here." + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Use `.describe()` method to get dataset summaries — column types, number of nulls and simple statistics." + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.765356Z", + "start_time": "2025-05-01T13:42:32.666531Z" + } + }, + "cell_type": "code", + "source": "df.describe()", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
nametypecountuniquenullstopfreqmeanstdminmedianmax
full_nameString5625620JetBrains/JPS1nullnullJetBrains/Android-Tuts-SamplesJetBrains/lightbeamJetBrains/ztools
html_urlURL5625620https://github.com/JetBrains/JPS1nullnullnullnullnull
stargazers_countInt56216501100244,7597861862,8019820839402
topicsString5621450[]401nullnull[2d, graphics, java, skia][][youtrack, youtrack-workflow]
watchersInt56216501100244,7597861862,8019820839402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"type\",\"count\",\"unique\",\"nulls\",\"top\",\"freq\",\"mean\",\"std\",\"min\",\"median\",\"max\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"java.io.Serializable\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"}],\"nrow\":5,\"ncol\":12},\"kotlin_dataframe\":[{\"name\":\"full_name\",\"type\":\"String\",\"count\":562,\"unique\":562,\"nulls\":0,\"top\":\"JetBrains/JPS\",\"freq\":1,\"mean\":null,\"std\":null,\"min\":\"JetBrains/Android-Tuts-Samples\",\"median\":\"JetBrains/lightbeam\",\"max\":\"JetBrains/ztools\"},{\"name\":\"html_url\",\"type\":\"URL\",\"count\":562,\"unique\":562,\"nulls\":0,\"top\":\"https://github.com/JetBrains/JPS\",\"freq\":1,\"mean\":null,\"std\":null,\"min\":null,\"median\":null,\"max\":null},{\"name\":\"stargazers_count\",\"type\":\"Int\",\"count\":562,\"unique\":165,\"nulls\":0,\"top\":\"1\",\"freq\":100,\"mean\":244.75978647686833,\"std\":1862.8019819171673,\"min\":\"0\",\"median\":\"8\",\"max\":\"39402\"},{\"name\":\"topics\",\"type\":\"String\",\"count\":562,\"unique\":145,\"nulls\":0,\"top\":\"[]\",\"freq\":401,\"mean\":null,\"std\":null,\"min\":\"[2d, graphics, java, skia]\",\"median\":\"[]\",\"max\":\"[youtrack, youtrack-workflow]\"},{\"name\":\"watchers\",\"type\":\"Int\",\"count\":562,\"unique\":165,\"nulls\":0,\"top\":\"1\",\"freq\":100,\"mean\":244.75978647686833,\"std\":1862.8019819171673,\"min\":\"0\",\"median\":\"8\",\"max\":\"39402\"}]}" + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 4 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Select Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Kotlin DataFrame features a typesafe Columns Selection DSL, enabling flexible and safe selection of any combination of columns.\n", + "Column selectors are widely used across operations — one of the simplest examples is `.select { }`, which returns a new DataFrame with only the columns chosen in Columns Selection expression.\n", + "\n", + "After executing the cell where a `DataFrame` variable is declared, an extension with properties for its columns is automatically generated.\n", + "These properties can then be used in the Columns Selection DSL expression for typesafe and convenient column access.\n", + "\n", + "Select some columns:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.986689Z", + "start_time": "2025-05-01T13:42:32.810436Z" + } + }, + "cell_type": "code", + "source": [ + "// Select \"full_name\", \"stargazers_count\" and \"topics\" columns\n", + "val dfSelected = df.select { full_name and stargazers_count and topics }\n", + "dfSelected" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namestargazers_counttopics
JetBrains/JPS23[]
JetBrains/YouTrackSharp115[jetbrains, jetbrains-youtrack, youtr...
JetBrains/colorSchemeTool290[]
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/youtrack-vcs-hooks5[]
JetBrains/youtrack-rest-ruby-library8[]
JetBrains/emacs4ij47[]
JetBrains/codereview4intellij11[]
JetBrains/teamcity-nuget-support41[nuget, nuget-feed, teamcity, teamcit...
JetBrains/Grammar-Kit534[]
JetBrains/intellij-starteam-plugin6[]
JetBrains/la-clojure218[]
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/TeamCity.ServiceMessages39[c-sharp, teamcity, teamcity-service-...
JetBrains/youtrack-rest-python-library118[]
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/teamcity-messages125[]
JetBrains/teamcity-cpp27[]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"stargazers_count\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":562,\"ncol\":3},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/JPS\",\"stargazers_count\":23,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/YouTrackSharp\",\"stargazers_count\":115,\"topics\":\"[jetbrains, jetbrains-youtrack, youtrack, youtrack-api]\"},{\"full_name\":\"JetBrains/colorSchemeTool\",\"stargazers_count\":290,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"full_name\":\"JetBrains/youtrack-vcs-hooks\",\"stargazers_count\":5,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/youtrack-rest-ruby-library\",\"stargazers_count\":8,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/emacs4ij\",\"stargazers_count\":47,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/codereview4intellij\",\"stargazers_count\":11,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/teamcity-nuget-support\",\"stargazers_count\":41,\"topics\":\"[nuget, nuget-feed, teamcity, teamcity-plugin]\"},{\"full_name\":\"JetBrains/Grammar-Kit\",\"stargazers_count\":534,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/intellij-starteam-plugin\",\"stargazers_count\":6,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/la-clojure\",\"stargazers_count\":218,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"full_name\":\"JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"full_name\":\"JetBrains/TeamCity.ServiceMessages\",\"stargazers_count\":39,\"topics\":\"[c-sharp, teamcity, teamcity-service-messages]\"},{\"full_name\":\"JetBrains/youtrack-rest-python-library\",\"stargazers_count\":118,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"full_name\":\"JetBrains/teamcity-messages\",\"stargazers_count\":125,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/teamcity-cpp\",\"stargazers_count\":27,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"}]}" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 5 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Raw Filtering" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Some operations use `RowExpression`, i.e., expression that applies for all `DataFrame` rows. For example `.filter { }` that returns a new `DataFrame` with rows that satisfy a condition given by row expression.\n", + "\n", + "Inside a row expression, you can access the values of the current row by column names through auto-generated properties.\n", + "Similar to the Columns Selection DSL, but in this case the properties represent actual values, not column references.\n", + "\n", + "Filter rows by \"stargazers_count\" value:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.082510Z", + "start_time": "2025-05-01T13:42:33.031897Z" + } + }, + "cell_type": "code", + "source": [ + "// Keep only rows where \"stargazers_count\" value is more than 1000\n", + "val dfFiltered = dfSelected.filter { stargazers_count >= 1000 }\n", + "dfFiltered" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namestargazers_counttopics
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
JetBrains/intellij-plugins1737[]
JetBrains/Exposed5688[dao, kotlin, orm, sql]
JetBrains/kotlin-web-site1074[kotlin]
JetBrains/idea-gitignore1181[gitignore, ignore-files, intellij, i...
JetBrains/swot1072[]
JetBrains/phpstorm-stubs1110[]
JetBrains/gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
JetBrains/svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
JetBrains/resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
JetBrains/kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
JetBrains/create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
JetBrains/ring-ui2836[components, jetbrains-ui, react]
JetBrains/kotlinconf-app2628[]
JetBrains/JetBrainsMono6059[coding-font, font, ligatures, monosp...
JetBrains/intellij-platform-plugin-te...1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"stargazers_count\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"full_name\":\"JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"full_name\":\"JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"full_name\":\"JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"full_name\":\"JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"},{\"full_name\":\"JetBrains/intellij-plugins\",\"stargazers_count\":1737,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/Exposed\",\"stargazers_count\":5688,\"topics\":\"[dao, kotlin, orm, sql]\"},{\"full_name\":\"JetBrains/kotlin-web-site\",\"stargazers_count\":1074,\"topics\":\"[kotlin]\"},{\"full_name\":\"JetBrains/idea-gitignore\",\"stargazers_count\":1181,\"topics\":\"[gitignore, ignore-files, intellij, intellij-plugin, java]\"},{\"full_name\":\"JetBrains/swot\",\"stargazers_count\":1072,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/phpstorm-stubs\",\"stargazers_count\":1110,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/gradle-intellij-plugin\",\"stargazers_count\":1058,\"topics\":\"[gradle, gradle-intellij-plugin, gradle-kotlin-dsl, groovy, intellij, intellij-ides, intellij-platform, intellij-plugin, intellij-sdk, jetbrains-plugin, kotlin, plugin-verifier, publishing-dsl, setup-dsl, teamcity, travis-configuration]\"},{\"full_name\":\"JetBrains/svg-sprite-loader\",\"stargazers_count\":1815,\"topics\":\"[sprite, svg, svg-sprite, svg-stack, webpack, webpack-loader, webpack-plugin, webpack2, webpack3]\"},{\"full_name\":\"JetBrains/resharper-unity\",\"stargazers_count\":1017,\"topics\":\"[hacktoberfest, jetbrains, plugin, resharper, resharper-plugin, rider, unity, unity-editor]\"},{\"full_name\":\"JetBrains/kotlin-native\",\"stargazers_count\":7101,\"topics\":\"[c, compiler, kotlin, llvm, objective-c]\"},{\"full_name\":\"JetBrains/create-react-kotlin-app\",\"stargazers_count\":2424,\"topics\":\"[create-react-app, jetbrains-ui, kotlin, react, webpack]\"},{\"full_name\":\"JetBrains/ring-ui\",\"stargazers_count\":2836,\"topics\":\"[components, jetbrains-ui, react]\"},{\"full_name\":\"JetBrains/kotlinconf-app\",\"stargazers_count\":2628,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/JetBrainsMono\",\"stargazers_count\":6059,\"topics\":\"[coding-font, font, ligatures, monospaced-font, programming-font, programming-ligatures]\"},{\"full_name\":\"JetBrains/intellij-platform-plugin-template\",\"stargazers_count\":1133,\"topics\":\"[intellij, intellij-idea, intellij-idea-plugin, intellij-platform, intellij-plugin, intellij-plugins, jetbrains-plugin]\"}]}" + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 6 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Columns Rename" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Columns can be renamed using the `.rename { }` operation, which also uses the Columns Selection DSL to select a column to rename.\n", + "The `rename` operation does not perform the renaming immediately; instead, it creates an intermediate object that must be finalized into a new `DataFrame` by calling the `.into()` function with the new column name.\n", + "\n", + "Rename \"full_name\" and \"stargazers_count\" columns:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.268662Z", + "start_time": "2025-05-01T13:42:33.136288Z" + } + }, + "cell_type": "code", + "source": [ + "// Rename \"full_name\" column into \"name\"\n", + "val dfRenamed = dfFiltered\n", + " .rename { full_name }.into(\"name\")\n", + " // And \"stargazers_count\" into \"starsCount\"\n", + " .rename { stargazers_count }.into(\"starsCount\")\n", + "dfRenamed" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopics
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
JetBrains/intellij-plugins1737[]
JetBrains/Exposed5688[dao, kotlin, orm, sql]
JetBrains/kotlin-web-site1074[kotlin]
JetBrains/idea-gitignore1181[gitignore, ignore-files, intellij, i...
JetBrains/swot1072[]
JetBrains/phpstorm-stubs1110[]
JetBrains/gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
JetBrains/svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
JetBrains/resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
JetBrains/kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
JetBrains/create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
JetBrains/ring-ui2836[components, jetbrains-ui, react]
JetBrains/kotlinconf-app2628[]
JetBrains/JetBrainsMono6059[coding-font, font, ligatures, monosp...
JetBrains/intellij-platform-plugin-te...1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"JetBrains/ideavim\",\"starsCount\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"name\":\"JetBrains/MPS\",\"starsCount\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"name\":\"JetBrains/intellij-community\",\"starsCount\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"name\":\"JetBrains/intellij-scala\",\"starsCount\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"name\":\"JetBrains/kotlin\",\"starsCount\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"},{\"name\":\"JetBrains/intellij-plugins\",\"starsCount\":1737,\"topics\":\"[]\"},{\"name\":\"JetBrains/Exposed\",\"starsCount\":5688,\"topics\":\"[dao, kotlin, orm, sql]\"},{\"name\":\"JetBrains/kotlin-web-site\",\"starsCount\":1074,\"topics\":\"[kotlin]\"},{\"name\":\"JetBrains/idea-gitignore\",\"starsCount\":1181,\"topics\":\"[gitignore, ignore-files, intellij, intellij-plugin, java]\"},{\"name\":\"JetBrains/swot\",\"starsCount\":1072,\"topics\":\"[]\"},{\"name\":\"JetBrains/phpstorm-stubs\",\"starsCount\":1110,\"topics\":\"[]\"},{\"name\":\"JetBrains/gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":\"[gradle, gradle-intellij-plugin, gradle-kotlin-dsl, groovy, intellij, intellij-ides, intellij-platform, intellij-plugin, intellij-sdk, jetbrains-plugin, kotlin, plugin-verifier, publishing-dsl, setup-dsl, teamcity, travis-configuration]\"},{\"name\":\"JetBrains/svg-sprite-loader\",\"starsCount\":1815,\"topics\":\"[sprite, svg, svg-sprite, svg-stack, webpack, webpack-loader, webpack-plugin, webpack2, webpack3]\"},{\"name\":\"JetBrains/resharper-unity\",\"starsCount\":1017,\"topics\":\"[hacktoberfest, jetbrains, plugin, resharper, resharper-plugin, rider, unity, unity-editor]\"},{\"name\":\"JetBrains/kotlin-native\",\"starsCount\":7101,\"topics\":\"[c, compiler, kotlin, llvm, objective-c]\"},{\"name\":\"JetBrains/create-react-kotlin-app\",\"starsCount\":2424,\"topics\":\"[create-react-app, jetbrains-ui, kotlin, react, webpack]\"},{\"name\":\"JetBrains/ring-ui\",\"starsCount\":2836,\"topics\":\"[components, jetbrains-ui, react]\"},{\"name\":\"JetBrains/kotlinconf-app\",\"starsCount\":2628,\"topics\":\"[]\"},{\"name\":\"JetBrains/JetBrainsMono\",\"starsCount\":6059,\"topics\":\"[coding-font, font, ligatures, monospaced-font, programming-font, programming-ligatures]\"},{\"name\":\"JetBrains/intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":\"[intellij, intellij-idea, intellij-idea-plugin, intellij-platform, intellij-plugin, intellij-plugins, jetbrains-plugin]\"}]}" + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 7 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Modify Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Columns can be modified using the `update { }` and `convert { }` operations.\n", + "Both operations select columns to modify via the Columns Selection DSL and, similar to `rename`, create an intermediate object that must be finalized to produce a new `DataFrame`.\n", + "\n", + "The `update` operation preserves the original column types, while `convert` allows changing the type.\n", + "In both cases, column names and their positions remain unchanged.\n", + "\n", + "Update \"name\" and convert \"topics\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.518212Z", + "start_time": "2025-05-01T13:42:33.311730Z" + } + }, + "cell_type": "code", + "source": [ + "val dfUpdated = dfRenamed\n", + " // Update \"name\" values with only its second part (after '/')\n", + " .update { name }.with { it.split(\"/\")[1] }\n", + " // Convert \"topics\" `String` values into `List` by splitting:\n", + " .convert { topics }.with { it.removePrefix(\"[\").removeSuffix(\"]\").split(\", \") }\n", + "dfUpdated" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopics
ideavim6120[ideavim, intellij, intellij-platform...
MPS1241[domain-specific-language, dsl]
intellij-community12926[code-editor, ide, intellij, intellij...
intellij-scala1066[intellij-idea, intellij-plugin, scala]
kotlin39402[compiler, gradle-plugin, intellij-pl...
intellij-plugins1737[]
Exposed5688[dao, kotlin, orm, sql]
kotlin-web-site1074[kotlin]
idea-gitignore1181[gitignore, ignore-files, intellij, i...
swot1072[]
phpstorm-stubs1110[]
gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
ring-ui2836[components, jetbrains-ui, react]
kotlinconf-app2628[]
JetBrainsMono6059[coding-font, font, ligatures, monosp...
intellij-platform-plugin-template1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"]},{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"]},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"]},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"]},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"]},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"]},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"]},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"]},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"]},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"]},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"]},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"]},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"]},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"]},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"]},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"]},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"]},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"]},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"]},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"]}]}" + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 8 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Check the new \"topics\" type out:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.579845Z", + "start_time": "2025-05-01T13:42:33.559883Z" + } + }, + "cell_type": "code", + "source": "dfUpdated.topics.type()", + "outputs": [ + { + "data": { + "text/plain": [ + "kotlin.collections.List" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 9 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Adding New Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "The `.add { }` function allows creating a `DataFrame` with a new column, where the value for each row is computed based on the existing values in that row. These values can be accessed within the row expressions.\n", + "\n", + "Add a new `Boolean` column \"isIntellij\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.704101Z", + "start_time": "2025-05-01T13:42:33.591205Z" + } + }, + "cell_type": "code", + "source": [ + "// Add a `Boolean` column indicating whether the `name` contains the \"intellij\" substring\n", + "// or the topics include \"intellij\".\n", + "val dfWithIsIntellij = dfUpdated.add(\"isIntellij\") {\n", + " name.contains(\"intellij\") || \"intellij\" in topics\n", + "}\n", + "dfWithIsIntellij" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopicsisIntellij
ideavim6120[ideavim, intellij, intellij-platform...true
MPS1241[domain-specific-language, dsl]false
intellij-community12926[code-editor, ide, intellij, intellij...true
intellij-scala1066[intellij-idea, intellij-plugin, scala]true
kotlin39402[compiler, gradle-plugin, intellij-pl...false
intellij-plugins1737[]true
Exposed5688[dao, kotlin, orm, sql]false
kotlin-web-site1074[kotlin]false
idea-gitignore1181[gitignore, ignore-files, intellij, i...true
swot1072[]false
phpstorm-stubs1110[]false
gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...true
svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...false
resharper-unity1017[hacktoberfest, jetbrains, plugin, re...false
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]false
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...false
ring-ui2836[components, jetbrains-ui, react]false
kotlinconf-app2628[]false
JetBrainsMono6059[coding-font, font, ligatures, monosp...false
intellij-platform-plugin-template1133[intellij, intellij-idea, intellij-id...true
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"nrow\":24,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"],\"isIntellij\":false},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"],\"isIntellij\":true},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"],\"isIntellij\":true},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"],\"isIntellij\":false},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"],\"isIntellij\":true},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"],\"isIntellij\":true},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"],\"isIntellij\":false},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"],\"isIntellij\":false},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"],\"isIntellij\":true}]}" + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 10 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Grouping And Aggregating" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `DataFrame` can be grouped by column keys, meaning its rows are split into groups based on the values in the key columns.\n", + "The `.groupBy { }` operation selects columns and groups the `DataFrame` by their values, using them as grouping keys.\n", + "\n", + "The result is a `GroupBy` — a `DataFrame`-like structure that associates each key with the corresponding subset of the original `DataFrame`.\n", + "\n", + "Group `dfWithIsIntellij` by \"isIntellij\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.786349Z", + "start_time": "2025-05-01T13:42:33.748673Z" + } + }, + "cell_type": "code", + "source": [ + "val groupedByIsIntellij = dfWithIsIntellij.groupBy { isIntellij }\n", + "groupedByIsIntellij" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijgroup
true
DataFrame [7 x 4]
namestarsCounttopicsisIntellij
ideavim6120[ideavim, intellij, intellij-platform...true
intellij-community12926[code-editor, ide, intellij, intellij...true
intellij-scala1066[intellij-idea, intellij-plugin, scala]true
intellij-plugins1737[]true
idea-gitignore1181[gitignore, ignore-files, intellij, i...true

... showing only top 5 of 7 rows

false
DataFrame [17 x 4]
namestarsCounttopicsisIntellij
MPS1241[domain-specific-language, dsl]false
kotlin39402[compiler, gradle-plugin, intellij-pl...false
Exposed5688[dao, kotlin, orm, sql]false
kotlin-web-site1074[kotlin]false
swot1072[]false

... showing only top 5 of 17 rows

\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"group\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"FrameColumn\"}],\"nrow\":2,\"ncol\":2},\"kotlin_dataframe\":[{\"isIntellij\":true,\"group\":{\"data\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"],\"isIntellij\":true},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"],\"isIntellij\":true},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"],\"isIntellij\":true},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"],\"isIntellij\":true},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"],\"isIntellij\":true}],\"metadata\":{\"kind\":\"FrameColumn\",\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"ncol\":4,\"nrow\":7}}},{\"isIntellij\":false,\"group\":{\"data\":[{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"],\"isIntellij\":false},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"],\"isIntellij\":false},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"],\"isIntellij\":false},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"],\"isIntellij\":false},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"skija\",\"starsCount\":2242,\"topics\":[\"2d\",\"graphics\",\"java\",\"skia\"],\"isIntellij\":false},{\"name\":\"projector-docker\",\"starsCount\":1853,\"topics\":[\"awt\",\"docker\",\"swing\"],\"isIntellij\":false},{\"name\":\"projector-server\",\"starsCount\":1025,\"topics\":[\"awt\",\"swing\"],\"isIntellij\":false},{\"name\":\"compose-jb\",\"starsCount\":6805,\"topics\":[\"android\",\"awt\",\"compose\",\"declarative-ui\",\"desktop\",\"gui\",\"javascript\",\"kotlin\",\"multiplatform\",\"reactive\",\"swing\",\"ui\"],\"isIntellij\":false}],\"metadata\":{\"kind\":\"FrameColumn\",\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"ncol\":4,\"nrow\":17}}}]}" + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 11 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `GroupBy` can be aggregated — that is, you can compute one or several summary statistics for each group.\n", + "The result of the aggregation is a `DataFrame` containing the key columns along with new columns holding the computed statistics for a corresponding group.\n", + "\n", + "For example, `count()` computes size of group:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.868726Z", + "start_time": "2025-05-01T13:42:33.840038Z" + } + }, + "cell_type": "code", + "source": "groupedByIsIntellij.count()", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijcount
true7
false17
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"count\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":2,\"ncol\":2},\"kotlin_dataframe\":[{\"isIntellij\":true,\"count\":7},{\"isIntellij\":false,\"count\":17}]}" + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 12 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Compute several statistics with `.aggregate { }` that provides an expression for aggregating:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.937900Z", + "start_time": "2025-05-01T13:42:33.881232Z" + } + }, + "cell_type": "code", + "source": [ + "groupedByIsIntellij.aggregate {\n", + " // Compute sum and max of \"starsCount\" within each group into \"sumStars\" and \"maxStars\" columns\n", + " sumOf { starsCount } into \"sumStars\"\n", + " maxOf { starsCount } into \"maxStars\"\n", + "}" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijsumStarsmaxStars
true2522112926
false8539239402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"sumStars\",\"maxStars\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":2,\"ncol\":3},\"kotlin_dataframe\":[{\"isIntellij\":true,\"sumStars\":25221,\"maxStars\":12926},{\"isIntellij\":false,\"sumStars\":85392,\"maxStars\":39402}]}" + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 13 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Sorting Rows" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "`.sort {}`/`.sortByDesc` sortes rows by value in selected columns, returning a DataFrame with sorted rows. `take(n)` returns a new `DataFrame` with the first `n` rows.\n", + "\n", + "Combine them to get Top-10 repositories by number of stars:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:34.085822Z", + "start_time": "2025-05-01T13:42:34.039730Z" + } + }, + "cell_type": "code", + "source": [ + "val dfTop10 = dfWithIsIntellij\n", + " // Sort by \"starsCount\" value descending\n", + " .sortByDesc { starsCount }\n", + " .take(10)\n", + "dfTop10" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopicsisIntellij
kotlin39402[compiler, gradle-plugin, intellij-pl...false
intellij-community12926[code-editor, ide, intellij, intellij...true
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]false
compose-jb6805[android, awt, compose, declarative-u...false
ideavim6120[ideavim, intellij, intellij-platform...true
JetBrainsMono6059[coding-font, font, ligatures, monosp...false
Exposed5688[dao, kotlin, orm, sql]false
ring-ui2836[components, jetbrains-ui, react]false
kotlinconf-app2628[]false
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...false
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"nrow\":10,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"compose-jb\",\"starsCount\":6805,\"topics\":[\"android\",\"awt\",\"compose\",\"declarative-ui\",\"desktop\",\"gui\",\"javascript\",\"kotlin\",\"multiplatform\",\"reactive\",\"swing\",\"ui\"],\"isIntellij\":false},{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false}]}" + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 14 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Plotting With Kandy" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Kandy is a Kotlin plotting library designed to bring Kotlin DataFrame features into chart creation, providing a convenient and typesafe way to build data visualizations.\n", + "\n", + "Kandy can be loaded into notebook using `%use kandy`:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:37.589007Z", + "start_time": "2025-05-01T13:42:34.130284Z" + } + }, + "cell_type": "code", + "source": "%use kandy", + "outputs": [], + "execution_count": 15 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Build a simple bar chart with `.plot { }` extension for DataFrame, that allows to use extension properties inside Kandy plotting DSL (plot will be rendered as an output after cell execution):" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:37.812897Z", + "start_time": "2025-05-01T13:42:37.592435Z" + } + }, + "cell_type": "code", + "source": [ + "dfTop10.plot {\n", + " bars {\n", + " x(name)\n", + " y(starsCount)\n", + " }\n", + "\n", + " layout.title = \"Top 10 JetBrains repositories by stars count\"\n", + "}" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlin\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " intellij-community\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlin-native\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " compose-jb\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " ideavim\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " JetBrainsMono\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Exposed\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " ring-ui\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlinconf-app\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " create-react-kotlin-app\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 0\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 10,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 20,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 30,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 40,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Top 10 JetBrains repositories by stars count\n", + " \n", + " \n", + " \n", + " \n", + " starsCount\n", + " \n", + " \n", + " \n", + " \n", + " name\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " " + ], + "application/plot+json": { + "output_type": "lets_plot_spec", + "output": { + "ggtitle": { + "text": "Top 10 JetBrains repositories by stars count" + }, + "mapping": {}, + "data": { + "starsCount": [ + 39402.0, + 12926.0, + 7101.0, + 6805.0, + 6120.0, + 6059.0, + 5688.0, + 2836.0, + 2628.0, + 2424.0 + ], + "name": [ + "kotlin", + "intellij-community", + "kotlin-native", + "compose-jb", + "ideavim", + "JetBrainsMono", + "Exposed", + "ring-ui", + "kotlinconf-app", + "create-react-kotlin-app" + ] + }, + "kind": "plot", + "scales": [ + { + "aesthetic": "x", + "discrete": true + }, + { + "aesthetic": "y", + "limits": [ + null, + null + ] + } + ], + "layers": [ + { + "mapping": { + "x": "name", + "y": "starsCount" + }, + "stat": "identity", + "sampling": "none", + "inherit_aes": false, + "position": "dodge", + "geom": "bar" + } + ], + "data_meta": { + "series_annotations": [ + { + "type": "str", + "column": "name" + }, + { + "type": "int", + "column": "starsCount" + } + ] + } + }, + "apply_color_scheme": true, + "swing_enabled": true + } + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 16 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Write DataFrame" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `DataFrame` supports writing to all formats that it is capable of reading.\n", + "\n", + "Write into Excel:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:38.118495Z", + "start_time": "2025-05-01T13:42:37.851592Z" + } + }, + "cell_type": "code", + "source": "dfWithIsIntellij.writeExcel(\"jb_repos.xlsx\")", + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2025-05-01T13:42:37.894239Z Execution of code 'dfWithIsIntellij.wri...' ERROR Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...\n" + ] + } + ], + "execution_count": 17 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Kotlin", + "language": "kotlin", + "name": "kotlin" + }, + "language_info": { + "name": "kotlin", + "version": "1.9.23", + "mimetype": "text/x-kotlin", + "file_extension": ".kt", + "pygments_lexer": "kotlin", + "codemirror_mode": "text/x-kotlin", + "nbconvert_exporter": "" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_10.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_10.html new file mode 100644 index 0000000000..0af762b735 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_10.html @@ -0,0 +1,510 @@ + + + + + +
+ +

... showing only top 20 of 24 rows

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_11.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_11.html new file mode 100644 index 0000000000..d334b274e3 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_11.html @@ -0,0 +1,524 @@ + + + + + +
+ +

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_12.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_12.html new file mode 100644 index 0000000000..59590c8d49 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_12.html @@ -0,0 +1,508 @@ + + + + + +
+ +

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_13.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_13.html new file mode 100644 index 0000000000..1957b21293 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_13.html @@ -0,0 +1,509 @@ + + + + + +
+ +

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_14.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_14.html new file mode 100644 index 0000000000..37899f94f9 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_14.html @@ -0,0 +1,510 @@ + + + + + +
+ +

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_3.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_3.html new file mode 100644 index 0000000000..93777d769d --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_3.html @@ -0,0 +1,511 @@ + + + + + +
+ +

... showing only top 20 of 562 rows

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_4.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_4.html new file mode 100644 index 0000000000..010cd4deeb --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_4.html @@ -0,0 +1,520 @@ + + + + + +
+ +

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_5.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_5.html new file mode 100644 index 0000000000..46b8340010 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_5.html @@ -0,0 +1,509 @@ + + + + + +
+ +

... showing only top 20 of 562 rows

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_6.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_6.html new file mode 100644 index 0000000000..8a57c830b6 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_6.html @@ -0,0 +1,509 @@ + + + + + +
+ +

... showing only top 20 of 24 rows

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_7.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_7.html new file mode 100644 index 0000000000..4f8b6dfe76 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_7.html @@ -0,0 +1,509 @@ + + + + + +
+ +

... showing only top 20 of 24 rows

+ + + diff --git a/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_8.html b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_8.html new file mode 100644 index 0000000000..ed90584061 --- /dev/null +++ b/docs/StardustDocs/resources/guides/quickstart/notebook_test_quickstart_8.html @@ -0,0 +1,509 @@ + + + + + +
+ +

... showing only top 20 of 24 rows

+ + + diff --git a/docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar.ForHtml.html b/docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar.ForHtml.html similarity index 100% rename from docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar.ForHtml.html rename to docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar.ForHtml.html diff --git a/docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar.ForHtml.html b/docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar.ForHtml.html similarity index 100% rename from docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar.ForHtml.html rename to docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar.ForHtml.html diff --git a/docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar.html b/docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar.html similarity index 100% rename from docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar.html rename to docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar.html diff --git a/docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar.html b/docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar.html similarity index 100% rename from docs/StardustDocs/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar.html rename to docs/StardustDocs/resources/snippets/kdocs/org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar.html diff --git a/docs/StardustDocs/snippets/manual/extensionPropertiesApi1.html b/docs/StardustDocs/resources/snippets/manual/extensionPropertiesApi1.html similarity index 100% rename from docs/StardustDocs/snippets/manual/extensionPropertiesApi1.html rename to docs/StardustDocs/resources/snippets/manual/extensionPropertiesApi1.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.byRow.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.byRow.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.byRow.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.byRow.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectors.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectors.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectors.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectors.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsMisc.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsMisc.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsMisc.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsMisc.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsModifySet.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsModifySet.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsModifySet.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsModifySet.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsUsages.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsUsages.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsUsages.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnSelectorsUsages.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnsSelectorByIndices.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnsSelectorByIndices.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnsSelectorByIndices.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.columnsSelectorByIndices.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinct.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinct.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinct.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinct.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctColumns.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctColumns.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctColumns.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.distinctColumns.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.drop.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.drop.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.drop.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.drop.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropLast.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropLast.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropLast.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropLast.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNA.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNA.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNA.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNA.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNaNs.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNaNs.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNaNs.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNaNs.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNulls.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNulls.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNulls.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropNulls.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhere.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhere.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhere.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhere.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhile.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhile.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhile.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.dropWhile.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filter.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filter.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filter.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filter.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filterBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filterBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filterBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.filterBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getColumnsByName.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getColumnsByName.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getColumnsByName.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getColumnsByName.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByCondition.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByCondition.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByCondition.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByCondition.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByIndex.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByIndex.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByIndex.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getRowByIndex.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByIndices.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByIndices.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByIndices.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByIndices.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByRanges.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByRanges.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByRanges.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.getSeveralRowsByRanges.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.select.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.select.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.select.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.select.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.take.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.take.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.take.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.take.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeLast.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeLast.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeLast.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeLast.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeWhile.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeWhile.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeWhile.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.takeWhile.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.xs.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.xs.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.xs.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Access.xs.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.columnsFor.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.columnsFor.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.columnsFor.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.columnsFor.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.countAggregation.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.countAggregation.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.countAggregation.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.countAggregation.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describe.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describe.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describe.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describe.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describeColumns.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describeColumns.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describeColumns.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.describeColumns.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregateWithoutInto.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregateWithoutInto.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregateWithoutInto.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregateWithoutInto.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregations.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregations.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregations.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByAggregations.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByDirectAggregations.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByDirectAggregations.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByDirectAggregations.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByDirectAggregations.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByExpr.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByExpr.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByExpr.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByExpr.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTop.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTop.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTop.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTop.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTopFalse.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTopFalse.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTopFalse.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByMoveToTopFalse.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByToFrame.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByToFrame.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByToFrame.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByToFrame.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByWithoutAggregation.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByWithoutAggregation.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByWithoutAggregation.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.groupByWithoutAggregation.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.head.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.head.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.head.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.head.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.meanAggregationsSkipNA.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.meanAggregationsSkipNA.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.meanAggregationsSkipNA.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.meanAggregationsSkipNA.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot2.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot2.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot2.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivot2.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate1.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate1.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate1.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAggregate1.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAsDataRowOrFrame.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAsDataRowOrFrame.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAsDataRowOrFrame.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotAsDataRowOrFrame.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCommonAggregations.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCommonAggregations.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCommonAggregations.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCommonAggregations.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCounts.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCounts.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCounts.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotCounts.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault1.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault1.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault1.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotDefault1.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupByOther.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupByOther.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupByOther.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotGroupByOther.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInAggregate.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInAggregate.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInAggregate.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInAggregate.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInward.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInward.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInward.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotInward.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotMatches.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotMatches.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotMatches.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.pivotMatches.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.schemaGroupBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.schemaGroupBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.schemaGroupBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.schemaGroupBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupByMany.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupByMany.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupByMany.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupByMany.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingle.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingle.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingle.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingle.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingleNamed.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingleNamed.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingleNamed.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticGroupBySingleNamed.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotMany.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotMany.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotMany.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotMany.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotManySeparate.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotManySeparate.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotManySeparate.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotManySeparate.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotSingle.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotSingle.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotSingle.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.statisticPivotSingle.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.valueCounts.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.valueCounts.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.valueCounts.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Analyze.valueCounts.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.columnAccessorMap.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.columnAccessorMap.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.columnAccessorMap.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.columnAccessorMap.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromIterable.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromIterable.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromIterable.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromIterable.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromMap.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromMap.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromMap.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.createDataFrameFromMap.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.duplicatedColumns.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.duplicatedColumns.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.duplicatedColumns.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.duplicatedColumns.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.toDataFrameColumn.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.toDataFrameColumn.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.toDataFrameColumn.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Create.toDataFrameColumn.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.conditions.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.conditions.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.conditions.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.conditions.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.expressions.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.expressions.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.expressions.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.DataRowApi.expressions.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.join.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.join.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.join.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.join.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinDefault.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinDefault.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinDefault.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinDefault.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinSpecial.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinSpecial.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinSpecial.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinSpecial.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinWithMatch.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinWithMatch.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinWithMatch.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Join.joinWithMatch.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerColumns.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerColumns.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerColumns.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerColumns.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerValues.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerValues.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerValues.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareInnerValues.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareLeft.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareLeft.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareLeft.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareLeft.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareRight.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareRight.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareRight.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.compareRight.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.crossProduct.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.crossProduct.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.crossProduct.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.crossProduct.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.excludeJoinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.excludeJoinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.excludeJoinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.excludeJoinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.filterJoinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.filterJoinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.filterJoinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.filterJoinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.fullJoinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.fullJoinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.fullJoinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.fullJoinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.joinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.joinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.joinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.joinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.leftJoinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.leftJoinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.leftJoinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.leftJoinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.rightJoinWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.rightJoinWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.rightJoinWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.JoinWith.rightJoinWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.add.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.add.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.add.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.add.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addDataFrames.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addDataFrames.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addDataFrames.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addDataFrames.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addExisting.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addExisting.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addExisting.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addExisting.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addMany.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addMany.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addMany.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addMany.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addRecurrent.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addRecurrent.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addRecurrent.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.addRecurrent.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.concatGroupBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.concatGroupBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.concatGroupBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.concatGroupBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convert.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convert.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convert.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convert.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsColumn.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsColumn.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsColumn.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsColumn.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsFrame.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsFrame.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsFrame.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertAsFrame.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertTo.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertTo.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertTo.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertTo.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToEnum.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToEnum.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToEnum.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToEnum.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToValueClass.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToValueClass.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToValueClass.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.convertToValueClass.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNA.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNA.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNA.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNA.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNaNs.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNaNs.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNaNs.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNaNs.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNulls.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNulls.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNulls.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.fillNulls.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flatten.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flatten.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flatten.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flatten.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flattenAll.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flattenAll.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flattenAll.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.flattenAll.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gather.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gather.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gather.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gather.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gatherNames.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gatherNames.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gatherNames.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.gatherNames.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.group.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.group.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.group.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.group.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.implode.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.implode.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.implode.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.implode.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insert.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insert.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insert.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insert.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insertColumn.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insertColumn.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insertColumn.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.insertColumn.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mapMany.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mapMany.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mapMany.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mapMany.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.merge.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.merge.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.merge.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.merge.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDefault.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDefault.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDefault.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDefault.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDifferentWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDifferentWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDifferentWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeDifferentWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeIntoList.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeIntoList.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeIntoList.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeIntoList.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeSameWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeSameWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeSameWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.mergeSameWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.move.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.move.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.move.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.move.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseAll.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseSome.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.parseWithOptions.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.remove.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.remove.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.remove.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.remove.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.rename.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.rename.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.rename.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.rename.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.renameExpression.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.renameExpression.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.renameExpression.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.renameExpression.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorder.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorder.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorder.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorder.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorderInGroup.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorderInGroup.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorderInGroup.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reorderInGroup.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.replace.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.replace.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.replace.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.replace.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reverse.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reverse.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reverse.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.reverse.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.shuffle.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.shuffle.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.shuffle.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.shuffle.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortBy.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortBy.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortBy.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortBy.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortByDesc.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortByDesc.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortByDesc.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortByDesc.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.sortWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split1.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split1.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split1.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.split1.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitInplace.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitInplace.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitInplace.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitInplace.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitIntoRows.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitIntoRows.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitIntoRows.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitIntoRows.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex1.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex1.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex1.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.splitRegex1.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.ungroup.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.ungroup.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.ungroup.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.ungroup.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.update.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.update.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.update.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.update.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateAsFrame.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateAsFrame.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateAsFrame.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateAsFrame.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updatePerRowCol.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updatePerRowCol.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updatePerRowCol.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updatePerRowCol.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWith.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWith.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWith.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWith.html diff --git a/docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWithConst.html b/docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWithConst.html similarity index 100% rename from docs/StardustDocs/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWithConst.html rename to docs/StardustDocs/resources/snippets/org.jetbrains.kotlinx.dataframe.samples.api.Modify.updateWithConst.html diff --git a/docs/StardustDocs/topics/ColumnSelectors.md b/docs/StardustDocs/topics/ColumnSelectors.md index 1423ed20e7..91e9f94dc3 100644 --- a/docs/StardustDocs/topics/ColumnSelectors.md +++ b/docs/StardustDocs/topics/ColumnSelectors.md @@ -18,7 +18,7 @@ df.gather { colsOf() }.into("key", "value") df.move { name.firstName and name.lastName }.after { city } ``` - + #### Full DSL Grammar {collapsible="true"} @@ -488,7 +488,7 @@ df.select { "name".colsAtAnyDepth { !it.isColumnGroup() } } ``` - + **Select columns by column index:** @@ -506,7 +506,7 @@ df.select { cols(0, 1, 3) } df.select { cols(1..4) } ``` - + **Other column selectors:** @@ -567,7 +567,7 @@ df.select { allExcept { colsOf() } } df.select { take(2) and col(3) } ``` - + **Modify the set of selected columns:** @@ -593,5 +593,5 @@ df.select { colsAtAnyDepth { !it.isColumnGroup() }.except { age } } df.select { (colsOf() and age).distinct() } ``` - + diff --git a/docs/StardustDocs/topics/Compiler-Plugin.md b/docs/StardustDocs/topics/Compiler-Plugin.md new file mode 100644 index 0000000000..dc82c79bab --- /dev/null +++ b/docs/StardustDocs/topics/Compiler-Plugin.md @@ -0,0 +1,3 @@ +# Kotlin DataFrame Compiler Plugin + +TODO diff --git a/docs/StardustDocs/topics/DataRow.md b/docs/StardustDocs/topics/DataRow.md index 9d92ba2ed7..8249bba53b 100644 --- a/docs/StardustDocs/topics/DataRow.md +++ b/docs/StardustDocs/topics/DataRow.md @@ -50,7 +50,7 @@ df.update { weight }.at(1, 3, 4).with { prev()?.weight } df.pivot { city }.with { name.lastName.uppercase() } ``` - + Row expression signature: ```DataRow.(DataRow) -> T```. Row values can be accessed with or without ```it``` keyword. Implicit and explicit argument represent the same `DataRow` object. @@ -71,7 +71,7 @@ df.drop { diffOrNull { age } == 0 } df.update { weight }.where { index() > 4 && city != "Paris" }.with { 50 } ``` - + Row condition signature: ```DataRow.(DataRow) -> Boolean``` diff --git a/docs/StardustDocs/topics/Home.topic b/docs/StardustDocs/topics/Home.topic new file mode 100644 index 0000000000..f484905b01 --- /dev/null +++ b/docs/StardustDocs/topics/Home.topic @@ -0,0 +1,36 @@ + + + + + + Kotlin DataFrame + + Kotlin DataFrame is an open-source library for Kotlin that provides a powerful + and typesafe DSL for structured in-memory data processing. + + + + Quickstart Guide + Guides And Examples + + + + First steps + + + + + + + Featured topics + + + + + + + + diff --git a/docs/StardustDocs/topics/_shadow_resources.md b/docs/StardustDocs/topics/_shadow_resources.md new file mode 100644 index 0000000000..60c7011b64 --- /dev/null +++ b/docs/StardustDocs/topics/_shadow_resources.md @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/StardustDocs/topics/_shadow_resources_snippets.md b/docs/StardustDocs/topics/_shadow_resources_snippets.md new file mode 100644 index 0000000000..6424c5b1c2 --- /dev/null +++ b/docs/StardustDocs/topics/_shadow_resources_snippets.md @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/StardustDocs/topics/add.md b/docs/StardustDocs/topics/add.md index 4ad6f331d9..d11a64823e 100644 --- a/docs/StardustDocs/topics/add.md +++ b/docs/StardustDocs/topics/add.md @@ -32,7 +32,7 @@ df.add("year of birth") { 2021 - "age"() } ``` - + See [row expressions](DataRow.md#row-expressions) @@ -49,7 +49,7 @@ df.add("fibonacci") { } ``` - + ## Create and add several columns to [`DataFrame`](DataFrame.md) @@ -101,7 +101,7 @@ df.add { ``` - + ### Create columns using intermediate result @@ -161,7 +161,7 @@ df.add(score) df + score ``` - + ## Add all columns from another [`DataFrame`](DataFrame.md) @@ -172,7 +172,7 @@ df + score df.add(df1, df2) ``` - + ## addId diff --git a/docs/StardustDocs/topics/addDf.md b/docs/StardustDocs/topics/addDf.md index 08da931768..744803be6d 100644 --- a/docs/StardustDocs/topics/addDf.md +++ b/docs/StardustDocs/topics/addDf.md @@ -10,7 +10,7 @@ Returns [`DataFrame`](DataFrame.md) with union of columns from several given [`D df.add(df1, df2) ``` - + See [all use cases of 'add' operation](add.md). diff --git a/docs/StardustDocs/topics/concat.md b/docs/StardustDocs/topics/concat.md index 0df3c7da80..1f93505f77 100644 --- a/docs/StardustDocs/topics/concat.md +++ b/docs/StardustDocs/topics/concat.md @@ -69,7 +69,7 @@ listOf(a, b).concat() df.groupBy { name }.concat() ``` - + [`FrameColumn`](DataColumn.md#framecolumn): diff --git a/docs/StardustDocs/topics/convert.md b/docs/StardustDocs/topics/convert.md index f82c8fda49..8dbb82b7c0 100644 --- a/docs/StardustDocs/topics/convert.md +++ b/docs/StardustDocs/topics/convert.md @@ -22,7 +22,7 @@ df.convert { age }.with { it.toDouble() } df.convert { colsAtAnyDepth().colsOf() }.with { it.toCharArray().toList() } ``` - + ColumnGroup can be converted using DataFrame API, for example: @@ -33,7 +33,7 @@ ColumnGroup can be converted using DataFrame API, for example: df.convert { name }.asFrame { it.add("fullName") { "$firstName $lastName" } } ``` - + Similar to `replace with` operation, @@ -49,7 +49,7 @@ df.convert { name }.asColumn { col -> } ``` - + @@ -78,7 +78,7 @@ df.convert { name.firstName and name.lastName }.asColumn { it.length() } df.convert { weight }.toFloat() ``` - + Automatic conversion from `String` to [enum classes](https://kotlinlang.org/docs/enum-classes.html#enum-classes.md) @@ -95,7 +95,7 @@ dataFrameOf("direction")("NORTH", "WEST") .convert("direction").to() ``` - + And finally, [Value classes](https://kotlinlang.org/docs/inline-classes.html) can be used with `convert` too. @@ -113,5 +113,5 @@ dataFrameOf("value")("1", "2") // note that values are strings; conversion is do .convert("value").to() ``` - + diff --git a/docs/StardustDocs/topics/count.md b/docs/StardustDocs/topics/count.md index cb2d765260..5305dc607c 100644 --- a/docs/StardustDocs/topics/count.md +++ b/docs/StardustDocs/topics/count.md @@ -33,5 +33,5 @@ df.pivot { city }.count { age > 18 } df.pivot { name.firstName }.groupBy { name.lastName }.count() ``` - + diff --git a/docs/StardustDocs/topics/createDataFrame.md b/docs/StardustDocs/topics/createDataFrame.md index 8942d5b36e..757f933965 100644 --- a/docs/StardustDocs/topics/createDataFrame.md +++ b/docs/StardustDocs/topics/createDataFrame.md @@ -136,7 +136,7 @@ val age by columnOf(15, 20, 22) listOf(name, age).toDataFrame() ``` - + `DataFrame` from `Map>`: @@ -150,7 +150,7 @@ val map = mapOf("name" to listOf("Alice", "Bob", "Charlie"), "age" to listOf(15, map.toDataFrame() ``` - + Creates a [`DataFrame`](DataFrame.md) from an [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/) of [basic types](https://kotlinlang.org/docs/basic-types.html) (except arrays): @@ -185,7 +185,7 @@ val files = listOf(File("data.csv"), File("data1.csv")) val df = files.toDataFrame(columnName = "data") ``` - + Creates a [`DataFrame`](DataFrame.md) from an [`Iterable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/) of objects: @@ -277,6 +277,6 @@ val col by columnOf(1, 2, 3) peek(dataFrameOf(col), dataFrameOf(col)) ``` - + diff --git a/docs/StardustDocs/topics/describe.md b/docs/StardustDocs/topics/describe.md index 38ddd3e917..c107342553 100644 --- a/docs/StardustDocs/topics/describe.md +++ b/docs/StardustDocs/topics/describe.md @@ -37,7 +37,7 @@ percentile values (`min`, `p25`, `median`, `p75`, `max`) will also return `null` df.describe() ``` - + To describe only specific columns, pass them as an argument: @@ -58,5 +58,5 @@ df.describe { "age" and "name".allCols() } ``` - + diff --git a/docs/StardustDocs/topics/distinct.md b/docs/StardustDocs/topics/distinct.md index 4ffa67f0cc..8c3471d804 100644 --- a/docs/StardustDocs/topics/distinct.md +++ b/docs/StardustDocs/topics/distinct.md @@ -11,7 +11,7 @@ The rows in the resulting [`DataFrame`](DataFrame.md) are in the same order as t df.distinct() ``` - + If columns are specified, resulting [`DataFrame`](DataFrame.md) will have only given columns with distinct values. @@ -36,7 +36,7 @@ df.select("age", "name").distinct() ``` - + ## distinctBy @@ -63,5 +63,5 @@ df.groupBy("age", "name").mapToRows { group.first() } ``` - + diff --git a/docs/StardustDocs/topics/drop.md b/docs/StardustDocs/topics/drop.md index 7483d07417..faceea98aa 100644 --- a/docs/StardustDocs/topics/drop.md +++ b/docs/StardustDocs/topics/drop.md @@ -20,7 +20,7 @@ df.drop { it["weight"] == null || it["city"] == null } ``` - + ## dropNulls @@ -37,7 +37,7 @@ df.dropNulls { city and weight } // remove rows with null value in 'city' OR 'we df.dropNulls(whereAllNull = true) { city and weight } // remove rows with null value in 'city' AND 'weight' columns ``` - + ## dropNaNs @@ -54,7 +54,7 @@ df.dropNaNs { age and weight } // remove rows where either 'age' or 'weight' is df.dropNaNs(whereAllNaN = true) { age and weight } // remove rows where both 'age' and 'weight' are NaN ``` - + ## dropNA @@ -71,5 +71,5 @@ df.dropNA { age and weight } // remove rows where either 'age' or 'weight' is nu df.dropNA(whereAllNA = true) { age and weight } // remove rows where both 'age' and 'weight' are null or NaN ``` - + diff --git a/docs/StardustDocs/topics/fill.md b/docs/StardustDocs/topics/fill.md index 8851a770ca..757b99b0f6 100644 --- a/docs/StardustDocs/topics/fill.md +++ b/docs/StardustDocs/topics/fill.md @@ -16,7 +16,7 @@ df.fillNulls { colsOf() }.with { -1 } df.update { colsOf() }.where { it == null }.with { -1 } ``` - + ## fillNaNs @@ -29,7 +29,7 @@ Replaces [`NaN` values](nanAndNa.md#nan) (`Double.NaN` and `Float.NaN`) with giv df.fillNaNs { colsOf() }.withZero() ``` - + ## fillNA @@ -42,5 +42,5 @@ Replaces [`NA` values](nanAndNa.md#na) (`null`, `Double.NaN`, and `Float.NaN`) w df.fillNA { weight }.with { -1 } ``` - + diff --git a/docs/StardustDocs/topics/filter.md b/docs/StardustDocs/topics/filter.md index 0091ffaef4..c284be80c4 100644 --- a/docs/StardustDocs/topics/filter.md +++ b/docs/StardustDocs/topics/filter.md @@ -20,7 +20,7 @@ df.filter { "age"() > 18 && "name"["firstName"]().startsWith("A") } ``` - + ## filterBy @@ -43,5 +43,5 @@ df.filterBy("isHappy") ``` - + diff --git a/docs/StardustDocs/topics/flatten.md b/docs/StardustDocs/topics/flatten.md index 4550066514..0ce6f9c9b4 100644 --- a/docs/StardustDocs/topics/flatten.md +++ b/docs/StardustDocs/topics/flatten.md @@ -30,7 +30,7 @@ df.flatten("name") ``` - + To remove all column groupings in [`DataFrame`](DataFrame.md), invoke `flatten` without parameters: @@ -41,5 +41,5 @@ To remove all column groupings in [`DataFrame`](DataFrame.md), invoke `flatten` df.flatten() ``` - + diff --git a/docs/StardustDocs/topics/gather.md b/docs/StardustDocs/topics/gather.md index 33f6baf7f6..4e2638b8f8 100644 --- a/docs/StardustDocs/topics/gather.md +++ b/docs/StardustDocs/topics/gather.md @@ -42,7 +42,7 @@ Storage options: pivoted.gather { "London".."Tokyo" }.into("city", "population") ``` - + diff --git a/docs/StardustDocs/topics/getRow.md b/docs/StardustDocs/topics/getRow.md index c2c0aff57d..438859ae7b 100644 --- a/docs/StardustDocs/topics/getRow.md +++ b/docs/StardustDocs/topics/getRow.md @@ -10,7 +10,7 @@ Get single [`DataRow`](DataRow.md) by [index](indexing.md): df[2] ``` - + Get single [`DataRow`](DataRow.md) by [row condition](DataRow.md#row-conditions): @@ -39,5 +39,5 @@ df.maxByOrNull("weight") ``` - + diff --git a/docs/StardustDocs/topics/gettingStartedKotlinNotebook.md b/docs/StardustDocs/topics/gettingStartedKotlinNotebook.md new file mode 100644 index 0000000000..aa5138e0ef --- /dev/null +++ b/docs/StardustDocs/topics/gettingStartedKotlinNotebook.md @@ -0,0 +1,4 @@ +# Get started with Kotlin DataFrame in Kotlin Notebook + +TODO + diff --git a/docs/StardustDocs/topics/group.md b/docs/StardustDocs/topics/group.md index eb59bdf9cd..cde4d5ba38 100644 --- a/docs/StardustDocs/topics/group.md +++ b/docs/StardustDocs/topics/group.md @@ -23,5 +23,5 @@ df.group { age and city }.into("info") df.group { all() }.into { it.type().toString() }.print() ``` - + diff --git a/docs/StardustDocs/topics/groupBy.md b/docs/StardustDocs/topics/groupBy.md index 7eadf6df33..2e8c8628ae 100644 --- a/docs/StardustDocs/topics/groupBy.md +++ b/docs/StardustDocs/topics/groupBy.md @@ -46,7 +46,7 @@ df.groupBy { "age"() / 10 named "ageDecade" } ``` - + Grouping columns can be created inplace: @@ -67,7 +67,7 @@ df.groupBy { expr { "name"["firstName"]().length + "name"["lastName"] - + With optional `moveToTop` parameter you can choose whether to make a selected *nested column* a top-level column: @@ -78,7 +78,7 @@ With optional `moveToTop` parameter you can choose whether to make a selected *n df.groupBy(moveToTop = true) { name.lastName } ``` - + or to keep it inside a `ColumnGroup`: @@ -89,7 +89,7 @@ or to keep it inside a `ColumnGroup`: df.groupBy(moveToTop = false) { name.lastName } ``` - + Returns `GroupBy` object. @@ -127,7 +127,7 @@ And any [`GroupBy DataFrame`](groupBy.md#transformation) can be reinterpreted as df.groupBy { city }.toDataFrame() ``` - + Use [`concat`](concat.md) to union all data groups of `GroupBy` into original [`DataFrame`](DataFrame.md) preserving new order of rows produced by grouping: @@ -138,7 +138,7 @@ Use [`concat`](concat.md) to union all data groups of `GroupBy` into original [` df.groupBy { name }.concat() ``` - + ## Aggregation @@ -183,7 +183,7 @@ df.groupBy("city").aggregate { ``` - + If only one aggregation function is used, column name can be omitted: @@ -204,7 +204,7 @@ df.groupBy("city").aggregate { maxBy("age")["name"] } ``` - + Most common aggregation functions can be computed directly at [`GroupBy DataFrame`](groupBy.md#transformation) : @@ -250,7 +250,7 @@ df.groupBy("city").meanOf("mean ratio") { ``` - + To get all column values for every group without aggregation use `values` function: @@ -277,5 +277,5 @@ df.groupBy("city").values { "weight" into "weights" } ``` - + diff --git a/docs/StardustDocs/topics/guides/Guides-And-Examples.md b/docs/StardustDocs/topics/guides/Guides-And-Examples.md new file mode 100644 index 0000000000..abda61c9e9 --- /dev/null +++ b/docs/StardustDocs/topics/guides/Guides-And-Examples.md @@ -0,0 +1,26 @@ +# Guides And Examples + + +Browse a collection of guides and examples covering key features and real-world use cases of Kotlin DataFrame — from basics to advanced data analysis. + + + +Explore Kotlin DataFrame with user guides and real-world examples, +showcasing practical use cases and data workflows. + + + +A curated list of Kotlin DataFrame guides and examples that walk you through common operations and data analysis patterns step by step. + + + +## Guides + +* [Quickstart Guide](quickstart.md) — get started with Kotlin DataFrame in a few simple steps: +load data, transform it, and visualize it. + + + +## Examples + +* [Titanic](titanic.md) — diff --git a/docs/StardustDocs/topics/guides/quickstart.md b/docs/StardustDocs/topics/guides/quickstart.md new file mode 100644 index 0000000000..0a03445380 --- /dev/null +++ b/docs/StardustDocs/topics/guides/quickstart.md @@ -0,0 +1,356 @@ +# Quickstart Guide + + +Get started with Kotlin DataFrame in a few simple steps: load data, transform it, and visualize it — all in an interactive Kotlin Notebook. + + + +Get started with Kotlin DataFrame right away — integrate it seamlessly and load process, analyze and visualize some data! + + + +Learn the basics of Kotlin DataFrame: reading data, applying transformations, and building plots — with full interactivity in Kotlin Notebook. + + +This guide shows how to quickly get started with **Kotlin DataFrame**: +you'll learn how to load data, perform basic transformations, and build a simple plot using Kandy. + +We recommend starting with [**Kotlin Notebook**](gettingStartedKotlinNotebook.md) for the best beginner experience — +everything works out of the box, +including interactivity and rich DataFrame and plots rendering. +You can instantly see the results of each operation: view the contents of your DataFrames after every transformation, +inspect individual rows and columns, and explore data step-by-step in a live and interactive way. + +You can view this guide as a +[notebook on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/notebooks/quickstart/quickstart.ipynb) +or download . + + + + +To start working with Kotlin DataFrame in a notebook, run the cell with the next code: + +```kotlin +%useLatestDescriptors +%use dataframe +``` + +This will load all necessary DataFrame dependencies (of the latest stable version) and all imports, as well as DataFrame +rendering. Learn more [here](gettingStartedKotlinNotebook.md). + +## Read DataFrame + +Kotlin DataFrame supports all popular data formats, including CSV, JSON, and Excel, as well as reading from various +databases. Read a CSV with the "Jetbrains Repositories" dataset into `df` variable: + + + +```kotlin +val df = DataFrame.readCsv( + "https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv", +) +``` + + + +## Display And Explore + +To display your dataframe as a cell output, place it in the last line of the cell: + + + +```kotlin +df +``` + + + + + +Kotlin Notebook has special interactive outputs for `DataFrame`. Learn more about them here. + +Use `.describe()` method to get dataset summaries — column types, number of nulls, and simple statistics. + + + +```kotlin +df.describe() +``` + + + + + +## Select Columns + +Kotlin DataFrame features a typesafe Columns Selection DSL, enabling flexible and safe selection of any combination of +columns. +Column selectors are widely used across operations — one of the simplest examples is `.select { }`, which returns a new +DataFrame with only the columns chosen in Columns Selection expression. + +After executing the cell where a `DataFrame` variable is declared, an extension with properties for its columns is +automatically generated. +These properties can then be used in the Columns Selection DSL expression for typesafe and convenient column access. + +Select some columns: + + + +```kotlin +// Select "full_name", "stargazers_count" and "topics" columns +val dfSelected = df.select { full_name and stargazers_count and topics } +dfSelected +``` + + + +> With a [Kotlin DataFrame Compiler Plugin](Compiler-Plugin.md) enabled, +> you can use auto-generated properties in your IntelliJ IDEA projects. + + + +## Raw Filtering + +Some operations use `RowExpression`, i.e., expression that applies for all `DataFrame` rows. For example `.filter { }` +that returns a new `DataFrame` with rows that satisfy a condition given by row expression. + +Inside a row expression, you can access the values of the current row by column names through auto-generated properties. +Similar to the Columns Selection DSL, but in this case the properties represent actual values, not column references. + +Filter rows by "stargazers_count" value: + + + +```kotlin +// Keep only rows where "stargazers_count" value is more than 1000 +val dfFiltered = dfSelected.filter { stargazers_count >= 1000 } +dfFiltered +``` + + + + + +## Columns Rename + +Columns can be renamed using the `.rename { }` operation, which also uses the Columns Selection DSL to select a column +to rename. +The `rename` operation does not perform the renaming immediately; instead, it creates an intermediate object that must +be finalized into a new `DataFrame` by calling the `.into()` function with the new column name. + +Rename "full_name" and "stargazers_count" columns: + + + +```kotlin +// Rename "full_name" column into "name" +val dfRenamed = dfFiltered.rename { full_name }.into("name") + // And "stargazers_count" into "starsCount" + .rename { stargazers_count }.into("starsCount") +dfRenamed +``` + + + + + +## Modify Columns + +Columns can be modified using the `update { }` and `convert { }` operations. +Both operations select columns to modify via the Columns Selection DSL and, similar to `rename`, create an intermediate +object that must be finalized to produce a new `DataFrame`. + +The `update` operation preserves the original column types, while `convert` allows changing the type. +In both cases, column names and their positions remain unchanged. + +Update "name" and convert "topics": + + + +```kotlin +val dfUpdated = dfRenamed + // Update "name" values with only its second part (after '/') + .update { name }.with { it.split("/")[1] } + // Convert "topics" `String` values into `List` by splitting: + .convert { topics }.with { it.removePrefix("[").removeSuffix("]").split(", ") } +dfUpdated +``` + + + + + +Check the new "topics" type out: + + + +```kotlin +dfUpdated.topics.type() +``` + + + +Output: + +``` +kotlin.collections.List +``` + +## Adding New Columns + +The `.add { }` function allows creating a `DataFrame` with a new column, where the value for each row is computed based +on the existing values in that row. These values can be accessed within the row expressions. + +Add a new `Boolean` column "isIntellij": + + + +```kotlin +// Add a `Boolean` column indicating whether the `name` contains the "intellij" substring +// or the topics include "intellij". +val dfWithIsIntellij = dfUpdated.add("isIntellij") { + name.contains("intellij") || "intellij" in topics +} +dfWithIsIntellij +``` + + + + + +## Grouping And Aggregating + +A `DataFrame` can be grouped by column keys, meaning its rows are split into groups based on the values in the key +columns. +The `.groupBy { }` operation selects columns and groups the `DataFrame` by their values, using them as grouping keys. + +The result is a `GroupBy` — a `DataFrame`-like structure that associates each key with the corresponding subset of the +original `DataFrame`. + +Group `dfWithIsIntellij` by "isIntellij": + + + +```kotlin +val groupedByIsIntellij = dfWithIsIntellij.groupBy { isIntellij } +groupedByIsIntellij +``` + + + + + +A `GroupBy` can be aggregated — that is, you can compute one or several summary statistics for each group. +The result of the aggregation is a `DataFrame` containing the key columns along with new columns holding the computed +statistics for a corresponding group. + +For example, `count()` computes size of group: + + + +```kotlin +groupedByIsIntellij.count() +``` + + + + + +Compute several statistics with `.aggregate { }` that provides an expression for aggregating: + + + +```kotlin +groupedByIsIntellij.aggregate { + // Compute sum and max of "starsCount" within each group into "sumStars" and "maxStars" columns + sumOf { starsCount } into "sumStars" + maxOf { starsCount } into "maxStars" +} +``` + + + + + +## Sorting Rows + +`.sort {}`/`.sortByDesc` sortes rows by value in selected columns, returning a DataFrame with sorted rows. `take(n)` +returns a new `DataFrame` with the first `n` rows. + +Combine them to get Top-10 repositories by number of stars: + + + +```kotlin +val dfTop10 = dfWithIsIntellij + // Sort by "starsCount" value descending + .sortByDesc { starsCount }.take(10) +dfTop10 +``` + + + + + +## Plotting With Kandy + +Kandy is a Kotlin plotting library designed to bring Kotlin DataFrame features into chart creation, providing a +convenient and typesafe way to build data visualizations. + +Kandy can be loaded into notebook using `%use kandy`: + +```kotlin +%use kandy +``` + +Build a simple bar chart with `.plot { }` extension for DataFrame, that allows to use extension properties inside Kandy +plotting DSL (plot will be rendered as an output after cell execution): + + + +```kotlin +dfTop10.plot { + bars { + x(name) + y(starsCount) + } + + layout.title = "Top 10 JetBrains repositories by stars count" +} +``` + + + +![notebook_test_quickstart_16](notebook_test_quickstart_16.svg) + +## Write DataFrame + +A `DataFrame` supports writing to all formats that it is capable of reading. + +Write into Excel: + + + +```kotlin +dfWithIsIntellij.writeExcel("jb_repos.xlsx") +``` + + + +## What's Next? + +In this quickstart, we covered the basics — reading data, transforming it, and building a simple visualization. +Ready to go deeper? Check out what’s next: + +- 📘 **[Explore in-depth guides and various examples](Guides-And-Examples.md)** with different datasets, + API usage examples, and practical scenarios that help you understand the main features of Kotlin DataFrame. + +- 🛠️ **[Browse the operations overview](operations.md)** to learn what Kotlin DataFrame can do. + +- 🧠 **Understand the design** and core concepts in the [library overview](overview.md). + +- 💡 **[Use Kotlin DataFrame Compiler Plugin](Compiler-Plugin.md)** + for auto-generated column access in your IntelliJ IDEA projects. + +- 📊 **Master Kandy** for stunning and expressive DataFrame visualizations learning + [Kandy Documentation](https://kotlin.github.io/kandy). diff --git a/docs/StardustDocs/topics/head.md b/docs/StardustDocs/topics/head.md index 133a36d2c8..80189c6e88 100644 --- a/docs/StardustDocs/topics/head.md +++ b/docs/StardustDocs/topics/head.md @@ -10,7 +10,7 @@ Returns [`DataFrame`](DataFrame.md) containing first `n` (default 5) rows. df.head(3) ``` - + Similar to [`take`](sliceRows.md#take). diff --git a/docs/StardustDocs/topics/implode.md b/docs/StardustDocs/topics/implode.md index 9d077dd183..a45b30ee49 100644 --- a/docs/StardustDocs/topics/implode.md +++ b/docs/StardustDocs/topics/implode.md @@ -25,5 +25,5 @@ Imploded [`ColumnGroup`](DataColumn.md#columngroup) will convert into [`FrameCol df.implode { name and age and weight and isHappy } ``` - + diff --git a/docs/StardustDocs/topics/insert.md b/docs/StardustDocs/topics/insert.md index ba387d0a0d..881e60bc66 100644 --- a/docs/StardustDocs/topics/insert.md +++ b/docs/StardustDocs/topics/insert.md @@ -32,7 +32,7 @@ df.insert("year of birth") { 2021 - "age"() }.after("age") ``` - + Insert previously created column: @@ -44,5 +44,5 @@ val score by columnOf(4, 5, 3, 5, 4, 5, 3) df.insert(score).at(2) ``` - + diff --git a/docs/StardustDocs/topics/join.md b/docs/StardustDocs/topics/join.md index 6167346b51..acd0263412 100644 --- a/docs/StardustDocs/topics/join.md +++ b/docs/StardustDocs/topics/join.md @@ -35,7 +35,7 @@ df.join(other) { "name" match "fullName" } ``` - + If mapped columns have the same name, just select join columns from the left [`DataFrame`](DataFrame.md): @@ -56,7 +56,7 @@ df.join(other, "name", "city") ``` - + If `joinColumns` is not specified, columns with the same name from both [`DataFrame`](DataFrame.md) objects will be used as join columns: @@ -67,7 +67,7 @@ If `joinColumns` is not specified, columns with the same name from both [`DataFr df.join(other) ``` - + ### Join types @@ -106,5 +106,5 @@ df.excludeJoin(other, "name", "city") ``` - + diff --git a/docs/StardustDocs/topics/joinWith.md b/docs/StardustDocs/topics/joinWith.md index 7b2825bb07..8c03b99583 100644 --- a/docs/StardustDocs/topics/joinWith.md +++ b/docs/StardustDocs/topics/joinWith.md @@ -60,7 +60,7 @@ campaigns.innerJoinWith(visits) { ``` - + #### Filter join @@ -87,7 +87,7 @@ campaigns.filterJoinWith(visits) { ``` - + #### Left join @@ -112,7 +112,7 @@ campaigns.leftJoinWith(visits) { ``` - + #### Right join @@ -137,7 +137,7 @@ campaigns.rightJoinWith(visits) { ``` - + #### Full join @@ -162,7 +162,7 @@ campaigns.fullJoinWith(visits) { ``` - + #### Exclude join @@ -189,7 +189,7 @@ campaigns.excludeJoinWith(visits) { ``` - + #### Cross join @@ -202,7 +202,7 @@ It can also be called cross product of two [`DataFrame`](DataFrame.md) objects. campaigns.joinWith(visits) { true } ``` - + ### Difference from join @@ -215,7 +215,7 @@ campaigns.joinWith(visits) { true } df1.innerJoin(df2, "index", "age") ``` - + Columns that were used in the condition: `index`, `age` - are present only once. Numerical suffix is used to disambiguate columns that are not used in the condition. @@ -227,7 +227,7 @@ Compare it to an equivalent `joinWith`: df1.innerJoinWith(df2) { it["index"] == right["index"] && it["age"] == right["age"] } ``` - + Here columns from both [`DataFrame`](DataFrame.md) objects are presented as is. @@ -242,7 +242,7 @@ df1.leftJoin(df2, "index", "age") df1.leftJoinWith(df2) { it["index"] == right["index"] && it["age"] == right["age"] } ``` - + @@ -252,6 +252,6 @@ df1.rightJoin(df2, "index", "age") df1.rightJoinWith(df2) { it["index"] == right["index"] && it["age"] == right["age"] } ``` - + diff --git a/docs/StardustDocs/topics/map.md b/docs/StardustDocs/topics/map.md index f023d278a4..69741676c6 100644 --- a/docs/StardustDocs/topics/map.md +++ b/docs/StardustDocs/topics/map.md @@ -89,5 +89,5 @@ df.mapToFrame { ``` - + diff --git a/docs/StardustDocs/topics/merge.md b/docs/StardustDocs/topics/merge.md index 6b3e422925..0bb25b9d59 100644 --- a/docs/StardustDocs/topics/merge.md +++ b/docs/StardustDocs/topics/merge.md @@ -22,7 +22,7 @@ merger: (DataRow).List -> Any df.merge { name.firstName and name.lastName }.by(" ").into("fullName") ``` - + `merger` accepts a `List` of collected values for every row typed by their common type: @@ -35,7 +35,7 @@ df.merge { name.firstName and name.lastName } .into("fullName") ``` - + When heterogeneous columns are merged, they may need to be cast to valid types in `merger`: @@ -48,7 +48,7 @@ df.merge { name.firstName and age and isHappy } .into("status") ``` - + By default, when no `delimeter` or `merger` is specified, values will be merged into the [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/): @@ -59,7 +59,7 @@ By default, when no `delimeter` or `merger` is specified, values will be merged df.merge { colsOf() }.into("data") ``` - + Merged column values can also be exported to [`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/): @@ -71,5 +71,5 @@ Merged column values can also be exported to [`List`](https://kotlinlang.org/api df.merge { name.firstName and name.lastName }.by(",").intoList() ``` - + diff --git a/docs/StardustDocs/topics/move.md b/docs/StardustDocs/topics/move.md index faa6e793ba..fc747c8d83 100644 --- a/docs/StardustDocs/topics/move.md +++ b/docs/StardustDocs/topics/move.md @@ -46,7 +46,7 @@ df.move { name.cols() }.toTop() df.move { colsAtAnyDepth().nameContains("e") }.toTop { it.parentName + it.name() } ``` - + Special cases of `move`: diff --git a/docs/StardustDocs/topics/parse.md b/docs/StardustDocs/topics/parse.md index c28cba485f..c7091f41c7 100644 --- a/docs/StardustDocs/topics/parse.md +++ b/docs/StardustDocs/topics/parse.md @@ -15,7 +15,7 @@ You can recognize this by the `locale` or `parserOptions` arguments in these fun df.parse() ``` - + To parse only particular columns use a [column selector](ColumnSelectors.md): @@ -26,7 +26,7 @@ To parse only particular columns use a [column selector](ColumnSelectors.md): df.parse { age and weight } ``` - + ### Parsing Order @@ -76,7 +76,7 @@ Available parser options: df.parse(options = ParserOptions(locale = Locale.CHINA, dateTimeFormatter = DateTimeFormatter.ISO_WEEK_DATE)) ``` - + ### Global Parser Options diff --git a/docs/StardustDocs/topics/pivot.md b/docs/StardustDocs/topics/pivot.md index e2a6c9ceb6..69114fd972 100644 --- a/docs/StardustDocs/topics/pivot.md +++ b/docs/StardustDocs/topics/pivot.md @@ -39,7 +39,7 @@ df.pivot("city") ``` - + To pivot several columns at once you can combine them using `and` or `then` infix function: @@ -64,7 +64,7 @@ df.pivot { "city" then "name"["firstName"] } ``` - + ## pivot + groupBy @@ -92,7 +92,7 @@ df.groupBy("name").pivot("city") ``` - + To group by all columns except pivoted use `groupByOther`: @@ -103,7 +103,7 @@ To group by all columns except pivoted use `groupByOther`: df.pivot { city }.groupByOther() ``` - + ## Aggregation @@ -126,7 +126,7 @@ df.pivot("city").aggregate { minBy("age")["name"] } ``` - + @@ -153,7 +153,7 @@ df.pivot("city").groupBy { "name"["firstName"] }.aggregate { ``` - + Shortcuts for common aggregation functions are also available: @@ -176,7 +176,7 @@ df.groupBy("name").pivot("city").median("age") ``` - + By default, when aggregation function produces several values for single data group, @@ -233,7 +233,7 @@ df.pivot("city").groupBy("name").default(0).min() ``` - + @@ -258,7 +258,7 @@ df.pivot("city").groupBy("name").aggregate { ``` - + ### Pivot inside aggregate @@ -294,7 +294,7 @@ df.groupBy { "name"["firstName"] }.aggregate { ``` - + ### pivotCounts @@ -318,7 +318,7 @@ df.groupBy { name }.aggregate { } ``` - + ### pivotMatches @@ -341,5 +341,5 @@ df.groupBy { name }.aggregate { } ``` - + diff --git a/docs/StardustDocs/topics/remove.md b/docs/StardustDocs/topics/remove.md index d915a2e51a..746c302d26 100644 --- a/docs/StardustDocs/topics/remove.md +++ b/docs/StardustDocs/topics/remove.md @@ -26,5 +26,5 @@ df.remove("name", "weight") ``` - + diff --git a/docs/StardustDocs/topics/rename.md b/docs/StardustDocs/topics/rename.md index 720f1a073a..b92a85aaa7 100644 --- a/docs/StardustDocs/topics/rename.md +++ b/docs/StardustDocs/topics/rename.md @@ -27,7 +27,7 @@ df.rename("name").into("fullName") ``` - + @@ -53,5 +53,5 @@ df.rename("age").into { ``` - + diff --git a/docs/StardustDocs/topics/reorder.md b/docs/StardustDocs/topics/reorder.md index 58ffe3b536..dce5644e07 100644 --- a/docs/StardustDocs/topics/reorder.md +++ b/docs/StardustDocs/topics/reorder.md @@ -29,7 +29,7 @@ df.reorder { age..isHappy }.byName() ``` - + When a subset of columns is selected they will be reordered among their original positions. Positions of other columns will not change. @@ -56,7 +56,7 @@ When exactly one [`ColumnGroup`](DataColumn.md#columngroup) is selected, reorder df.reorder { name }.byName(desc = true) // [name.lastName, name.firstName] ``` - + ## reorderColumnsBy diff --git a/docs/StardustDocs/topics/replace.md b/docs/StardustDocs/topics/replace.md index db33f12692..ed674e5f62 100644 --- a/docs/StardustDocs/topics/replace.md +++ b/docs/StardustDocs/topics/replace.md @@ -20,7 +20,7 @@ df.replace { colsOf() }.with { it.lowercase() } df.replace { age }.with { 2021 - age named "year" } ``` - + diff --git a/docs/StardustDocs/topics/reverse.md b/docs/StardustDocs/topics/reverse.md index 25697c108f..4238ab0434 100644 --- a/docs/StardustDocs/topics/reverse.md +++ b/docs/StardustDocs/topics/reverse.md @@ -10,5 +10,5 @@ Returns [`DataFrame`](DataFrame.md) with rows in reversed order. df.reverse() ``` - + diff --git a/docs/StardustDocs/topics/schema.md b/docs/StardustDocs/topics/schema.md index de9357b1d7..3bddbee6cd 100644 --- a/docs/StardustDocs/topics/schema.md +++ b/docs/StardustDocs/topics/schema.md @@ -34,7 +34,7 @@ isHappy: Boolean df.groupBy { city }.schema() ``` - + Output: diff --git a/docs/StardustDocs/topics/select.md b/docs/StardustDocs/topics/select.md index 3a5fba0ee5..26b05f54ce 100644 --- a/docs/StardustDocs/topics/select.md +++ b/docs/StardustDocs/topics/select.md @@ -22,7 +22,7 @@ df["age", "weight"] ``` - + See [DataFrame indexing](indexing.md) @@ -46,7 +46,7 @@ df.select("age", "weight") ``` - + See [column selectors](ColumnSelectors.md) diff --git a/docs/StardustDocs/topics/shuffle.md b/docs/StardustDocs/topics/shuffle.md index 9964eda4ec..0aa3dd7caf 100644 --- a/docs/StardustDocs/topics/shuffle.md +++ b/docs/StardustDocs/topics/shuffle.md @@ -10,5 +10,5 @@ Returns [`DataFrame`](DataFrame.md) with randomly reordered rows. df.shuffle() ``` - + diff --git a/docs/StardustDocs/topics/sliceRows.md b/docs/StardustDocs/topics/sliceRows.md index 9a5fef0582..30c51db986 100644 --- a/docs/StardustDocs/topics/sliceRows.md +++ b/docs/StardustDocs/topics/sliceRows.md @@ -10,7 +10,7 @@ Returns a [`DataFrame`](DataFrame.md) with rows at given indices: df[0, 3, 4] ``` - + Returns a [`DataFrame`](DataFrame.md) with rows inside given index ranges (including boundary indices): @@ -22,7 +22,7 @@ df[1..2] df[0..2, 4..5] ``` - + ## take @@ -35,7 +35,7 @@ Returns a [`DataFrame`](DataFrame.md) containing first `n` rows df.take(5) ``` - + ## takeLast @@ -48,7 +48,7 @@ Returns a [`DataFrame`](DataFrame.md) containing last `n` rows df.takeLast(5) ``` - + ## takeWhile @@ -61,7 +61,7 @@ Returns a [`DataFrame`](DataFrame.md) containing first rows that satisfy the giv df.takeWhile { isHappy } ``` - + ## drop @@ -74,7 +74,7 @@ Returns a [`DataFrame`](DataFrame.md) containing all rows except first `n` rows df.drop(5) ``` - + ## dropLast @@ -88,7 +88,7 @@ df.dropLast() // default 1 df.dropLast(5) ``` - + ## dropWhile @@ -101,5 +101,5 @@ Returns a [`DataFrame`](DataFrame.md) containing all rows except first rows that df.dropWhile { !isHappy } ``` - + diff --git a/docs/StardustDocs/topics/sortBy.md b/docs/StardustDocs/topics/sortBy.md index 288e5c9962..d0c3f796aa 100644 --- a/docs/StardustDocs/topics/sortBy.md +++ b/docs/StardustDocs/topics/sortBy.md @@ -28,7 +28,7 @@ df.sortBy { "weight".nullsLast() } ``` - + ## sortByDesc @@ -51,7 +51,7 @@ df.sortByDesc("age", "weight") ``` - + ## sortWith @@ -70,5 +70,5 @@ df.sortWith { row1, row2 -> } ``` - + diff --git a/docs/StardustDocs/topics/split.md b/docs/StardustDocs/topics/split.md index 1b8ca4b9cd..c2a88a5d49 100644 --- a/docs/StardustDocs/topics/split.md +++ b/docs/StardustDocs/topics/split.md @@ -42,7 +42,7 @@ df.split { "name"["firstName"]() }.by { it.asIterable() }.inplace() ``` - + ## Split horizontally @@ -77,7 +77,7 @@ df.split { "name"["lastName"]() }.by { it.asIterable() }.into("char1", " ``` - + @@ -100,7 +100,7 @@ df.split { "name"["lastName"]() } ``` - + `String` columns can also be split into group matches of [`Regex`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/) patterns: @@ -115,7 +115,7 @@ merged.split { name } .inward("firstName", "lastName") ``` - + [`FrameColumn`](DataColumn.md#framecolumn) can be split into columns: @@ -169,7 +169,7 @@ df.split { colGroup("name") }.by { it.values() }.intoRows() ``` - + Equals to `split { column }...inplace().explode { column }`. See [`explode`](explode.md) for details. diff --git a/docs/StardustDocs/topics/summaryStatistics.md b/docs/StardustDocs/topics/summaryStatistics.md index 002c35c535..fdb852423c 100644 --- a/docs/StardustDocs/topics/summaryStatistics.md +++ b/docs/StardustDocs/topics/summaryStatistics.md @@ -85,7 +85,7 @@ df.groupBy { city }.mean { age } // [`city`, `mean`] df.groupBy { city }.meanOf { age / 2 } // [`city`, `mean`] ``` - + You can also pass a custom name for the aggregated column: @@ -97,7 +97,7 @@ df.groupBy { city }.mean("mean age") { age } // [`city`, `mean age`] df.groupBy { city }.meanOf("custom") { age / 2 } // [`city`, `custom`] ``` - + If a statistic is applied in a mode that returns a separate value for every column in a data group, @@ -110,7 +110,7 @@ df.groupBy { city }.meanFor { age and weight } // [`city`, `age`, `weight`] df.groupBy { city }.mean() // [`city`, `age`, `weight`, ...] ``` - + ### pivot statistics @@ -138,7 +138,7 @@ df.groupBy("city").pivot { "name"["lastName"] }.meanOf { "age"() / 2.0 } ``` - + If a statistic is applied in such a way that it returns separate value per every column in a data group, @@ -151,7 +151,7 @@ df.groupBy { city }.pivot { name.lastName }.meanFor { age and weight } df.groupBy { city }.pivot { name.lastName }.mean() ``` - + To group columns in aggregation results not by pivoted values, but by aggregated columns, apply the `separate` flag: @@ -163,5 +163,5 @@ df.groupBy { city }.pivot { name.lastName }.meanFor(separate = true) { age and w df.groupBy { city }.pivot { name.lastName }.mean(separate = true) ``` - + diff --git a/docs/StardustDocs/topics/ungroup.md b/docs/StardustDocs/topics/ungroup.md index 10dc3089dc..c3704f9d60 100644 --- a/docs/StardustDocs/topics/ungroup.md +++ b/docs/StardustDocs/topics/ungroup.md @@ -20,5 +20,5 @@ See [column selectors](ColumnSelectors.md) df.ungroup { name } ``` - + diff --git a/docs/StardustDocs/topics/update.md b/docs/StardustDocs/topics/update.md index 2b1a412fd7..8368df0691 100644 --- a/docs/StardustDocs/topics/update.md +++ b/docs/StardustDocs/topics/update.md @@ -28,7 +28,7 @@ df.update { weight }.at(1..4).notNull { it / 2 } df.update { name.lastName and age }.at(1, 3, 4).withNull() ``` - + Update with constant value: @@ -39,7 +39,7 @@ Update with constant value: df.update { city }.where { name.firstName == "Alice" }.with { "Paris" } ``` - + Update with value depending on row: @@ -50,7 +50,7 @@ Update with value depending on row: df.update { city }.with { name.firstName + " from " + it } ``` - + Update with value depending on column: @@ -71,7 +71,7 @@ Update with value depending on row and column: df.update { colsOf() }.perRowCol { row, col -> col.name() + ": " + row.index() } ``` - + Update [ColumnGroup](DataColumn.md#columngroup) as [DataFrame](DataFrame.md): @@ -82,5 +82,5 @@ Update [ColumnGroup](DataColumn.md#columngroup) as [DataFrame](DataFrame.md): df.update { name }.asFrame { select { lastName } } ``` - + diff --git a/docs/StardustDocs/topics/valueCounts.md b/docs/StardustDocs/topics/valueCounts.md index aa1150210a..9c39a27dcf 100644 --- a/docs/StardustDocs/topics/valueCounts.md +++ b/docs/StardustDocs/topics/valueCounts.md @@ -24,5 +24,5 @@ df.city.valueCounts() df.valueCounts { name and city } ``` - + diff --git a/docs/StardustDocs/topics/xs.md b/docs/StardustDocs/topics/xs.md index c937a188c9..c804855fad 100644 --- a/docs/StardustDocs/topics/xs.md +++ b/docs/StardustDocs/topics/xs.md @@ -21,5 +21,5 @@ df.xs("Charlie", "Chaplin") df.xs("Moscow", true) { city and isHappy } ``` - + diff --git a/examples/notebooks/quickstart/quickstart.ipynb b/examples/notebooks/quickstart/quickstart.ipynb new file mode 100644 index 0000000000..c320a7f179 --- /dev/null +++ b/examples/notebooks/quickstart/quickstart.ipynb @@ -0,0 +1,8289 @@ +{ + "cells": [ + { + "metadata": {}, + "cell_type": "markdown", + "source": "# Quickstart" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "To start working with Kotlin DataFrame in a notebook, run the cell with the next code:" + }, + { + "cell_type": "code", + "metadata": { + "collapsed": true, + "ExecuteTime": { + "end_time": "2025-05-01T13:42:31.795685Z", + "start_time": "2025-05-01T13:42:24.748992Z" + } + }, + "source": [ + "%useLatestDescriptors\n", + "%use dataframe" + ], + "outputs": [], + "execution_count": 1 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "This will load all necessary DataFrame dependencies (of the latest stable version) and all imports, as well as DataFrame rendering. Learn more here" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Read DataFrame" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Kotlin DataFrame supports all popular data formats, including CSV, JSON and Excel, as well as reading from various databases. Read a CSV with the \"Jetbrains Repositories\" dataset into `df` variable:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.441575Z", + "start_time": "2025-05-01T13:42:31.823137Z" + } + }, + "cell_type": "code", + "source": [ + "val df = DataFrame.readCSV(\n", + " \"https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv\"\n", + ")" + ], + "outputs": [], + "execution_count": 2 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Display And Explore" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "To display your dataframe as a cell output, place it in the last line of the cell:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.538828Z", + "start_time": "2025-05-01T13:42:32.465804Z" + } + }, + "cell_type": "code", + "source": "df", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namehtml_urlstargazers_counttopicswatchers
JetBrains/JPShttps://github.com/JetBrains/JPS23[]23
JetBrains/YouTrackSharphttps://github.com/JetBrains/YouTrack...115[jetbrains, jetbrains-youtrack, youtr...115
JetBrains/colorSchemeToolhttps://github.com/JetBrains/colorSch...290[]290
JetBrains/ideavimhttps://github.com/JetBrains/ideavim6120[ideavim, intellij, intellij-platform...6120
JetBrains/youtrack-vcs-hookshttps://github.com/JetBrains/youtrack...5[]5
JetBrains/youtrack-rest-ruby-libraryhttps://github.com/JetBrains/youtrack...8[]8
JetBrains/emacs4ijhttps://github.com/JetBrains/emacs4ij47[]47
JetBrains/codereview4intellijhttps://github.com/JetBrains/coderevi...11[]11
JetBrains/teamcity-nuget-supporthttps://github.com/JetBrains/teamcity...41[nuget, nuget-feed, teamcity, teamcit...41
JetBrains/Grammar-Kithttps://github.com/JetBrains/Grammar-Kit534[]534
JetBrains/intellij-starteam-pluginhttps://github.com/JetBrains/intellij...6[]6
JetBrains/la-clojurehttps://github.com/JetBrains/la-clojure218[]218
JetBrains/MPShttps://github.com/JetBrains/MPS1241[domain-specific-language, dsl]1241
JetBrains/intellij-communityhttps://github.com/JetBrains/intellij...12926[code-editor, ide, intellij, intellij...12926
JetBrains/TeamCity.ServiceMessageshttps://github.com/JetBrains/TeamCity...39[c-sharp, teamcity, teamcity-service-...39
JetBrains/youtrack-rest-python-libraryhttps://github.com/JetBrains/youtrack...118[]118
JetBrains/intellij-scalahttps://github.com/JetBrains/intellij...1066[intellij-idea, intellij-plugin, scala]1066
JetBrains/teamcity-messageshttps://github.com/JetBrains/teamcity...125[]125
JetBrains/teamcity-cpphttps://github.com/JetBrains/teamcity...27[]27
JetBrains/kotlinhttps://github.com/JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...39402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"html_url\",\"stargazers_count\",\"topics\",\"watchers\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"java.net.URL\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":562,\"ncol\":5},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/JPS\",\"html_url\":\"https://github.com/JetBrains/JPS\",\"stargazers_count\":23,\"topics\":\"[]\",\"watchers\":23},{\"full_name\":\"JetBrains/YouTrackSharp\",\"html_url\":\"https://github.com/JetBrains/YouTrackSharp\",\"stargazers_count\":115,\"topics\":\"[jetbrains, jetbrains-youtrack, youtrack, youtrack-api]\",\"watchers\":115},{\"full_name\":\"JetBrains/colorSchemeTool\",\"html_url\":\"https://github.com/JetBrains/colorSchemeTool\",\"stargazers_count\":290,\"topics\":\"[]\",\"watchers\":290},{\"full_name\":\"JetBrains/ideavim\",\"html_url\":\"https://github.com/JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\",\"watchers\":6120},{\"full_name\":\"JetBrains/youtrack-vcs-hooks\",\"html_url\":\"https://github.com/JetBrains/youtrack-vcs-hooks\",\"stargazers_count\":5,\"topics\":\"[]\",\"watchers\":5},{\"full_name\":\"JetBrains/youtrack-rest-ruby-library\",\"html_url\":\"https://github.com/JetBrains/youtrack-rest-ruby-library\",\"stargazers_count\":8,\"topics\":\"[]\",\"watchers\":8},{\"full_name\":\"JetBrains/emacs4ij\",\"html_url\":\"https://github.com/JetBrains/emacs4ij\",\"stargazers_count\":47,\"topics\":\"[]\",\"watchers\":47},{\"full_name\":\"JetBrains/codereview4intellij\",\"html_url\":\"https://github.com/JetBrains/codereview4intellij\",\"stargazers_count\":11,\"topics\":\"[]\",\"watchers\":11},{\"full_name\":\"JetBrains/teamcity-nuget-support\",\"html_url\":\"https://github.com/JetBrains/teamcity-nuget-support\",\"stargazers_count\":41,\"topics\":\"[nuget, nuget-feed, teamcity, teamcity-plugin]\",\"watchers\":41},{\"full_name\":\"JetBrains/Grammar-Kit\",\"html_url\":\"https://github.com/JetBrains/Grammar-Kit\",\"stargazers_count\":534,\"topics\":\"[]\",\"watchers\":534},{\"full_name\":\"JetBrains/intellij-starteam-plugin\",\"html_url\":\"https://github.com/JetBrains/intellij-starteam-plugin\",\"stargazers_count\":6,\"topics\":\"[]\",\"watchers\":6},{\"full_name\":\"JetBrains/la-clojure\",\"html_url\":\"https://github.com/JetBrains/la-clojure\",\"stargazers_count\":218,\"topics\":\"[]\",\"watchers\":218},{\"full_name\":\"JetBrains/MPS\",\"html_url\":\"https://github.com/JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\",\"watchers\":1241},{\"full_name\":\"JetBrains/intellij-community\",\"html_url\":\"https://github.com/JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\",\"watchers\":12926},{\"full_name\":\"JetBrains/TeamCity.ServiceMessages\",\"html_url\":\"https://github.com/JetBrains/TeamCity.ServiceMessages\",\"stargazers_count\":39,\"topics\":\"[c-sharp, teamcity, teamcity-service-messages]\",\"watchers\":39},{\"full_name\":\"JetBrains/youtrack-rest-python-library\",\"html_url\":\"https://github.com/JetBrains/youtrack-rest-python-library\",\"stargazers_count\":118,\"topics\":\"[]\",\"watchers\":118},{\"full_name\":\"JetBrains/intellij-scala\",\"html_url\":\"https://github.com/JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\",\"watchers\":1066},{\"full_name\":\"JetBrains/teamcity-messages\",\"html_url\":\"https://github.com/JetBrains/teamcity-messages\",\"stargazers_count\":125,\"topics\":\"[]\",\"watchers\":125},{\"full_name\":\"JetBrains/teamcity-cpp\",\"html_url\":\"https://github.com/JetBrains/teamcity-cpp\",\"stargazers_count\":27,\"topics\":\"[]\",\"watchers\":27},{\"full_name\":\"JetBrains/kotlin\",\"html_url\":\"https://github.com/JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\",\"watchers\":39402}]}" + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 3 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Kotlin Notebook has special interactive outputs for `DataFrame`. Learn more about them here." + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Use `.describe()` method to get dataset summaries — column types, number of nulls and simple statistics." + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.765356Z", + "start_time": "2025-05-01T13:42:32.666531Z" + } + }, + "cell_type": "code", + "source": "df.describe()", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
nametypecountuniquenullstopfreqmeanstdminmedianmax
full_nameString5625620JetBrains/JPS1nullnullJetBrains/Android-Tuts-SamplesJetBrains/lightbeamJetBrains/ztools
html_urlURL5625620https://github.com/JetBrains/JPS1nullnullnullnullnull
stargazers_countInt56216501100244,7597861862,8019820839402
topicsString5621450[]401nullnull[2d, graphics, java, skia][][youtrack, youtrack-workflow]
watchersInt56216501100244,7597861862,8019820839402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"type\",\"count\",\"unique\",\"nulls\",\"top\",\"freq\",\"mean\",\"std\",\"min\",\"median\",\"max\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"java.io.Serializable\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Comparable<*>?\"}],\"nrow\":5,\"ncol\":12},\"kotlin_dataframe\":[{\"name\":\"full_name\",\"type\":\"String\",\"count\":562,\"unique\":562,\"nulls\":0,\"top\":\"JetBrains/JPS\",\"freq\":1,\"mean\":null,\"std\":null,\"min\":\"JetBrains/Android-Tuts-Samples\",\"median\":\"JetBrains/lightbeam\",\"max\":\"JetBrains/ztools\"},{\"name\":\"html_url\",\"type\":\"URL\",\"count\":562,\"unique\":562,\"nulls\":0,\"top\":\"https://github.com/JetBrains/JPS\",\"freq\":1,\"mean\":null,\"std\":null,\"min\":null,\"median\":null,\"max\":null},{\"name\":\"stargazers_count\",\"type\":\"Int\",\"count\":562,\"unique\":165,\"nulls\":0,\"top\":\"1\",\"freq\":100,\"mean\":244.75978647686833,\"std\":1862.8019819171673,\"min\":\"0\",\"median\":\"8\",\"max\":\"39402\"},{\"name\":\"topics\",\"type\":\"String\",\"count\":562,\"unique\":145,\"nulls\":0,\"top\":\"[]\",\"freq\":401,\"mean\":null,\"std\":null,\"min\":\"[2d, graphics, java, skia]\",\"median\":\"[]\",\"max\":\"[youtrack, youtrack-workflow]\"},{\"name\":\"watchers\",\"type\":\"Int\",\"count\":562,\"unique\":165,\"nulls\":0,\"top\":\"1\",\"freq\":100,\"mean\":244.75978647686833,\"std\":1862.8019819171673,\"min\":\"0\",\"median\":\"8\",\"max\":\"39402\"}]}" + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 4 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Select Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Kotlin DataFrame features a typesafe Columns Selection DSL, enabling flexible and safe selection of any combination of columns.\n", + "Column selectors are widely used across operations — one of the simplest examples is `.select { }`, which returns a new DataFrame with only the columns chosen in Columns Selection expression.\n", + "\n", + "After executing the cell where a `DataFrame` variable is declared, an extension with properties for its columns is automatically generated.\n", + "These properties can then be used in the Columns Selection DSL expression for typesafe and convenient column access.\n", + "\n", + "Select some columns:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:32.986689Z", + "start_time": "2025-05-01T13:42:32.810436Z" + } + }, + "cell_type": "code", + "source": [ + "// Select \"full_name\", \"stargazers_count\" and \"topics\" columns\n", + "val dfSelected = df.select { full_name and stargazers_count and topics }\n", + "dfSelected" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namestargazers_counttopics
JetBrains/JPS23[]
JetBrains/YouTrackSharp115[jetbrains, jetbrains-youtrack, youtr...
JetBrains/colorSchemeTool290[]
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/youtrack-vcs-hooks5[]
JetBrains/youtrack-rest-ruby-library8[]
JetBrains/emacs4ij47[]
JetBrains/codereview4intellij11[]
JetBrains/teamcity-nuget-support41[nuget, nuget-feed, teamcity, teamcit...
JetBrains/Grammar-Kit534[]
JetBrains/intellij-starteam-plugin6[]
JetBrains/la-clojure218[]
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/TeamCity.ServiceMessages39[c-sharp, teamcity, teamcity-service-...
JetBrains/youtrack-rest-python-library118[]
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/teamcity-messages125[]
JetBrains/teamcity-cpp27[]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"stargazers_count\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":562,\"ncol\":3},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/JPS\",\"stargazers_count\":23,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/YouTrackSharp\",\"stargazers_count\":115,\"topics\":\"[jetbrains, jetbrains-youtrack, youtrack, youtrack-api]\"},{\"full_name\":\"JetBrains/colorSchemeTool\",\"stargazers_count\":290,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"full_name\":\"JetBrains/youtrack-vcs-hooks\",\"stargazers_count\":5,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/youtrack-rest-ruby-library\",\"stargazers_count\":8,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/emacs4ij\",\"stargazers_count\":47,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/codereview4intellij\",\"stargazers_count\":11,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/teamcity-nuget-support\",\"stargazers_count\":41,\"topics\":\"[nuget, nuget-feed, teamcity, teamcity-plugin]\"},{\"full_name\":\"JetBrains/Grammar-Kit\",\"stargazers_count\":534,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/intellij-starteam-plugin\",\"stargazers_count\":6,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/la-clojure\",\"stargazers_count\":218,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"full_name\":\"JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"full_name\":\"JetBrains/TeamCity.ServiceMessages\",\"stargazers_count\":39,\"topics\":\"[c-sharp, teamcity, teamcity-service-messages]\"},{\"full_name\":\"JetBrains/youtrack-rest-python-library\",\"stargazers_count\":118,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"full_name\":\"JetBrains/teamcity-messages\",\"stargazers_count\":125,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/teamcity-cpp\",\"stargazers_count\":27,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"}]}" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 5 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Raw Filtering" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Some operations use `RowExpression`, i.e., expression that applies for all `DataFrame` rows. For example `.filter { }` that returns a new `DataFrame` with rows that satisfy a condition given by row expression.\n", + "\n", + "Inside a row expression, you can access the values of the current row by column names through auto-generated properties.\n", + "Similar to the Columns Selection DSL, but in this case the properties represent actual values, not column references.\n", + "\n", + "Filter rows by \"stargazers_count\" value:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.082510Z", + "start_time": "2025-05-01T13:42:33.031897Z" + } + }, + "cell_type": "code", + "source": [ + "// Keep only rows where \"stargazers_count\" value is more than 1000\n", + "val dfFiltered = dfSelected.filter { stargazers_count >= 1000 }\n", + "dfFiltered" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
full_namestargazers_counttopics
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
JetBrains/intellij-plugins1737[]
JetBrains/Exposed5688[dao, kotlin, orm, sql]
JetBrains/kotlin-web-site1074[kotlin]
JetBrains/idea-gitignore1181[gitignore, ignore-files, intellij, i...
JetBrains/swot1072[]
JetBrains/phpstorm-stubs1110[]
JetBrains/gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
JetBrains/svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
JetBrains/resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
JetBrains/kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
JetBrains/create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
JetBrains/ring-ui2836[components, jetbrains-ui, react]
JetBrains/kotlinconf-app2628[]
JetBrains/JetBrainsMono6059[coding-font, font, ligatures, monosp...
JetBrains/intellij-platform-plugin-te...1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"full_name\",\"stargazers_count\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"full_name\":\"JetBrains/ideavim\",\"stargazers_count\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"full_name\":\"JetBrains/MPS\",\"stargazers_count\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"full_name\":\"JetBrains/intellij-community\",\"stargazers_count\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"full_name\":\"JetBrains/intellij-scala\",\"stargazers_count\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"full_name\":\"JetBrains/kotlin\",\"stargazers_count\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"},{\"full_name\":\"JetBrains/intellij-plugins\",\"stargazers_count\":1737,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/Exposed\",\"stargazers_count\":5688,\"topics\":\"[dao, kotlin, orm, sql]\"},{\"full_name\":\"JetBrains/kotlin-web-site\",\"stargazers_count\":1074,\"topics\":\"[kotlin]\"},{\"full_name\":\"JetBrains/idea-gitignore\",\"stargazers_count\":1181,\"topics\":\"[gitignore, ignore-files, intellij, intellij-plugin, java]\"},{\"full_name\":\"JetBrains/swot\",\"stargazers_count\":1072,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/phpstorm-stubs\",\"stargazers_count\":1110,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/gradle-intellij-plugin\",\"stargazers_count\":1058,\"topics\":\"[gradle, gradle-intellij-plugin, gradle-kotlin-dsl, groovy, intellij, intellij-ides, intellij-platform, intellij-plugin, intellij-sdk, jetbrains-plugin, kotlin, plugin-verifier, publishing-dsl, setup-dsl, teamcity, travis-configuration]\"},{\"full_name\":\"JetBrains/svg-sprite-loader\",\"stargazers_count\":1815,\"topics\":\"[sprite, svg, svg-sprite, svg-stack, webpack, webpack-loader, webpack-plugin, webpack2, webpack3]\"},{\"full_name\":\"JetBrains/resharper-unity\",\"stargazers_count\":1017,\"topics\":\"[hacktoberfest, jetbrains, plugin, resharper, resharper-plugin, rider, unity, unity-editor]\"},{\"full_name\":\"JetBrains/kotlin-native\",\"stargazers_count\":7101,\"topics\":\"[c, compiler, kotlin, llvm, objective-c]\"},{\"full_name\":\"JetBrains/create-react-kotlin-app\",\"stargazers_count\":2424,\"topics\":\"[create-react-app, jetbrains-ui, kotlin, react, webpack]\"},{\"full_name\":\"JetBrains/ring-ui\",\"stargazers_count\":2836,\"topics\":\"[components, jetbrains-ui, react]\"},{\"full_name\":\"JetBrains/kotlinconf-app\",\"stargazers_count\":2628,\"topics\":\"[]\"},{\"full_name\":\"JetBrains/JetBrainsMono\",\"stargazers_count\":6059,\"topics\":\"[coding-font, font, ligatures, monospaced-font, programming-font, programming-ligatures]\"},{\"full_name\":\"JetBrains/intellij-platform-plugin-template\",\"stargazers_count\":1133,\"topics\":\"[intellij, intellij-idea, intellij-idea-plugin, intellij-platform, intellij-plugin, intellij-plugins, jetbrains-plugin]\"}]}" + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 6 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Columns Rename" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Columns can be renamed using the `.rename { }` operation, which also uses the Columns Selection DSL to select a column to rename.\n", + "The `rename` operation does not perform the renaming immediately; instead, it creates an intermediate object that must be finalized into a new `DataFrame` by calling the `.into()` function with the new column name.\n", + "\n", + "Rename \"full_name\" and \"stargazers_count\" columns:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.268662Z", + "start_time": "2025-05-01T13:42:33.136288Z" + } + }, + "cell_type": "code", + "source": [ + "// Rename \"full_name\" column into \"name\"\n", + "val dfRenamed = dfFiltered\n", + " .rename { full_name }.into(\"name\")\n", + " // And \"stargazers_count\" into \"starsCount\"\n", + " .rename { stargazers_count }.into(\"starsCount\")\n", + "dfRenamed" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopics
JetBrains/ideavim6120[ideavim, intellij, intellij-platform...
JetBrains/MPS1241[domain-specific-language, dsl]
JetBrains/intellij-community12926[code-editor, ide, intellij, intellij...
JetBrains/intellij-scala1066[intellij-idea, intellij-plugin, scala]
JetBrains/kotlin39402[compiler, gradle-plugin, intellij-pl...
JetBrains/intellij-plugins1737[]
JetBrains/Exposed5688[dao, kotlin, orm, sql]
JetBrains/kotlin-web-site1074[kotlin]
JetBrains/idea-gitignore1181[gitignore, ignore-files, intellij, i...
JetBrains/swot1072[]
JetBrains/phpstorm-stubs1110[]
JetBrains/gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
JetBrains/svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
JetBrains/resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
JetBrains/kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
JetBrains/create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
JetBrains/ring-ui2836[components, jetbrains-ui, react]
JetBrains/kotlinconf-app2628[]
JetBrains/JetBrainsMono6059[coding-font, font, ligatures, monosp...
JetBrains/intellij-platform-plugin-te...1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"JetBrains/ideavim\",\"starsCount\":6120,\"topics\":\"[ideavim, intellij, intellij-platform, jb-official, kotlin, vim, vim-emulator]\"},{\"name\":\"JetBrains/MPS\",\"starsCount\":1241,\"topics\":\"[domain-specific-language, dsl]\"},{\"name\":\"JetBrains/intellij-community\",\"starsCount\":12926,\"topics\":\"[code-editor, ide, intellij, intellij-community, intellij-platform]\"},{\"name\":\"JetBrains/intellij-scala\",\"starsCount\":1066,\"topics\":\"[intellij-idea, intellij-plugin, scala]\"},{\"name\":\"JetBrains/kotlin\",\"starsCount\":39402,\"topics\":\"[compiler, gradle-plugin, intellij-plugin, kotlin, kotlin-library, maven-plugin, programming-language]\"},{\"name\":\"JetBrains/intellij-plugins\",\"starsCount\":1737,\"topics\":\"[]\"},{\"name\":\"JetBrains/Exposed\",\"starsCount\":5688,\"topics\":\"[dao, kotlin, orm, sql]\"},{\"name\":\"JetBrains/kotlin-web-site\",\"starsCount\":1074,\"topics\":\"[kotlin]\"},{\"name\":\"JetBrains/idea-gitignore\",\"starsCount\":1181,\"topics\":\"[gitignore, ignore-files, intellij, intellij-plugin, java]\"},{\"name\":\"JetBrains/swot\",\"starsCount\":1072,\"topics\":\"[]\"},{\"name\":\"JetBrains/phpstorm-stubs\",\"starsCount\":1110,\"topics\":\"[]\"},{\"name\":\"JetBrains/gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":\"[gradle, gradle-intellij-plugin, gradle-kotlin-dsl, groovy, intellij, intellij-ides, intellij-platform, intellij-plugin, intellij-sdk, jetbrains-plugin, kotlin, plugin-verifier, publishing-dsl, setup-dsl, teamcity, travis-configuration]\"},{\"name\":\"JetBrains/svg-sprite-loader\",\"starsCount\":1815,\"topics\":\"[sprite, svg, svg-sprite, svg-stack, webpack, webpack-loader, webpack-plugin, webpack2, webpack3]\"},{\"name\":\"JetBrains/resharper-unity\",\"starsCount\":1017,\"topics\":\"[hacktoberfest, jetbrains, plugin, resharper, resharper-plugin, rider, unity, unity-editor]\"},{\"name\":\"JetBrains/kotlin-native\",\"starsCount\":7101,\"topics\":\"[c, compiler, kotlin, llvm, objective-c]\"},{\"name\":\"JetBrains/create-react-kotlin-app\",\"starsCount\":2424,\"topics\":\"[create-react-app, jetbrains-ui, kotlin, react, webpack]\"},{\"name\":\"JetBrains/ring-ui\",\"starsCount\":2836,\"topics\":\"[components, jetbrains-ui, react]\"},{\"name\":\"JetBrains/kotlinconf-app\",\"starsCount\":2628,\"topics\":\"[]\"},{\"name\":\"JetBrains/JetBrainsMono\",\"starsCount\":6059,\"topics\":\"[coding-font, font, ligatures, monospaced-font, programming-font, programming-ligatures]\"},{\"name\":\"JetBrains/intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":\"[intellij, intellij-idea, intellij-idea-plugin, intellij-platform, intellij-plugin, intellij-plugins, jetbrains-plugin]\"}]}" + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 7 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Modify Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Columns can be modified using the `update { }` and `convert { }` operations.\n", + "Both operations select columns to modify via the Columns Selection DSL and, similar to `rename`, create an intermediate object that must be finalized to produce a new `DataFrame`.\n", + "\n", + "The `update` operation preserves the original column types, while `convert` allows changing the type.\n", + "In both cases, column names and their positions remain unchanged.\n", + "\n", + "Update \"name\" and convert \"topics\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.518212Z", + "start_time": "2025-05-01T13:42:33.311730Z" + } + }, + "cell_type": "code", + "source": [ + "val dfUpdated = dfRenamed\n", + " // Update \"name\" values with only its second part (after '/')\n", + " .update { name }.with { it.split(\"/\")[1] }\n", + " // Convert \"topics\" `String` values into `List` by splitting:\n", + " .convert { topics }.with { it.removePrefix(\"[\").removeSuffix(\"]\").split(\", \") }\n", + "dfUpdated" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopics
ideavim6120[ideavim, intellij, intellij-platform...
MPS1241[domain-specific-language, dsl]
intellij-community12926[code-editor, ide, intellij, intellij...
intellij-scala1066[intellij-idea, intellij-plugin, scala]
kotlin39402[compiler, gradle-plugin, intellij-pl...
intellij-plugins1737[]
Exposed5688[dao, kotlin, orm, sql]
kotlin-web-site1074[kotlin]
idea-gitignore1181[gitignore, ignore-files, intellij, i...
swot1072[]
phpstorm-stubs1110[]
gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...
svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...
resharper-unity1017[hacktoberfest, jetbrains, plugin, re...
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...
ring-ui2836[components, jetbrains-ui, react]
kotlinconf-app2628[]
JetBrainsMono6059[coding-font, font, ligatures, monosp...
intellij-platform-plugin-template1133[intellij, intellij-idea, intellij-id...
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"}],\"nrow\":24,\"ncol\":3},\"kotlin_dataframe\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"]},{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"]},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"]},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"]},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"]},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"]},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"]},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"]},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"]},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"]},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"]},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"]},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"]},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"]},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"]},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"]},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"]},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"]},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"]},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"]}]}" + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 8 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Check the new \"topics\" type out:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.579845Z", + "start_time": "2025-05-01T13:42:33.559883Z" + } + }, + "cell_type": "code", + "source": "dfUpdated.topics.type()", + "outputs": [ + { + "data": { + "text/plain": [ + "kotlin.collections.List" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 9 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Adding New Columns" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "The `.add { }` function allows creating a `DataFrame` with a new column, where the value for each row is computed based on the existing values in that row. These values can be accessed within the row expressions.\n", + "\n", + "Add a new `Boolean` column \"isIntellij\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.704101Z", + "start_time": "2025-05-01T13:42:33.591205Z" + } + }, + "cell_type": "code", + "source": [ + "// Add a `Boolean` column indicating whether the `name` contains the \"intellij\" substring\n", + "// or the topics include \"intellij\".\n", + "val dfWithIsIntellij = dfUpdated.add(\"isIntellij\") {\n", + " name.contains(\"intellij\") || \"intellij\" in topics\n", + "}\n", + "dfWithIsIntellij" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopicsisIntellij
ideavim6120[ideavim, intellij, intellij-platform...true
MPS1241[domain-specific-language, dsl]false
intellij-community12926[code-editor, ide, intellij, intellij...true
intellij-scala1066[intellij-idea, intellij-plugin, scala]true
kotlin39402[compiler, gradle-plugin, intellij-pl...false
intellij-plugins1737[]true
Exposed5688[dao, kotlin, orm, sql]false
kotlin-web-site1074[kotlin]false
idea-gitignore1181[gitignore, ignore-files, intellij, i...true
swot1072[]false
phpstorm-stubs1110[]false
gradle-intellij-plugin1058[gradle, gradle-intellij-plugin, grad...true
svg-sprite-loader1815[sprite, svg, svg-sprite, svg-stack, ...false
resharper-unity1017[hacktoberfest, jetbrains, plugin, re...false
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]false
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...false
ring-ui2836[components, jetbrains-ui, react]false
kotlinconf-app2628[]false
JetBrainsMono6059[coding-font, font, ligatures, monosp...false
intellij-platform-plugin-template1133[intellij, intellij-idea, intellij-id...true
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"nrow\":24,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"],\"isIntellij\":false},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"],\"isIntellij\":true},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"],\"isIntellij\":true},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"],\"isIntellij\":false},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"],\"isIntellij\":true},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"],\"isIntellij\":true},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"],\"isIntellij\":false},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"],\"isIntellij\":false},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"],\"isIntellij\":true}]}" + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 10 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Grouping And Aggregating" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `DataFrame` can be grouped by column keys, meaning its rows are split into groups based on the values in the key columns.\n", + "The `.groupBy { }` operation selects columns and groups the `DataFrame` by their values, using them as grouping keys.\n", + "\n", + "The result is a `GroupBy` — a `DataFrame`-like structure that associates each key with the corresponding subset of the original `DataFrame`.\n", + "\n", + "Group `dfWithIsIntellij` by \"isIntellij\":" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.786349Z", + "start_time": "2025-05-01T13:42:33.748673Z" + } + }, + "cell_type": "code", + "source": [ + "val groupedByIsIntellij = dfWithIsIntellij.groupBy { isIntellij }\n", + "groupedByIsIntellij" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijgroup
true
DataFrame [7 x 4]
namestarsCounttopicsisIntellij
ideavim6120[ideavim, intellij, intellij-platform...true
intellij-community12926[code-editor, ide, intellij, intellij...true
intellij-scala1066[intellij-idea, intellij-plugin, scala]true
intellij-plugins1737[]true
idea-gitignore1181[gitignore, ignore-files, intellij, i...true

... showing only top 5 of 7 rows

false
DataFrame [17 x 4]
namestarsCounttopicsisIntellij
MPS1241[domain-specific-language, dsl]false
kotlin39402[compiler, gradle-plugin, intellij-pl...false
Exposed5688[dao, kotlin, orm, sql]false
kotlin-web-site1074[kotlin]false
swot1072[]false

... showing only top 5 of 17 rows

\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"group\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"FrameColumn\"}],\"nrow\":2,\"ncol\":2},\"kotlin_dataframe\":[{\"isIntellij\":true,\"group\":{\"data\":[{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"intellij-scala\",\"starsCount\":1066,\"topics\":[\"intellij-idea\",\"intellij-plugin\",\"scala\"],\"isIntellij\":true},{\"name\":\"intellij-plugins\",\"starsCount\":1737,\"topics\":[\"\"],\"isIntellij\":true},{\"name\":\"idea-gitignore\",\"starsCount\":1181,\"topics\":[\"gitignore\",\"ignore-files\",\"intellij\",\"intellij-plugin\",\"java\"],\"isIntellij\":true},{\"name\":\"gradle-intellij-plugin\",\"starsCount\":1058,\"topics\":[\"gradle\",\"gradle-intellij-plugin\",\"gradle-kotlin-dsl\",\"groovy\",\"intellij\",\"intellij-ides\",\"intellij-platform\",\"intellij-plugin\",\"intellij-sdk\",\"jetbrains-plugin\",\"kotlin\",\"plugin-verifier\",\"publishing-dsl\",\"setup-dsl\",\"teamcity\",\"travis-configuration\"],\"isIntellij\":true},{\"name\":\"intellij-platform-plugin-template\",\"starsCount\":1133,\"topics\":[\"intellij\",\"intellij-idea\",\"intellij-idea-plugin\",\"intellij-platform\",\"intellij-plugin\",\"intellij-plugins\",\"jetbrains-plugin\"],\"isIntellij\":true}],\"metadata\":{\"kind\":\"FrameColumn\",\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"ncol\":4,\"nrow\":7}}},{\"isIntellij\":false,\"group\":{\"data\":[{\"name\":\"MPS\",\"starsCount\":1241,\"topics\":[\"domain-specific-language\",\"dsl\"],\"isIntellij\":false},{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"kotlin-web-site\",\"starsCount\":1074,\"topics\":[\"kotlin\"],\"isIntellij\":false},{\"name\":\"swot\",\"starsCount\":1072,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"phpstorm-stubs\",\"starsCount\":1110,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"svg-sprite-loader\",\"starsCount\":1815,\"topics\":[\"sprite\",\"svg\",\"svg-sprite\",\"svg-stack\",\"webpack\",\"webpack-loader\",\"webpack-plugin\",\"webpack2\",\"webpack3\"],\"isIntellij\":false},{\"name\":\"resharper-unity\",\"starsCount\":1017,\"topics\":[\"hacktoberfest\",\"jetbrains\",\"plugin\",\"resharper\",\"resharper-plugin\",\"rider\",\"unity\",\"unity-editor\"],\"isIntellij\":false},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"skija\",\"starsCount\":2242,\"topics\":[\"2d\",\"graphics\",\"java\",\"skia\"],\"isIntellij\":false},{\"name\":\"projector-docker\",\"starsCount\":1853,\"topics\":[\"awt\",\"docker\",\"swing\"],\"isIntellij\":false},{\"name\":\"projector-server\",\"starsCount\":1025,\"topics\":[\"awt\",\"swing\"],\"isIntellij\":false},{\"name\":\"compose-jb\",\"starsCount\":6805,\"topics\":[\"android\",\"awt\",\"compose\",\"declarative-ui\",\"desktop\",\"gui\",\"javascript\",\"kotlin\",\"multiplatform\",\"reactive\",\"swing\",\"ui\"],\"isIntellij\":false}],\"metadata\":{\"kind\":\"FrameColumn\",\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"ncol\":4,\"nrow\":17}}}]}" + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 11 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `GroupBy` can be aggregated — that is, you can compute one or several summary statistics for each group.\n", + "The result of the aggregation is a `DataFrame` containing the key columns along with new columns holding the computed statistics for a corresponding group.\n", + "\n", + "For example, `count()` computes size of group:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.868726Z", + "start_time": "2025-05-01T13:42:33.840038Z" + } + }, + "cell_type": "code", + "source": "groupedByIsIntellij.count()", + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijcount
true7
false17
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"count\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":2,\"ncol\":2},\"kotlin_dataframe\":[{\"isIntellij\":true,\"count\":7},{\"isIntellij\":false,\"count\":17}]}" + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 12 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Compute several statistics with `.aggregate { }` that provides an expression for aggregating:" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:33.937900Z", + "start_time": "2025-05-01T13:42:33.881232Z" + } + }, + "cell_type": "code", + "source": [ + "groupedByIsIntellij.aggregate {\n", + " // Compute sum and max of \"starsCount\" within each group into \"sumStars\" and \"maxStars\" columns\n", + " sumOf { starsCount } into \"sumStars\"\n", + " maxOf { starsCount } into \"maxStars\"\n", + "}" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
isIntellijsumStarsmaxStars
true2522112926
false8539239402
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"isIntellij\",\"sumStars\",\"maxStars\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":2,\"ncol\":3},\"kotlin_dataframe\":[{\"isIntellij\":true,\"sumStars\":25221,\"maxStars\":12926},{\"isIntellij\":false,\"sumStars\":85392,\"maxStars\":39402}]}" + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 13 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Sorting Rows" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "`.sort {}`/`.sortByDesc` sortes rows by value in selected columns, returning a DataFrame with sorted rows. `take(n)` returns a new `DataFrame` with the first `n` rows.\n", + "\n", + "Combine them to get Top-10 repositories by number of stars:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:34.085822Z", + "start_time": "2025-05-01T13:42:34.039730Z" + } + }, + "cell_type": "code", + "source": [ + "val dfTop10 = dfWithIsIntellij\n", + " // Sort by \"starsCount\" value descending\n", + " .sortByDesc { starsCount }\n", + " .take(10)\n", + "dfTop10" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
namestarsCounttopicsisIntellij
kotlin39402[compiler, gradle-plugin, intellij-pl...false
intellij-community12926[code-editor, ide, intellij, intellij...true
kotlin-native7101[c, compiler, kotlin, llvm, objective-c]false
compose-jb6805[android, awt, compose, declarative-u...false
ideavim6120[ideavim, intellij, intellij-platform...true
JetBrainsMono6059[coding-font, font, ligatures, monosp...false
Exposed5688[dao, kotlin, orm, sql]false
ring-ui2836[components, jetbrains-ui, react]false
kotlinconf-app2628[]false
create-react-kotlin-app2424[create-react-app, jetbrains-ui, kotl...false
\n", + " \n", + " \n", + " " + ], + "application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"starsCount\",\"topics\",\"isIntellij\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Boolean\"}],\"nrow\":10,\"ncol\":4},\"kotlin_dataframe\":[{\"name\":\"kotlin\",\"starsCount\":39402,\"topics\":[\"compiler\",\"gradle-plugin\",\"intellij-plugin\",\"kotlin\",\"kotlin-library\",\"maven-plugin\",\"programming-language\"],\"isIntellij\":false},{\"name\":\"intellij-community\",\"starsCount\":12926,\"topics\":[\"code-editor\",\"ide\",\"intellij\",\"intellij-community\",\"intellij-platform\"],\"isIntellij\":true},{\"name\":\"kotlin-native\",\"starsCount\":7101,\"topics\":[\"c\",\"compiler\",\"kotlin\",\"llvm\",\"objective-c\"],\"isIntellij\":false},{\"name\":\"compose-jb\",\"starsCount\":6805,\"topics\":[\"android\",\"awt\",\"compose\",\"declarative-ui\",\"desktop\",\"gui\",\"javascript\",\"kotlin\",\"multiplatform\",\"reactive\",\"swing\",\"ui\"],\"isIntellij\":false},{\"name\":\"ideavim\",\"starsCount\":6120,\"topics\":[\"ideavim\",\"intellij\",\"intellij-platform\",\"jb-official\",\"kotlin\",\"vim\",\"vim-emulator\"],\"isIntellij\":true},{\"name\":\"JetBrainsMono\",\"starsCount\":6059,\"topics\":[\"coding-font\",\"font\",\"ligatures\",\"monospaced-font\",\"programming-font\",\"programming-ligatures\"],\"isIntellij\":false},{\"name\":\"Exposed\",\"starsCount\":5688,\"topics\":[\"dao\",\"kotlin\",\"orm\",\"sql\"],\"isIntellij\":false},{\"name\":\"ring-ui\",\"starsCount\":2836,\"topics\":[\"components\",\"jetbrains-ui\",\"react\"],\"isIntellij\":false},{\"name\":\"kotlinconf-app\",\"starsCount\":2628,\"topics\":[\"\"],\"isIntellij\":false},{\"name\":\"create-react-kotlin-app\",\"starsCount\":2424,\"topics\":[\"create-react-app\",\"jetbrains-ui\",\"kotlin\",\"react\",\"webpack\"],\"isIntellij\":false}]}" + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 14 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Plotting With Kandy" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "Kandy is a Kotlin plotting library designed to bring Kotlin DataFrame features into chart creation, providing a convenient and typesafe way to build data visualizations.\n", + "\n", + "Kandy can be loaded into notebook using `%use kandy`:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:37.589007Z", + "start_time": "2025-05-01T13:42:34.130284Z" + } + }, + "cell_type": "code", + "source": "%use kandy", + "outputs": [], + "execution_count": 15 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Build a simple bar chart with `.plot { }` extension for DataFrame, that allows to use extension properties inside Kandy plotting DSL (plot will be rendered as an output after cell execution):" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:37.812897Z", + "start_time": "2025-05-01T13:42:37.592435Z" + } + }, + "cell_type": "code", + "source": [ + "dfTop10.plot {\n", + " bars {\n", + " x(name)\n", + " y(starsCount)\n", + " }\n", + "\n", + " layout.title = \"Top 10 JetBrains repositories by stars count\"\n", + "}" + ], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlin\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " intellij-community\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlin-native\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " compose-jb\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " ideavim\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " JetBrainsMono\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Exposed\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " ring-ui\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " kotlinconf-app\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " create-react-kotlin-app\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 0\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 10,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 20,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 30,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " 40,000\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " Top 10 JetBrains repositories by stars count\n", + " \n", + " \n", + " \n", + " \n", + " starsCount\n", + " \n", + " \n", + " \n", + " \n", + " name\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " " + ], + "application/plot+json": { + "output_type": "lets_plot_spec", + "output": { + "ggtitle": { + "text": "Top 10 JetBrains repositories by stars count" + }, + "mapping": {}, + "data": { + "starsCount": [ + 39402.0, + 12926.0, + 7101.0, + 6805.0, + 6120.0, + 6059.0, + 5688.0, + 2836.0, + 2628.0, + 2424.0 + ], + "name": [ + "kotlin", + "intellij-community", + "kotlin-native", + "compose-jb", + "ideavim", + "JetBrainsMono", + "Exposed", + "ring-ui", + "kotlinconf-app", + "create-react-kotlin-app" + ] + }, + "kind": "plot", + "scales": [ + { + "aesthetic": "x", + "discrete": true + }, + { + "aesthetic": "y", + "limits": [ + null, + null + ] + } + ], + "layers": [ + { + "mapping": { + "x": "name", + "y": "starsCount" + }, + "stat": "identity", + "sampling": "none", + "inherit_aes": false, + "position": "dodge", + "geom": "bar" + } + ], + "data_meta": { + "series_annotations": [ + { + "type": "str", + "column": "name" + }, + { + "type": "int", + "column": "starsCount" + } + ] + } + }, + "apply_color_scheme": true, + "swing_enabled": true + } + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 16 + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Write DataFrame" + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "A `DataFrame` supports writing to all formats that it is capable of reading.\n", + "\n", + "Write into Excel:" + ] + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2025-05-01T13:42:38.118495Z", + "start_time": "2025-05-01T13:42:37.851592Z" + } + }, + "cell_type": "code", + "source": "dfWithIsIntellij.writeExcel(\"jb_repos.xlsx\")", + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2025-05-01T13:42:37.894239Z Execution of code 'dfWithIsIntellij.wri...' ERROR Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...\n" + ] + } + ], + "execution_count": 17 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Kotlin", + "language": "kotlin", + "name": "kotlin" + }, + "language_info": { + "name": "kotlin", + "version": "1.9.23", + "mimetype": "text/x-kotlin", + "file_extension": ".kt", + "pygments_lexer": "kotlin", + "codemirror_mode": "text/x-kotlin", + "nbconvert_exporter": "" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/gradle.properties b/gradle.properties index 0b7b8e09c7..8df75a945a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ projectName=dataframe version=1.0.0 jupyterApiTCRepo= kotlin.jupyter.add.scanner=false -org.gradle.jvmargs=-Xmx4G +org.gradle.jvmargs=-Xmx4G -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 # build.number.detection=false # build.number=0.8.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5bcfceb862..e9220d2d3d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -61,6 +61,8 @@ geotools = "32.1" jai-core = "1.1.3" jts = "1.20.0" +kandy = "0.8.1-dev-65" + [libraries] ksp-gradle = { group = "com.google.devtools.ksp", name = "symbol-processing-gradle-plugin", version.ref = "ksp" } ksp-api = { group = "com.google.devtools.ksp", name = "symbol-processing-api", version.ref = "ksp" } @@ -90,6 +92,9 @@ postgresql = { group = "org.postgresql", name = "postgresql", version.ref = "pos sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" } jts = { group = "org.locationtech.jts", name = "jts-core", version.ref = "jtsCore" } +kandy = { group = "org.jetbrains.kotlinx", name = "kandy-lets-plot", version.ref = "kandy" } +kandy-samples-utils = { group = "org.jetbrains.kotlinx", name = "kandy-samples-utils", version.ref = "kandy" } + poi-ooxml = { group = "org.apache.poi", name = "poi-ooxml", version.ref = "poi" } kotlin-datetimeJvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime-jvm", version.ref = "kotlinDatetime" } diff --git a/plugins/expressions-converter/README.md b/plugins/expressions-converter/README.md index de341947fa..b833f4b642 100644 --- a/plugins/expressions-converter/README.md +++ b/plugins/expressions-converter/README.md @@ -6,7 +6,7 @@ DataFrame expressions from `@TransformDataFrameExpressions` annotated functions. It is used to generate sample "explainer dataframe" HTML files that can be used as iFrames on the documentation website. Annotated functions in [core/.../test/.../samples/api](../../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api) -are tested, generated, and copied over to [docs/StardustDocs/snippets](../../docs/StardustDocs/snippets) by +are tested, generated, and copied over to [docs/StardustDocs/resources/snippets](../../docs/StardustDocs/resources/snippets) by our "explainer" [plugin callback proxy](../../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer), which hooks into [the TestBase class](../../core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/TestBase.kt) and retrieves the intermediate DataFrame expressions thanks to this module. diff --git a/tests/README.md b/tests/README.md index ecaa2fe9d1..7806d950d5 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,3 +7,6 @@ and they are copied over to Markdown files in [docs/StardustDocs/topics](../docs by [Korro](https://github.com/devcrocod/korro). This module might be merged with [:core](../core): [Issue #898](https://github.com/Kotlin/dataframe/issues/898). + +See https://github.com/Kotlin/kandy/blob/samples_util/util/kandy-samples-utils/README.md for details of +the Writerside docs generation. diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index 28185b8f1b..99957219f3 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -1,3 +1,21 @@ +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.exclude +import org.gradle.kotlin.dsl.implementation +import org.gradle.kotlin.dsl.invoke +import org.gradle.kotlin.dsl.java +import org.gradle.kotlin.dsl.korro +import org.gradle.kotlin.dsl.kotlin +import org.gradle.kotlin.dsl.libs +import org.gradle.kotlin.dsl.main +import org.gradle.kotlin.dsl.projects +import org.gradle.kotlin.dsl.repositories +import org.gradle.kotlin.dsl.runKtlintCheckOverMainSourceSet +import org.gradle.kotlin.dsl.runKtlintCheckOverTestSourceSet +import org.gradle.kotlin.dsl.runKtlintFormatOverMainSourceSet +import org.gradle.kotlin.dsl.runKtlintFormatOverTestSourceSet +import org.gradle.kotlin.dsl.sourceSets +import org.gradle.kotlin.dsl.test +import org.gradle.kotlin.dsl.testImplementation plugins { java @@ -24,6 +42,8 @@ dependencies { testImplementation(libs.kotestAssertions) { exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8") } + testImplementation(libs.kandy) + testImplementation(libs.kandy.samples.utils) testImplementation(libs.kotlin.datetimeJvm) testImplementation(libs.poi) testImplementation(libs.arrow.vector) @@ -42,11 +62,13 @@ korro { docs = fileTree(rootProject.rootDir) { include("docs/StardustDocs/topics/read.md") include("docs/StardustDocs/topics/write.md") + include("docs/StardustDocs/topics/guides/*.md") } samples = fileTree(project.projectDir) { include("src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/*.kt") include("src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/*.kt") + include("src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/guides/*.kt") } groupSamples { diff --git a/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/DataFrameSampleHelper.kt b/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/DataFrameSampleHelper.kt new file mode 100644 index 0000000000..64a23760af --- /dev/null +++ b/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/DataFrameSampleHelper.kt @@ -0,0 +1,11 @@ +package org.jetbrains.kotlinx.dataframe.samples + +import org.jetbrains.kotlinx.kandy.letsplot.samples.SampleHelper + +abstract class DataFrameSampleHelper(sampleName: String, subFolder: String = "samples") : + SampleHelper( + sampleName, + subFolder, + "../docs/StardustDocs/images", + "../docs/StardustDocs/resources", + ) diff --git a/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/guides/quickstart.kt b/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/guides/quickstart.kt new file mode 100644 index 0000000000..570b4cfd6e --- /dev/null +++ b/tests/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/guides/quickstart.kt @@ -0,0 +1,230 @@ +@file:Suppress("PropertyName", "UNUSED_VARIABLE", "UNUSED_EXPRESSION", "UNCHECKED_CAST") + +package org.jetbrains.kotlinx.dataframe.samples.guides + +import org.jetbrains.kotlinx.dataframe.ColumnsContainer +import org.jetbrains.kotlinx.dataframe.DataColumn +import org.jetbrains.kotlinx.dataframe.DataFrame +import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.add +import org.jetbrains.kotlinx.dataframe.api.aggregate +import org.jetbrains.kotlinx.dataframe.api.column +import org.jetbrains.kotlinx.dataframe.api.convert +import org.jetbrains.kotlinx.dataframe.api.count +import org.jetbrains.kotlinx.dataframe.api.describe +import org.jetbrains.kotlinx.dataframe.api.filter +import org.jetbrains.kotlinx.dataframe.api.groupBy +import org.jetbrains.kotlinx.dataframe.api.into +import org.jetbrains.kotlinx.dataframe.api.maxOf +import org.jetbrains.kotlinx.dataframe.api.rename +import org.jetbrains.kotlinx.dataframe.api.select +import org.jetbrains.kotlinx.dataframe.api.sortByDesc +import org.jetbrains.kotlinx.dataframe.api.sumOf +import org.jetbrains.kotlinx.dataframe.api.take +import org.jetbrains.kotlinx.dataframe.api.update +import org.jetbrains.kotlinx.dataframe.api.with +import org.jetbrains.kotlinx.dataframe.io.readCsv +import org.jetbrains.kotlinx.dataframe.io.writeExcel +import org.jetbrains.kotlinx.dataframe.samples.DataFrameSampleHelper +import org.jetbrains.kotlinx.kandy.dsl.plot +import org.jetbrains.kotlinx.kandy.letsplot.feature.layout +import org.jetbrains.kotlinx.kandy.letsplot.layers.bars +import org.junit.Ignore +import org.junit.Test + +class QuickStartGuide : DataFrameSampleHelper("quickstart", "guides") { + private val df = DataFrame.readCsv( + "https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv", + ) + + private val full_name by column() + private val name by column() + private val stargazers_count by column() + private val starsCount by column() + private val topics by column() + + interface DFUpdatedSchema + + // TODO remove, use plugin + val DataRow.name: String + get() = get("name") as String + val ColumnsContainer.topics: DataColumn + get() = get("topics") as DataColumn + val DataRow.topics: List + get() = get("topics") as List + val ColumnsContainer.isIntellij: DataColumn + get() = get("isIntellij") as DataColumn + val DataRow.starsCount: Int + get() = get("starsCount") as Int + + private val dfSelected = df.select { full_name and stargazers_count and topics } + private val dfFiltered = dfSelected.filter { stargazers_count >= 1000 } + private val dfRenamed = dfFiltered.rename { full_name }.into("name") + // And "stargazers_count" into "starsCount" + .rename { stargazers_count }.into("starsCount") + private val dfUpdated = dfRenamed + // Update "name" values with only its second part (after '/') + .update { name }.with { it.split("/")[1] } + // Convert "topics" `String` values into `List` by splitting: + .convert { topics }.with { it.removePrefix("[").removeSuffix("]").split(", ") } as DataFrame + private val dfWithIsIntellij = dfUpdated.add("isIntellij") { + name.contains("intellij") || "intellij" in topics + } + private val groupedByIsIntellij = dfWithIsIntellij.groupBy { isIntellij } + private val dfTop10 = dfWithIsIntellij + // Sort by "starsCount" value descending + .sortByDesc { starsCount }.take(10) + + @Test + fun notebook_test_quickstart_2() { + // SampleStart + val df = DataFrame.readCsv( + "https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv", + ) + // SampleEnd + } + + @Test + fun notebook_test_quickstart_3() { + // SampleStart + df + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_4() { + // SampleStart + df.describe() + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_5() { + // SampleStart + // Select "full_name", "stargazers_count" and "topics" columns + val dfSelected = df.select { full_name and stargazers_count and topics } + dfSelected + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_6() { + // SampleStart + // Keep only rows where "stargazers_count" value is more than 1000 + val dfFiltered = dfSelected.filter { stargazers_count >= 1000 } + dfFiltered + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_7() { + // SampleStart + // Rename "full_name" column into "name" + val dfRenamed = dfFiltered.rename { full_name }.into("name") + // And "stargazers_count" into "starsCount" + .rename { stargazers_count }.into("starsCount") + dfRenamed + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_8() { + // SampleStart + val dfUpdated = dfRenamed + // Update "name" values with only its second part (after '/') + .update { name }.with { it.split("/")[1] } + // Convert "topics" `String` values into `List` by splitting: + .convert { topics }.with { it.removePrefix("[").removeSuffix("]").split(", ") } + dfUpdated + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_9() { + // SampleStart + dfUpdated.topics.type() + // SampleEnd + } + + @Test + fun notebook_test_quickstart_10() { + // SampleStart + // Add a `Boolean` column indicating whether the `name` contains the "intellij" substring + // or the topics include "intellij". + val dfWithIsIntellij = dfUpdated.add("isIntellij") { + name.contains("intellij") || "intellij" in topics + } + dfWithIsIntellij + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_11() { + // SampleStart + val groupedByIsIntellij = dfWithIsIntellij.groupBy { isIntellij } + groupedByIsIntellij + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_12() { + // SampleStart + groupedByIsIntellij.count() + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_13() { + // SampleStart + groupedByIsIntellij.aggregate { + // Compute sum and max of "starsCount" within each group into "sumStars" and "maxStars" columns + sumOf { starsCount } into "sumStars" + maxOf { starsCount } into "maxStars" + } + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_14() { + // SampleStart + val dfTop10 = dfWithIsIntellij + // Sort by "starsCount" value descending + .sortByDesc { starsCount }.take(10) + dfTop10 + // SampleEnd + .saveDfHtmlSample() + } + + @Test + fun notebook_test_quickstart_16() { + // SampleStart + dfTop10.plot { + bars { + x(name) + y(starsCount) + } + + layout.title = "Top 10 JetBrains repositories by stars count" + } + // SampleEnd + .savePlotSVGSample() + } + + @Ignore + @Test + fun notebook_test_quickstart_17() { + // SampleStart + dfWithIsIntellij.writeExcel("jb_repos.xlsx") + // SampleEnd + } +}