I need to write my matrix into a CSV file, due to the large size (~200 MB), it will be very hard to open it using Excel later on and manually add a 2nd row for the unit information.
Is there a better way to add such a row within Julia using Dataframe? Thanks!
Many thanks! I’m still having a hard time envisioning how to add a row after the header line and before the numerical values by using append = true. I wonder if you could share more details about this?
In reality, my TT contains string columns as well. Is it possible to rely on my dataframe, instead of using the numerical array TT in this step? CSV.write(F4, DataFrame(TT,:auto); append=true);
Basically do something like the below?
df = DataFrame(
Station = TT[:,1],
Latitude = TT[:,2],
Depth = TT[:,3],
Oxygen = TT[:,4]
);
CSV.write(F4, DataFrame(df[2:end,:],:auto); append=true);
Right now, it gives me this error:
LoadError: MethodError: no method matching DataFrame(::DataFrame, ::Symbol)
Closest candidates are:
DataFrame(::AbstractVector{T} where T, ::Symbol; copycols)
Or is there a better way to create an TT with some columns being strings?