Skip to content

Commit d3dfad0

Browse files
risenWgitbook-bot
authored andcommitted
GitBook: [#220] No subject
1 parent b041dd3 commit d3dfad0

17 files changed

+40
-28
lines changed
30.1 KB
Loading
30.1 KB
Loading
30.1 KB
Loading
49.2 KB
Loading
49.2 KB
Loading
49.2 KB
Loading
49.2 KB
Loading

api-reference/dataframe/dataframe.to_csv.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ description: Convert DataFrame to a comma-separated values (CSV)
44

55
# DataFrame.toCSV
66

7-
DataFrame.toCSV(options) 
7+
{% hint style="danger" %}
8+
Deprecated in v1.1.0: Use the [`dfd.toCSV`](../input-output/danfo.to\_csv.md) function directly instead
9+
{% endhint %}
810

9-
| | | | |
10-
| -------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
11-
| **Parameters** | Type | Description | Default |
12-
| **options** | object, optional | <p>Configuration object:</p><p></p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in browser environment.</p><p><br><strong><code>download</code></strong>: Boolean indicating whether to automatically download the CSV file in the browser. Only needed in the browser environment.</p><p></p><p><strong><code>header</code></strong>: Boolean indicating whether to include a header row in the CSV file.</p><p></p><p><strong><code>sep</code></strong>: Character to be used as a separator in the CSV file.</p><p></p> | <p>{<br><strong>sep</strong>: ","<br>}</p> |
11+
DataFrame.toCSV(options)
12+
13+
| | | | |
14+
| -------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
15+
| **Parameters** | Type | Description | Default |
16+
| **options** | object, optional | <p>Configuration object:</p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in browser environment.</p><p><br><strong><code>download</code></strong>: Boolean indicating whether to automatically download the CSV file in the browser. Only needed in the browser environment.</p><p><strong><code>header</code></strong>: Boolean indicating whether to include a header row in the CSV file.</p><p><strong><code>sep</code></strong>: Character to be used as a separator in the CSV file.</p> | <p>{<br><strong>sep</strong>: ","<br>}</p> |
1317

1418
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.
1519

api-reference/dataframe/dataframe.to_excel.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ description: >-
66

77
# DataFrame.toExcel
88

9-
> DataFrame.toExcel(options)&#x20;
9+
{% hint style="danger" %}
10+
Deprecated in v1.1.0: Use the [`dfd.toExcel`](../input-output/danfo.to\_excel.md) function directly instead
11+
{% endhint %}
1012

11-
| **Parameters** | Type | Description | Default |
12-
| -------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
13-
| **options** | object, optional | <p>Configuration object:</p><p></p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in the browser environment.</p><p><br><strong><code>sheetName</code></strong>: Name to call the excel sheet.</p><p></p> | <p>{<br><strong>filePath</strong>: "./output.xlsx",<br><strong>sheetName</strong>: "Sheet1"<br><br>}</p> |
13+
> DataFrame.toExcel(options)
14+
15+
| **Parameters** | Type | Description | Default |
16+
| -------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
17+
| **options** | object, optional | <p>Configuration object:</p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in the browser environment.</p><p><br><strong><code>sheetName</code></strong>: Name to call the excel sheet.</p> | <p>{<br><strong>filePath</strong>: "./output.xlsx",<br><strong>sheetName</strong>: "Sheet1"<br><br>}</p> |
1418

1519
The **toExcel** function can be used to write out a DataFrame or Series to Excel (**.xlsx**) file. The output format will depend on the environment. In the following examples, we show you how to write/download an Excel file from Node and Browser environments.
1620

api-reference/dataframe/dataframe.to_json.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ description: Convert DataFrame to JSON format
44

55
# DataFrame.toJSON
66

7-
> DataFrame.toJSON(options)&#x20;
7+
{% hint style="danger" %}
8+
Deprecated in v1.1.0: Use the [dfd.toJSON](../input-output/danfo.to\_json.md) function directly instead
9+
{% endhint %}
810

9-
| | | | |
10-
| -------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
11-
| **Parameters** | Type | Description | Default |
12-
| **options** | object, optional | <p>Configuration object:</p><p></p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in browser environment.</p><p><br><strong><code>format</code></strong>: The format of the JSON. Can be one of <strong><code>row</code></strong> or <strong><code>column</code></strong>.</p><p></p> | <p>{<br><strong><code>format</code></strong>: "column"<br>}</p> |
11+
> DataFrame.toJSON(options)
12+
13+
| | | | |
14+
| -------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
15+
| **Parameters** | Type | Description | Default |
16+
| **options** | object, optional | <p>Configuration object:</p><p><strong><code>filePath</code></strong>: Local file path to write the CSV file to. If not specified, the CSV will be returned as a string. Only needed in Nodejs version</p><p><br><strong><code>fileName</code></strong>: The name of the file to download as. Only needed in browser environment.</p><p><br><strong><code>format</code></strong>: The format of the JSON. Can be one of <strong><code>row</code></strong> or <strong><code>column</code></strong>.</p> | <p>{<br><strong><code>format</code></strong>: "column"<br>}</p> |
1317

1418
The **toJSON** function can be used to write out a DataFrame or Series to JSON format/file. The output is configurable and will depend on the environment. In the following examples, we show you how to write/download a JSON file from Node and Browser environments.
1519

api-reference/plotting/box-plots.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default App;
6464
{% endtab %}
6565
{% endtabs %}
6666

67-
![](../../.gitbook/assets/newplot-23-.png)
67+
![](<../../.gitbook/assets/newplot (23).png>)
6868

6969
### Box plots on a DataFrame
7070

@@ -138,7 +138,7 @@ export default App;
138138
{% endtab %}
139139
{% endtabs %}
140140

141-
![](<../../.gitbook/assets/screen-shot-2020-08-11-at-1.20.42-am (1) (1).png>)
141+
![](<../../.gitbook/assets/screen-shot-2020-08-11-at-1.20.42-am (1).png>)
142142

143143
### Box plot for selected columns in a DataFrame
144144

@@ -216,7 +216,7 @@ export default App;
216216
{% endtab %}
217217
{% endtabs %}
218218

219-
![](<../../.gitbook/assets/newplot-24- (1).png>)
219+
![](<../../.gitbook/assets/newplot (24).png>)
220220

221221
{% hint style="info" %}
222222
To customize your plots, see the [Configuring your plot page](configuring-your-plots.md)

api-reference/plotting/configuring-your-plots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,6 @@ export default App;
137137
{% endtab %}
138138
{% endtabs %}
139139

140-
![](../../.gitbook/assets/newplot-32-.png)
140+
![](<../../.gitbook/assets/newplot (32).png>)
141141

142142
##

api-reference/plotting/tables.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default App;
7575
{% endtab %}
7676
{% endtabs %}
7777

78-
![](../../.gitbook/assets/screen-shot-2020-08-11-at-12.34.08-am.png)
78+
![](<../../.gitbook/assets/Screen Shot 2020-08-11 at 12.34.08 AM.png>)
7979

8080
### Configure the header and cell of a table
8181

@@ -190,4 +190,4 @@ export default App;
190190
{% endtab %}
191191
{% endtabs %}
192192

193-
![](../../.gitbook/assets/screen-shot-2020-08-11-at-12.38.30-am.png)
193+
![](<../../.gitbook/assets/Screen Shot 2020-08-11 at 12.38.30 AM.png>)

api-reference/plotting/timeseries-plots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default App;
109109
{% endtab %}
110110
{% endtabs %}
111111

112-
![](<../../.gitbook/assets/newplot-29- (2) (2) (1).png>)
112+
![](<../../.gitbook/assets/newplot-29- (2) (1) (1) (3).png>)
113113

114114
{% hint style="info" %}
115115
To set customize your charts, see the [Customizing your plot page](configuring-your-plots.md)

building-data-driven-applications-with-danfo.js-book.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The book then shows you how to load different datasets, combine and analyze them
88

99
By the end of this app development book, you'll be able to build and embed data analytics, visualization, and ML capabilities into any JavaScript app in server-side Node.js or the browser.
1010

11-
![Danfo.js book cover](.gitbook/assets/b17076\_cover.jpg)
11+
![Danfo.js book cover](.gitbook/assets/B17076\_Cover.jpg)
1212

1313
## **What you will learn**
1414

examples/using-danfojs-in-react.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default App;
5757
5858
On running the app, we get the following output in the console:
5959
60-
![](../.gitbook/assets/screen-shot-2021-02-14-at-7.22.16-pm.png)
60+
![](<../.gitbook/assets/Screen Shot 2021-02-14 at 7.22.16 PM.png>)
6161
6262
Note that you can also import specific modules. For instance, in the code below we import only the DataFrame module:
6363

getting-started.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ let data = {
23092309

23102310
let df = new dfd.DataFrame(data)
23112311

2312-
const csv = df.toCSV()
2312+
const csv = dfd.toCSV(df)
23132313
console.log(csv);
23142314
//output
23152315
Abs,Count,country code
@@ -2318,10 +2318,10 @@ Abs,Count,country code
23182318
47.3,5,GH
23192319

23202320

2321-
df.toCSV({filePath: "testOut.csv" }) //writes to file system in Nodejs
2321+
dfd.toCSV(df, {filePath: "testOut.csv" }) //writes to file system in Nodejs
23222322

23232323

2324-
df.toCSV({fileName: "testOut", download: true }) //downloads the file in browser version
2324+
dfd.toCSV(df, {fileName: "testOut", download: true }) //downloads the file in browser version
23252325
```
23262326

23272327
```
@@ -2402,7 +2402,7 @@ let data = {
24022402

24032403
let df = new dfd.DataFrame(data)
24042404

2405-
const json = df.toJSON()
2405+
const json = dfd.toJSON(df)
24062406
console.log(json);
24072407
//output
24082408
[
@@ -2412,7 +2412,7 @@ console.log(json);
24122412
]
24132413

24142414

2415-
const json = df.toJSON({format: "row"})
2415+
const json = dfd.toJSON(df, {format: "row"})
24162416
console.log(json);
24172417
//output
24182418
{

0 commit comments

Comments
 (0)