Skip to content

Commit 4bc142b

Browse files
committed
Update README.md
1 parent 2ad5c7a commit 4bc142b

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ df := DataFrame loadHousing.
8888
If we print (Ctrl+P) the data frame that was created from an array of rows or columns as described in previous sections, we will see the following table
8989

9090
```
91-
1 2 3
92-
1 'Barcelona' 1.609 true
93-
2 'Dubai' 2.789 true
94-
3 'London' 8.788 false
91+
| 1 2 3
92+
---+-------------------------
93+
1 | Barcelona 1.609 true
94+
2 | Dubai 2.789 true
95+
3 | London 8.788 false
9596
```
9697

9798
As you can see, both row and column names were automatically set to numeric sequences. We can using change them by passing an array of new names. This array must be of the same size as the number of rows and columns.
@@ -104,10 +105,11 @@ df rowNames: #(A B C).
104105
Now if we print our data frame, it will look like this
105106

106107
```
107-
City Population SomeBool
108-
A 'Barcelona' 1.609 true
109-
B 'Dubai' 2.789 true
110-
C 'London' 8.788 false
108+
| City Population SomeBool
109+
---+---------------------------------
110+
A | Barcelona 1.609 true
111+
B | Dubai 2.789 true
112+
C | London 8.788 false
111113
```
112114

113115
To get the dimensions of a data frame, its rows, and columns, we can say
@@ -142,12 +144,13 @@ df tail.
142144
Data frame responds to these messages with another `DataFrame` object containing the requested rows. Here is the example output of the `df head` message
143145

144146
```
145-
RM LSTAT PTRATIO MDEV
146-
1 6.575 4.98 15.3 504000.0
147-
2 6.421 9.14 17.8 453600.0
148-
3 7.185 4.03 17.8 728700.0
149-
4 6.998 2.94 18.7 701400.0
150-
5 7.147 5.33 18.7 760200.0
147+
| RM LSTAT PTRATIO MDEV
148+
---+---------------------------------
149+
1 | 6.575 4.98 15.3 504000.0
150+
2 | 6.421 9.14 17.8 453600.0
151+
3 | 7.185 4.03 17.8 728700.0
152+
4 | 6.998 2.94 18.7 701400.0
153+
5 | 7.147 5.33 18.7 760200.0
151154
```
152155

153156
It is also possible to specify the number of rows that must be printed
@@ -166,9 +169,10 @@ The same messages are also supported by the objects of `DataSeries` class. This
166169
The result will be another series
167170

168171
```
169-
[LSTAT]
170-
1 4.98
171-
2 9.14
172+
| LSTAT
173+
---+-------
174+
1 | 4.98
175+
2 | 9.14
172176
```
173177

174178
### Accessing rows and columns
@@ -189,8 +193,9 @@ df columnAt: 2.
189193
The important feature of a `DataFrame` is that whenever we ask for a specific row or column, it responds with a `DataSeries` object that preserves the same indexing. So, for example, if you take row _'B'_ of a data frame described above, you will get a series named _'B'_ with keys _'City'_, _'Population'_, and _'SomeBool'_.
190194

191195
```
192-
[B]
193-
City Dubai
194-
Population 2.789
195-
SomeBool true
196+
| B
197+
------------+-------
198+
City | Dubai
199+
Population | 2.789
200+
SomeBool | true
196201
```

0 commit comments

Comments
 (0)