I have a Data Frame with missing values on it.
using DataFrames df = DataFrame( Y = ["A", "B", "C", "D", "E", "F"], Z = ["A", missing, "C", missing, "E", missing] )
When I tried to transform to lowercase I got a
MethodError: no method matching lowercase(::Missing) message, it doesn’t work because of the missing values:
transform(df, :Y => ByRow(x-> lowercase(x)) => :Y)
So I’m using:
broadcast(v -> ismissing(v) ? missing : lowercase(v), df[!, :Z]);
- Is there any other simple option to transform a column to lowercase keeping the missing values as it is, something like
- Is it possible to use
@pipewith the broadcast function above?