Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

Commit 1106df1

Browse files
committed
Adding a new parameter to transpose
1 parent 403523b commit 1106df1

File tree

20 files changed

+308
-285
lines changed

20 files changed

+308
-285
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "6"
4+
- "5"
5+
- "4"
6+
- "0.12"

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
- Debbugging DataFrame.sortBy() when used with string.
2929
- DataFrame.distinct() now throw correctly NoSuchColumnError when passing an incorrect columnName.
3030
- Adding Error messages on Row, DataFrame, GroupedDataFrame and modules...
31-
- join methods are compeltely revisited, providing a result near from sql. Moreover you can join on multiple columns.
31+
- join methods are completely revisited, providing a result near from sql. Moreover you can join on multiple columns.
3232
- DataFrame.replace() columnNames arguments are now passed as String (for a single column) or in Array (for multiple ones).
33+
- DataFrame.transpose() has now an optional argument, transposeColumnNames which place columnNames as rowNames.
3334
- Adding unit tests to cover more cases.
3435
- Unit tests are now realized on es5 compiled version.
3536
- Clarifying error messages.

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
dataframe-js provides another way to work with data in javascript (browser or server side) by using DataFrame, a data structure already used in some languages (Python, R, ...).
77

88
A DataFrame is simply built on two concepts:
9-
- **Columns** providing ways to select your data and reorganize them.
10-
- **Rows** providing ways to modify or filter your data.
9+
- **Columns** provide ways to select your data and reorganize them.
10+
- **Rows** provide ways to modify or filter your data.
1111

1212
````javascript
1313
const df = new DataFrame(rawData, columns)
@@ -56,7 +56,7 @@ Complete API documentation: [Index](./doc/md-api/index.md)
5656

5757
### Examples
5858

59-
[A simple use of DataFrame into the browser](./examples/example.html)
59+
[A simple use of DataFrame for data exploration tasks](./examples/titanic_analysis.js)
6060

6161
[Unit tests](./tests/)
6262

@@ -75,7 +75,7 @@ var DataFrame = dfjs.DataFrame;
7575

7676
#### DataFrame Creation
7777

78-
You can create a DataFrame by using different ways:
78+
You can create a DataFrame by using mutiple ways:
7979

