# Machine Learning in Elixir: Error in Chapter 1, first code snippet of "Preparing the Data for Training" (page 13)

**URL:** <https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132>\
**Category:** PragProg Customers\
**Tags:** book-machine-learning-in-elixir, errata\
**Created:** [20 July 2023 14:06 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132 "2023-07-20T14:06:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martincabrera](https://forum.devtalk.com/user_avatar/forum.devtalk.com/martincabrera/32/5234_2.png) [@martincabrera](https://forum.devtalk.com/u/martincabrera)\
**Post date:** [20 July 2023 14:06 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132/1 "2023-07-20T14:06:41Z")

</div>

### @seanmor5

The mutate macro from the Explorer.DataFrame variable does not like variables:

 ![Screen Shot 2023-07-20 at 11.56.46](https://forum.devtalk.com/uploads/default/original/2X/5/5040a5c4c945b85b3b4810c85957d8a3c4784edb.jpeg)

It works without the variable:

 ![Screen Shot 2023-07-20 at 11.57.06](https://forum.devtalk.com/uploads/default/original/2X/0/0b4384d8bdc0c54a4d25805fc124ff6d1ea7c764.jpeg)

---

<div class="post-metadata">

**Author:** ![seanmor5](https://forum.devtalk.com/user_avatar/forum.devtalk.com/seanmor5/32/1169_2.png) [@seanmor5](https://forum.devtalk.com/u/seanmor5)\
**Post date:** [20 July 2023 15:20 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132/2 "2023-07-20T15:20:16Z")

</div>

Nice catch! This is the same as: [Machine Learning in Elixir: Mutate not working, missing pin ^ (Iris example, Chapter 1)](https://forum.devtalk.com/t/machine-learning-in-elixir-mutate-not-working-missing-pin-iris-example-chapter-1/117131)

You can use `cols` with the pin operator, e.g. `across(^cols)`

---

<div class="post-metadata">

**Author:** ![ghenry](https://forum.devtalk.com/user_avatar/forum.devtalk.com/ghenry/32/4533_2.png) [@ghenry](https://forum.devtalk.com/u/ghenry)\
**Post date:** [28 July 2023 12:15 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132/3 "2023-07-28T12:15:44Z")

</div>

Beat me to reporting it 🙂

---

<div class="post-metadata">

**Author:** ![sehHeiden](https://forum.devtalk.com/user_avatar/forum.devtalk.com/sehheiden/32/5286_2.png) [@sehHeiden](https://forum.devtalk.com/u/sehHeiden)\
**Post date:** [31 July 2023 23:08 UTC](https://forum.devtalk.com/t/machine-learning-in-elixir-error-in-chapter-1-first-code-snippet-of-preparing-the-data-for-training-page-13/117132/4 "2023-07-31T23:08:39Z")

</div>

helpful.

But why can’t I use: the across, mean and variance functions on its own?
