Chapter 1: Dataframe Column Reference Bug (updated)

@seanmor5

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.

I wonder if you required the DataFrame library prior to this.

I was able to run this as is. I did run into a casting issue with the Z-Score Standardization. Thanks for sharing.