Closed parthm closed 7 years ago
Accepted.
@parthm - Thanks for reporting this. 👍
@zverok - If this issue doesn't get fixed by June end, I'd like to tackle this in daru-io
.
As a temporary workaround I did this:
headers = CSV.open(mycsv, &:readline)
daru_hash = {}.tap do |daru|
headers.each {|h| daru[h] = []}
end
my_dataframe = Daru::Dataframe.new(daru_hash, order: headers)
This has been fixed in daru-io with https://github.com/athityakumar/daru-io/pull/33
Trying to load a CSV with only headers errors out right now. It would be better it an empty DataFrame is created with the headers. Daru: 0.1.5 Ruby: 2.3.3 File attached as zip as CSV attachments are not supported. column_headers_only.zip
As it stands now a the CSV file needs to be loaded and checked if empty before we can load it.