Location: In Chapter 1, on page 14
Description: While attempting to cast the species
column to a category in normalized_iris
, the code snippet:
normalized_iris = DF.mutate(normalized_iris, [
species: Explorer.Series.cast(species, :category)
])
produces an undefined variable error for species
.
Solution: Update the code to include the pin operator (^
) for referencing species
correctly from normalized_iris
:
normalized_iris = DF.mutate(normalized_iris, [
species: Explorer.Series.cast(^normalized_iris["species"], :category)
])
This adjustment ensures species
is correctly pinned, resolving the undefined variable error.
Also the author should consider replacing DF with df as that is what is used in the Explorer library.