@@ -47,7 +47,7 @@ export default class Series extends BaseSeries implements ExtendedSeriesInterfac
4747 }
4848
4949 /**
50- * Converts a DataFrame to CSV.
50+ * Converts a Series to CSV.
5151 * @param options Configuration object. Supports the following options:
5252 * - `filePath`: Local file path to write the CSV file. If not specified, the CSV will be returned as a string. Option is only available in NodeJS.
5353 * - `fileName`: Name of the CSV file. Defaults to `data.csv`. Option is only available in Browser.
@@ -57,48 +57,27 @@ export default class Series extends BaseSeries implements ExtendedSeriesInterfac
5757 *
5858 * @example
5959 * ```
60- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
60+ * const df = new Series([ 1, 2, 3, 4])
6161 * const csv = df.toCSV()
62- * console.log(csv)
63- * //output
64- * "A","B"
65- * 1,2
66- * 3,4
6762 * ```
6863 *
6964 * @example
7065 * ```
71- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
66+ * const df = new Series([ 1, 2, 3, 4])
7267 * const csv = df.toCSV({ header: false })
73- * console.log(csv)
74- * //output
75- * 1,2
76- * 3,4
7768 * ```
7869 *
7970 * @example
8071 * ```
81- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
72+ * const df = new Series([ 1, 2, 3, 4])
8273 * const csv = df.toCSV({ sep: ';' })
83- * console.log(csv)
84- * //output
85- * "A";"B"
86- * 1;2
87- * 3;4
8874 * ```
8975 *
9076 * @example
9177 * ```
92- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
78+ * const df = new Series([ 1, 2, 3, 4])
9379 * df.toCSV({ filePath: './data.csv' }) //write to local file in NodeJS
9480 * ```
95- *
96- * @example
97- * ```
98- * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']})
99- * df.toCSV({ fileName: 'data.csv', download: true }) //Downloads file in Browser
100- * ```
101- *
10281 */
10382 toCSV ( options ?: CsvOutputOptionsNode ) : string
10483 toCSV ( options ?: CsvOutputOptionsNode ) : string | void {
@@ -107,7 +86,7 @@ export default class Series extends BaseSeries implements ExtendedSeriesInterfac
10786 }
10887
10988 /**
110- * Converts a DataFrame to JSON.
89+ * Converts a Series to JSON.
11190 * @param options Configuration object. Supported options:
11291 * - `filePath`: The file path to write the JSON to. If not specified, the JSON object is returned. Option is only available in NodeJS.
11392 * - `fileName`: The name of the JSON file. Defaults to `data.json`. Option is only available in Browser.
@@ -116,39 +95,27 @@ export default class Series extends BaseSeries implements ExtendedSeriesInterfac
11695 *
11796 * @example
11897 * ```
119- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
98+ * const df = new Series([ 1, 2, 3, 4])
12099 * const json = df.toJSON()
121100 * ```
122101 *
123102 * @example
124103 * ```
125- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
104+ * const df = new Series([ 1, 2, 3, 4])
126105 * const json = df.toJSON({ format: 'row' })
127- * console.log(json)
128- * //output
129- * [{"A":1,"B":2},{"A":3,"B":4}]
130106 * ```
131107 *
132108 * @example
133109 * ```
134- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
110+ * const df = new Series([ 1, 2, 3, 4])
135111 * const json = df.toJSON({ format: "column" })
136- * console.log(json)
137- * //output
138- * {"A":[1,3],"B":[2,4]}
139112 * ```
140113 *
141114 * @example
142115 * ```
143- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
116+ * const df = new Series([ 1, 2, 3, 4])
144117 * df.toJSON({ filePath: './data.json' }) // downloads to local file system as data.json in NodeJS
145118 * ```
146- *
147- * @example
148- * ```
149- * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']})
150- * df.toJSON({ fileName: 'data.json', download: true }) // downloads file browser
151- * ```
152119 */
153120 toJSON ( options ?: JsonOutputOptionsNode ) : object
154121 toJSON ( options ?: JsonOutputOptionsNode ) : object | void {
@@ -157,27 +124,21 @@ export default class Series extends BaseSeries implements ExtendedSeriesInterfac
157124
158125
159126 /**
160- * Converts a DataFrame to Excel file format.
127+ * Converts a Series to Excel file format.
161128 * @param options Configuration object. Supported options:
162129 * - `sheetName`: The sheet name to be written to. Defaults to `'Sheet1'`.
163130 * - `filePath`: The filePath to be written to. Defaults to `'./output.xlsx'`. Option is only available in NodeJs
164131 * - `fileName`: The fileName to be written to. Defaults to `'output.xlsx'`. Option is only available in Browser
165132 *
166133 * @example
167134 * ```
168- * const df = new DataFrame([[ 1, 2], [ 3, 4]], { columns: ['A', 'B']} )
135+ * const df = new Series([ 1, 2, 3, 4])
169136 * df.toExcel({ filePath: './output.xlsx' }) // writes to local file system as output.xlsx in NodeJS
170137 * ```
171138 *
172139 * @example
173140 * ```
174- * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']})
175- * df.toExcel({ fileName: 'output.xlsx', download: true }) // downloads file browser
176- * ```
177- *
178- * @example
179- * ```
180- * const df = new DataFrame([[1, 2], [3, 4]], { columns: ['A', 'B']})
141+ * const df = new Series([1, 2, 3, 4])
181142 * df.toExcel({ sheetName: 'Sheet2' }) // writes to Sheet2 in Excel
182143 * ```
183144 *
0 commit comments