8080
```javascript
8181
const df = new DataFrame(data, columns);
@@ -107,7 +107,7 @@ DataFrame.fromJSON('http://myurl/myfile.json').then(df => df)
107107

108108
#### DataFrame API detail
109109

110-
[Creation](./doc/index.md#creation): You can create a DataFrame from files.
110+
[Creation](./doc/index.md#creation): Create a DataFrame from files or from JavaScript objects.
111111

112112
[Export](./doc/index.md#export): Export a DataFrame in different files format or javascript objects.
113113

@@ -117,19 +117,19 @@ DataFrame.fromJSON('http://myurl/myfile.json').then(df => df)
117117

118118
[Working with Rows](./doc/index.md#rows): Manipulate and transform rows of your DataFrame.
119119

120-
[Working at Row level](./doc/index.md#row): Use the Row api to set or get some values when you map, filter or other Rows manipulations...
120+
[Working at Row level](./doc/index.md#row): Use the Row api to set or get some values when you map, filter or do other Rows manipulations...
121121

122122
[Working with aggregates](./doc/index.md#groupeddataframe): Apply aggregations when you groupBy a DataFrame in order to resume your data.
123123

124124

125125

126126
### Modules Usage
127127

128-
#### Default modules API detail
128+
#### Default modules API details
129129

130130
[Stat](./doc/md-api/index.md#stat)
131131

132-
This module provides basic statistics computations on a DataFrame columns.
132+
This module provides basic statistical computations on a DataFrame columns.
133133

134134
````js
135135
df.stat.*
@@ -161,7 +161,7 @@ DataFrame.sql.request('SELECT * FROM tmp2 WHERE column1 = 6')
161161

162162
#### Modules creation
163163

164-
Each module is a class with a constructor taking dataframe as parameter, and having df and name properties:
164+
Each module is a class with a constructor taking dataframe as parameter, and having a df and a name properties:
165165

166166
```javascript
167167
class FakeModule {
@@ -178,7 +178,7 @@ class FakeModule {
178178

179179
#### Modules registration
180180

181-
You can register modules when you instanciate a DataFrame:
181+
You can register modules when you instantiate a DataFrame:
182182

183183
```javascript
184184
const df = new DataFrame(data, ['column1', 'column2', 'column3'], FakeModule, AnotherModule)

doc/html-api/index.html

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ <h3 class='fl m0' id='dataframe'>
693693
DataFrame
694694
</h3>
695695

696-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/dataframe.js#L16-L843'>
696+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/dataframe.js#L16-L846'>
697697
<span>src/dataframe.js</span>
698698
</a>
699699

@@ -1736,18 +1736,19 @@ <h3 class='fl m0' id='dataframe'>
17361736
<div class="clearfix small pointer toggle-sibling">
17371737
<div class="py1 contain">
17381738
<a class='icon pin-right py1 dark-link caret-right'></a>
1739-
<span class='code strong strong truncate'>transpose()</span>
1739+
<span class='code strong strong truncate'>transpose(tranposeColumnNames)</span>
17401740
</div>
17411741
</div>
17421742
<div class="clearfix display-none toggle-target">
17431743
<section class='p2 mb2 clearfix bg-white minishadow'>
17441744

17451745

17461746

1747-
<p>Transpose a DataFrame. Rows become columns and conversely. n x p =&gt; p x n.</p>
1747+
<p>Transpose a DataFrame. Rows become columns and conversely. n x p =&gt; p x n.
1748+
{Boolean} [transposeColumnNames=false] An option to transpose columnNames in a rowNames column.</p>
17481749

17491750

1750-
<div class='pre p1 fill-light mt0'>transpose(): &ETH;ataFrame</div>
1751+
<div class='pre p1 fill-light mt0'>transpose(tranposeColumnNames: any): &ETH;ataFrame</div>
17511752

17521753

17531754

@@ -1758,6 +1759,18 @@ <h3 class='fl m0' id='dataframe'>
17581759

17591760

17601761

1762+
<div class='py1 quiet mt1 prose-big'>Parameters</div>
1763+
<div class='prose'>
1764+
1765+
<div class='space-bottom0'>
1766+
<div>
1767+
<span class='code bold'>tranposeColumnNames</span> <code class='quiet'>(any)</code>
1768+
</div>
1769+
1770+
</div>
1771+
1772+
</div>
1773+
17611774

17621775

17631776

@@ -4452,7 +4465,7 @@ <h3 class='fl m0' id='groupeddataframe'>
44524465
GroupedDataFrame
44534466
</h3>
44544467

4455-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/groupedDataframe.js#L10-L118'>
4468+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/groupedDataframe.js#L10-L118'>
44564469
<span>src/groupedDataframe.js</span>
44574470
</a>
44584471

@@ -4910,7 +4923,7 @@ <h3 class='fl m0' id='stat'>
49104923
Stat
49114924
</h3>
49124925

4913-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/modules/stat.js#L6-L128'>
4926+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/modules/stat.js#L6-L128'>
49144927
<span>src/modules/stat.js</span>
49154928
</a>
49164929

@@ -5619,7 +5632,7 @@ <h3 class='fl m0' id='matrix'>
56195632
Matrix
56205633
</h3>
56215634

5622-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/modules/matrix.js#L9-L94'>
5635+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/modules/matrix.js#L9-L94'>
56235636
<span>src/modules/matrix.js</span>
56245637
</a>
56255638

@@ -6029,7 +6042,7 @@ <h3 class='fl m0' id='sql'>
60296042
SQL
60306043
</h3>
60316044

6032-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/modules/sql.js#L9-L102'>
6045+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/modules/sql.js#L9-L102'>
60336046
<span>src/modules/sql.js</span>
60346047
</a>
60356048

@@ -6631,7 +6644,7 @@ <h3 class='fl m0' id='row'>
66316644
Row
66326645
</h3>
66336646

6634-
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/070b0a2b133ce27d8d80e2ab34b55c0198d87996/src/row.js#L12-L155'>
6647+
<a class='fr fill-darken0 round round pad1x quiet h5' href='https://github.com/Gmousse/dataframe-js/blob/403523b9586be9381232a2ea0d21cdffe9306f8f/src/row.js#L12-L155'>
66356648
<span>src/row.js</span>
66366649
</a>
66376650

0 commit comments

Comments
 (0)