I've been baffled on how to select a specific row within a SFrame array. I'm able to select the first row here:
sf
+-------------------------------+
| X1 |
+-------------------------------+
| [0.0, 0.0, 0.0, 0.0, 0.0, ... |
[100 rows x 1 columns]
sf[:1]
+-------------------------------+
| X1 |
+-------------------------------+
| [0.0, 0.0, 0.0, 0.0, 0.0, ... |
[1 rows x 1 columns]
sf[:2]
+-------------------------------+
| X1 |
+-------------------------------+
| [0.0, 0.0, 0.0, 0.0, 0.0, ... |
| [0.0, 0.0, 0.0, 0.0, 0.0, ... |
[2 rows x 1 columns]
type(sf[:1])
graphlab.data_structures.sframe.SFrame
Here I tried to get just row 2
sf[:,2]
# TypeError: Invalid key type: must be str, bytes or type
How could I select any row in the dataframe?