Alec
Alec

Reputation: 4472

In Julia, how iterate over Dataframe columns and names?

You can iterate over the columns with:

for c in eachcol(dataframe)
   ...
end

where c is the vector of values in that column.

How can I iterate and get both the name of the column and the values in that column?

Upvotes: 3

Views: 482

Answers (1)

August
August

Reputation: 12558

for (name, col) in pairs(eachcol(dataframe))
    ...
end

Upvotes: 6

Related Questions