how to get median within SFrame

User 5380 | 7/15/2016, 1:45:02 PM

Hello,

is there any method like mean() to get median and most frequent value of a column in a SFrame?

thanks

Comments

User 5371 | 7/16/2016, 4:31:01 PM

Hi,

You can use sketch_summary() functionality of SArray to achieve this For example:

import graphlab
sa = graphlab.SArray(range(100) + [1, 2,3, 3,3])  # make 3 the most frequent items
sketch = sa.sketch_summary()
print sketch

To access a particular column of SFrame:

sf = ...
sf['column1].sketch_summary()

For more details, refer to the API doc