You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-22Lines changed: 3 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,38 +31,19 @@ series keys: #(k1 k2 k3).
31
31
```
32
32
33
33
### Creating a DataFrame
34
-
There are four ways of creating a data frame:
35
-
1. Creating an empty data frame, then filling it with data
36
-
2. Creating a data frame from an array of rows
37
-
3. Creating a data frame from an array of columns
38
-
4. Reading data from a file
39
-
40
-
#### Creating an empty DataFrame
41
-
You can create an empty instance of `DataFrame` using the `new` message
42
-
43
-
```smalltalk
44
-
df := DataFrame new.
45
-
```
46
-
The data can be added later using the `add:` message.
47
-
```smalltalk
48
-
df add: #('Barcelona' 1.609 true).
49
-
```
50
-
51
-
#### Creating a DataFrame from an array of rows
52
-
This way is the best for creating simple examples for testing since you can see how the data will be arranged in your data frame.
34
+
The easiest way to create an object of `DataFrame` class is by passing it an array of rows or columns (an array of arrays). Creating a DataFrame from rows allows us to see how the data will be arranged in a table. It's very readable and can be handy if we need to write some simple examples for testing
53
35
54
36
```smalltalk
55
-
df := DataFrame rows: #(
37
+
df := DataFrame fromRows: #(
56
38
('Barcelona' 1.609 true)
57
39
('Dubai' 2.789 true)
58
40
('London' 8.788 false)).
59
41
```
60
42
61
-
#### Creating a DataFrame from an array of columns
0 commit comments