danfo.toCSV
Writes a DataFrame or Series to CSV format.
danfo.toCSV(data, options)
Parameters | Type | Description | Default |
data | Series or DataFrame | The Series or DataFrame to write to CSV | |
options | object, optional | Configuration object: {
} | { download: false, sep: "," } |
The toCSV function can be used to write out a DataFrame or Series to CSV file. The output is configurable and will depend on the environment. In the following examples, we show you how to write/download a CSV file from Node and Browser environments.
Convert DataFrame to CSV string and return value
Convert DataFrame to CSV string and write to file path
Writing a CSV file to a local file path is only supported in the Nodejs environment
Convert DataFrame to CSV string and download file in Client-side lib
You can automatically convert and download a CSV file in a browser environment, by specifying a fileName
and setting download
to true.
Last updated