Hello,
I am new to Julia, so please have mercy.
I am reading multiple CSV files, where the rows are the same. But in order to distinguish the different files Iβm reading, I have to add a row to indicate that.
Here is a minimalistic example:
header = ["Col1", "Col2", "Set_number"]
observation1 = [1, 2]
observation2 = [3, 4]
# ...
observationX = [7, 8]
relevant_data = DataFrame([[], [], []], header)
# sets is an array with filepaths
for set in sets
filtered_data = CSV.read(set, header)
filtered_data.Set .= set_number
append!(relevant_data, filtered_data)
end
end
So in order to add the missing row, I am reading the files intentionally with a given header, that is longer than the data set. The missing data is filled with βmissingβ and I replace it later with the intentional value, depending on the current set in the loop.
This leads to the problem, that the terminal is spammed with the warning that missing data is filled in.
Is there a neater way to do what I want to do?
It feels like I am not doing it quite right, although it works for me just fine.