def ds_ratio(group):
    """Returns the fraction of rows that are in 'nix' dataset."""
    nix_count = (group=='nix').sum()
    top_count = (group=='top').sum()
    ratio = nix_count/(nix_count+top_count) #could smooth this
    return ratio