javascriptdata / dnotebook

Dnotebook is a Jupyter-like library for javaScript environment. It allows you to create and share pages that contain live code, text and visualizations.
https://dnotebook.jsdata.org/getting-started
MIT License
148 stars 10 forks source link

How to save data into csv file in dnotebook? #8

Closed cdjim closed 2 years ago

cdjim commented 3 years ago

Hi there, thanks for creating this project and making data analysis easier in the JavaScript world.

I am cleaning up some data and would like to save the result into local file, e.g. csv format. Does dnotebook supports this and how?

Using Danfo.js, DataFrame.to_csv could save the result to local drive. But in dnotebook, there is no any files saved after execute to_csv. Below is the my code.

`var data = { "Abs": [20.2, 30, 47.3] , "Count": [34, 4, 5] , "country code": ["NG", "FR", "GH"] } let df = new dfd.DataFrame(data) df.to_csv("./try_data.csv").then((csv) => { console.log(csv);

}).catch((err) => {

console.log(err);

})`

Sanchayata commented 2 years ago

I also have the same question. Please look into this @GantMan @steveoni @risenW @AceTheCreator

risenW commented 2 years ago

I also have the same question. Please look into this @GantMan @steveoni @risenW @AceTheCreator

Hi, you can now download files even in the browser. So update to the latest Danfojs, and use the toCSV function. See :

` df.toCSV({ fileName: "testOut.csv", download: true});

`

Sanchayata commented 2 years ago

I tried that but in dnotebook it is not giving me any output or downloading anything. Can you suggest what might be the issue? @risenW

Sanchayata commented 2 years ago

I also have the same question. Please look into this @GantMan @steveoni @risenW @AceTheCreator

Hi, you can now download files even in the browser. So update to the latest Danfojs, and use the toCSV function. See :

` df.toCSV({ fileName: "testOut.csv", download: true});

`

This is the code i used: Xtrain.to_csv({ filePath: "Newtrain.csv", download: true})

But it shows no result and nothing gets downloaded.

Can you please help regarding this @risenW @GantMan @steveoni ?

Sanchayata commented 2 years ago

I also have the same question. Please look into this @GantMan @steveoni @risenW @AceTheCreator

Hi, you can now download files even in the browser. So update to the latest Danfojs, and use the toCSV function. See :

` df.toCSV({ fileName: "testOut.csv", download: true});

`

This is not possible in dnotebook. Can you suggest how we can do it in dnotebook? @GantMan @steveoni @risenW @AceTheCreator @geoffrey1330

AceTheCreator commented 2 years ago

@Sanchayata I'll look into this issue and get back. Thanks for raising this issue