I guess your csv doesn’t have headers? You can do a number of things:
-
Manually add a header line to the csv (just add a row in Excel or something and type names for columns into it)
-
Pass the header directly into
CSV.read
likeCSV.read("myfile.csv", header = ["first_column_name", "second_column_name", "third_column_name"])
-
If you’ve read the file into a DataFrame (let’s call it
df
) already you can callrename!(df, [:first_column_name, :second_column_name, :third_column_name])
on it