CSV.jl icon indicating copy to clipboard operation
CSV.jl copied to clipboard

Need a feature to handle an extra unit row

Open Leon6j opened this issue 4 years ago • 1 comments

It is a common practice to have a 2nd unit row below the headers. An example is as below:

Year, Month, Day, Temperature, Oxygen
'', '', '', 'oC', 'umol/kg'
2020, 5, 12, 26.7, 200
2021, 1, 16, 5.2, 156
...

I wonder if you could please consider adding such a feature, so that we can define the unit of each parameter when defining the dataframe step? Maybe something like below?

df = DataFrame( Year = TT[:,1], Month = TT[:,2], Day = TT[:,3], Temperature = TT[:,4], Oxygen = TT[:,5] );

df.units = {"", "", "", "oC", "umol/kg"};

F1 = "sample.csv"; CSV.write(F1, df, unitrow = 2);

Leon6j avatar Oct 23 '21 00:10 Leon6j

I'm not exactly sure what the request here is. Something for CSV.jl or DataFrames.jl?

quinnj avatar Oct 27 '21 03:10 quinnj