Is there an equivalent of eachindex() for DataFrames?

If all columns have the same type then what is enough is:

for col in eachcol(df)
    for v in col::Vector{String} # assuming this is the type of column
        ... your code
    end
end

of course converting to a Matrix or to Tables.columntable also will work in this case.

1 Like