turicreate.SFrame.shuffle

SFrame.shuffle()

Randomly shuffles the rows of the SFrame.

Returns:
out : [SFrame]

An SFrame with all the same rows but with the rows in a random order.

Examples

>>> sf = turicreate.SFrame({"nums": [1, 2, 3, 4],
                            "letters": ["a", "b", "c", "d"]})
>>> shuffled_sf = sf.shuffle()
>>> print(shuffled_sf)
+---------+------+
| letters | nums |
+---------+------+
|    d    |  4   |
|    c    |  3   |
|    a    |  1   |
|    b    |  2   |
+---------+------+
[4 rows x 2 columns]