I have a csv file, without the header information. Each cell contains some values. Goal: Save the cell values, as well as, the corresponding row and column numbers, in a separate csv file.
@Fil Hi Fil,
Thank you so much for your help. It worked well. BTW I have some additional queries.
(a) I am using the following functions to save the array into CSV. But the problem is it is not showing the first row and column value. For example, Row:0, Col:0 value is missing. Could you please suggest what could be the reason?
This is really a completely different question. It would probably be better to ask a new one. That gives the new question greater visibility and doesnât place the onus on someone who thought about this material a month or so ago.
Having said that, if youâre trying to create a download button for your end user, you should probably use d3.csvParse and pass that result to DOM.download. Assuming your data is a list of objects, that might look like so:
download_button = {
let text = d3.csvFormat(data);
let file = new File([text], "file.csv");
return DOM.download(file, "file.csv", "Download CSV file");
}
On the other hand, if youâre just trying to grab some data as a CSV out of your notebook, you could use the âDownload CSVâ option from the vertical three dot menu on the left hand side of the cell.
@mcmcclur Thanks so much for your response. My first question is now solved. For the next two questions, Iâll ask a new question. Thank you once again.