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

Commit eb8f5e0

Browse files
committed
correcting the doc
1 parent dccde1d commit eb8f5e0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,27 @@ const df2 = df.drop('column1');
128128
console.log(df2.listColumns());
129129
// ['column2', 'column3']
130130

131-
console.log(Object.is(df2, df));
132-
// false. df2 is no longer an instance of df.
131+
console.log(Object.is(df2.dim(), df.dim()));
132+
// false, they didn't have the same dimensions. df2 is no longer an instance of df.
133133
console.log(
134134
Object.is(
135-
df.map(row => row.set('colum2', row.get('column2') + 8)),
135+
df2.map(row => row),
136136
df2
137137
)
138138
);
139-
// false. a modification of df2 send another instance of DataFrame
139+
// false. a modification of df2 send another instance of DataFrame, even if nothing change.
140+
141+
// if we create a new column
142+
df2.withColumn('anewcolumn', row => row.get('column2') + 8);
143+
console.log(
144+
df2.select('anewcolumn')
145+
);
146+
// NoSuchColumnError
147+
// df2 wasn't mutated
140148

141149
```
142150

143-
For more informations you can find the API below.
151+
For more informations about all DataFrame manipulations you can find the API below.
144152

145153
#### List of available methods and their examples:
146154

0 commit comments

Comments
 (0)