I have a folder of .csv files that I'd like to read and convert to a dataframe.
I have attempted a function to do this:
function read_CSV_all(name_in::String)
folder = joinpath(@__DIR__, "../validation", name_in)
files = glob("*.csv",folder)
dfs = CSV.read.(files,DataFrame)
df = vcat(dfs...)
return df
end
but I get an error
ERROR: LoadError: ArgumentError: column(s) ... are missing from argument(s) 4
The columns in each .csv file I am ready from all have different lengths- could this be the issue? My function works when I return df (the array of dataframes), but I would like a single dataframe containing all the columns of the .csv files I am reading.