Skip to content

Commit

Permalink
Merge pull request #924 from dmcg/patch-1
Browse files Browse the repository at this point in the history
Make it clear that dataframes are immutable
  • Loading branch information
Jolanrensen authored Nov 15, 2024
2 parents 82729b4 + 9269636 commit c66d4b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/StardustDocs/topics/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ val df = DataFrame.readCSV("titanic.csv", delimiter = ';')

```kotlin
// filter rows
df.filter { survived && home.endsWith("NY") && age in 10..20 }
val someSurvivors = df.filter { survived && home.endsWith("NY") && age in 10..20 }

// add column
df.add("birthYear") { 1912 - age }
val withBirthYearColumn = df.add("birthYear") { 1912 - age }

// sort rows
df.sortByDesc { age }
val sortedByAge = df.sortByDesc { age }

// aggregate data
df.groupBy { pclass }.aggregate {
val aggregated = df.groupBy { pclass }.aggregate {
maxBy { age }.name into "oldest person"
count { survived } into "survived"
}
Expand Down Expand Up @@ -119,7 +119,7 @@ val dfClean = df
**Aggregate:**
```kotlin
// group by flight origin
dfClean.groupBy { From into "origin" }.aggregate {
val analysed = dfClean.groupBy { From into "origin" }.aggregate {
// we are in the context of single data group

// number of flights from origin
Expand Down

0 comments on commit c66d4b3

Please sign in to comment.