You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/Examples/statistics.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ To run the notebooks you will have to install a third-party library,
14
14
15
15
After installing `cl-jupyter`, clone the IPS repository into your `~/common-lisp/` directory.
16
16
17
-
{{< alert title="Note" >}}Be careful when upgrading `common-lisp-jupyter`. Breaking changes are often introduced without warning. If you experience problems, use cl-jupyter revision `b1021ab` by using the [get checkout command](https://www.git-tower.com/learn/git/faq/git-checkout-commits/).
17
+
{{< alert title="Note" >}}Be careful when upgrading `common-lisp-jupyter`. Breaking changes are often introduced without warning. If you experience problems, use cl-jupyter revision `b1021ab` by using the [git checkout command](https://www.git-tower.com/learn/git/faq/git-checkout-commits/).
Copy file name to clipboardExpand all lines: content/en/docs/Manuals/data-frame.md
+40-40
Original file line number
Diff line number
Diff line change
@@ -1363,41 +1363,6 @@ Let's change the `print-object` back to our convenience method.
1363
1363
(df:print-data df stream nil)))
1364
1364
```
1365
1365
1366
-
### stacking
1367
-
1368
-
Stacking is done with the [array-operations stacking functions](/docs/manuals/array-operations/#stacking). Since these functions operate on both arrays and data frames, we can use them to stack data frames, arrays, or a mixture of both, providing they have a rank of 2. Here's an example using the `mtcars` data frame:
and now stack it onto the `mtcars` data set (load it with `(data :mtcars)` if you haven't already done so):
1375
-
```
1376
-
(matrix-df
1377
-
(keys mtcars)
1378
-
(stack-rows mtcars boss-mustang))
1379
-
```
1380
-
This is the functional equivalent of R's `rbind` function. You can also add columns with the `stack-cols` function.
1381
-
1382
-
An often asked question is: why don't you have a dedicated `stack-rows` function? Well, if you want one it might look like this:
1383
-
```
1384
-
(defun stack-rows (df &rest objects)
1385
-
"Stack rows that works on matrices and/or data frames."
1386
-
(matrix-df
1387
-
(keys df)
1388
-
(apply #'aops:stack-rows (cons df objects))))
1389
-
```
1390
-
But now the data frame must be the first parameter passed to the function. Or perhaps you want to rename the columns? Or you have matrices as your starting point? For all those reasons, it makes more sense to pass in the column keys than a data frame:
1391
-
```
1392
-
(defun stack-rows (col-names &rest objects)
1393
-
"Stack rows that works on matrices and/or data frames."
1394
-
(matrix-df
1395
-
(keys col-names)
1396
-
(stack-rows objects)))
1397
-
```
1398
-
However this means we have two `stack-rows` functions, and you don't really gain anything except an extra function call. So use the above definition if you like; we use the first example and call `matrix-df` and `stack-rows` to stack data frames.
1399
-
1400
-
1401
1366
1402
1367
## Column operations
1403
1368
@@ -1438,7 +1403,7 @@ You can also return a subset of the columns by passing in a selection:
Columns are "setf-able" places and the simplest way to replace a
1613
1578
column is set the field to a new value. We'll complement the `sex`
@@ -1659,7 +1624,7 @@ instead of `setf`-ing `*d*`:
1659
1624
;; 4 Male 30 170 79.4
1660
1625
```
1661
1626
1662
-
### Transform columns
1627
+
### transform columns
1663
1628
1664
1629
There are two functions for column transformations, `replace-column`
1665
1630
and `map-columns`.
@@ -1721,6 +1686,41 @@ categorical values like gender/sex.
1721
1686
As the name suggests, row operations operate on each row, or
1722
1687
observation, of a data set.
1723
1688
1689
+
### add rows
1690
+
1691
+
Adding rows is done with the [array-operations stacking functions](/docs/manuals/array-operations/#stacking). Since these functions operate on both arrays and data frames, we can use them to stack data frames, arrays, or a mixture of both, providing they have a rank of 2. Here's an example of adding a row to the `mtcars` data frame:
and now stack it onto the `mtcars` data set (load it with `(data :mtcars)` if you haven't already done so):
1698
+
```lisp
1699
+
(matrix-df
1700
+
(keys mtcars)
1701
+
(stack-rows mtcars boss-mustang))
1702
+
```
1703
+
This is the functional equivalent of R's `rbind` function. You can also add columns with the `stack-cols` function.
1704
+
1705
+
An often asked question is: why don't you have a dedicated `stack-rows` function? Well, if you want one it might look like this:
1706
+
```lisp
1707
+
(defun stack-rows (df &rest objects)
1708
+
"Stack rows that works on matrices and/or data frames."
1709
+
(matrix-df
1710
+
(keys df)
1711
+
(apply #'aops:stack-rows (cons df objects))))
1712
+
```
1713
+
But now the data frame must be the first parameter passed to the function. Or perhaps you want to rename the columns? Or you have matrices as your starting point? For all those reasons, it makes more sense to pass in the column keys than a data frame:
1714
+
```lisp
1715
+
(defun stack-rows (col-names &rest objects)
1716
+
"Stack rows that works on matrices and/or data frames."
1717
+
(matrix-df
1718
+
(keys col-names)
1719
+
(stack-rows objects)))
1720
+
```
1721
+
However this means we have two `stack-rows` functions, and you don't really gain anything except an extra function call. So use the above definition if you like; we use the first example and call `matrix-df` and `stack-rows` to stack data frames.
1722
+
1723
+
1724
1724
### count-rows
1725
1725
1726
1726
This function is used to determine how many rows meet a certain
0 commit comments