Skip to content

Add "Migrating from Pandas" guide#1328

Draft
zaleslaw wants to merge 1 commit into
masterfrom
issue-1299
Draft

Add "Migrating from Pandas" guide#1328
zaleslaw wants to merge 1 commit into
masterfrom
issue-1299

Conversation

@zaleslaw

Copy link
Copy Markdown
Collaborator

It's a draft, should be shipped with the validated Pandas / Kotlin DataFrame code

@zaleslaw
zaleslaw requested a review from Copilot July 17, 2025 09:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a migration guide for Pandas users moving to Kotlin DataFrame and tidies up navigation and formatting.

  • Introduces a new “Migrating from Pandas” guide
  • Cleans up a formatting quirk in the Quickstart guide
  • Updates the documentation tree to include the new guide

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
docs/StardustDocs/topics/guides/quickstart.md Merged two bullet lines into a single paragraph and added spacing
docs/StardustDocs/topics/guides/migratingFromPandas.md Added the full migration guide from Pandas to Kotlin DataFrame
docs/StardustDocs/d.tree Inserted the new guide into the site’s table of contents
Comments suppressed due to low confidence (2)

docs/StardustDocs/topics/guides/migratingFromPandas.md:214

  • [nitpick] Wrap technical terms and function names such as advanced time indexing and resample() in backticks for inline code formatting to improve readability.
- Some Pandas features (like advanced time indexing, resample()) aren’t available yet.

docs/StardustDocs/topics/guides/migratingFromPandas.md:1

  • [nitpick] Consider renaming the file to use kebab-case (e.g., migrating-from-pandas.md) to match the naming convention of other guide files.
# Migration Guide: Pandas to Kotlin DataFrame

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.
everything works out of the box, including interactivity and rich DataFrame and plots rendering.

Copilot AI Jul 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the trailing whitespace at the end of this line to avoid unintended formatting or layout issues.

Suggested change
everything works out of the box, including interactivity and rich DataFrame and plots rendering.
everything works out of the box, including interactivity and rich DataFrame and plots rendering.

Copilot uses AI. Check for mistakes.
@AndreiKingsley

AndreiKingsley commented Jul 22, 2025

Copy link
Copy Markdown
Collaborator

@zaleslaw may be use tabs instead of subsequent paragraphs (like polars docs do)?

Instead of

### Pandas (Matplotlib)

```python
df["profit"] = df.revenue - df.cost
pivot = df.pivot_table(values="profit", index="product", columns="year")
```

### Kotlin DataFrame (Kandy)

```kotlin
val pivot = df
    .add("profit") { revenue - cost }
    .pivot(product, year) { mean(profit) }
```

add tabs:

<tabs>
    <tab title="Pandas (Matplotlib)">
        ```python
df["profit"] = df.revenue - df.cost
pivot = df.pivot_table(values="profit", index="product", columns="year")
```
</tab>
    <tab title="Kotlin DataFrame (Kandy)">
       ```kotlin
val pivot = df
    .add("profit") { revenue - cost }
    .pivot(product, year) { mean(profit) }
```
</tab>

</tabs>

in all such places.

@zaleslaw

Copy link
Copy Markdown
Collaborator Author

The guide is useful, but I would not merge it before validating the code snippets. A few examples currently look non-compilable against the current API:

  • DataFrame.readArrow(...) / writeArrow(...) should likely be readArrowFeather/readArrowIPC and writeArrowFeather/writeArrowIPC.
  • DataFrame.readSqlTable("table", jdbcUrl) does not match current overloads; the first argument should be DbConnectionConfig, DataSource, or Connection.
  • df.na.count() looks like Pandas syntax and I could not find a matching Kotlin DataFrame API; describe() exposes nulls.
  • df1.join(df2, by = "id") should be df1.join(df2, "id") or selector syntax; for left join, consider df1.leftJoin(df2, "id").

Since the PR description says this should be shipped with validated Pandas / Kotlin DataFrame code, I’d suggest moving representative snippets into sample functions and referencing them with <!---FUN ...--> blocks before publishing the guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants