Skip to content

Commit

Permalink
feat: add corr
Browse files Browse the repository at this point in the history
  • Loading branch information
kandolfp committed Nov 4, 2024
1 parent 06b19e6 commit b358437
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sc/pandas.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Quite often it is useful to find out how often a value appears, this can be done
df["ww0"].value_counts()
```

Last bat not least we need to discuss merging of `Series` and `DataFrame` objects.
Of course we can combine or merge `Series` and `DataFrame` objects.

The handling is similar as with databases where there are different ways to _ join_ data.
First we `concat` row-wise
Expand All @@ -235,6 +235,18 @@ Before we finish up our excursion into `pandas` we also want to show the plottin
df.boxplot(column=["nm"])
```

We can also compute the correlation between two series
```{python}
#| classes: styled-output
df["nm"].corr(df["wfl"])
```
or the entire `DataFrame`
```{python}
df.corr()
```


There are a lot of additional features contained in `pandas` that we will learn by using it.
Nevertheless let us recall some further references:

Expand Down

0 comments on commit b358437

Please sign in to comment.