Skip to content

Instantly share code, notes, and snippets.



Last active Dec 2, 2015
What would you like to do?
dplyr group_by() example
import datascience as ds
values = temp = ds.Table.read_table("")
def collapsed(an_array):
return an_array[-1] < 0.1*max(an_array)['assessid', 'ssb']).group('assessid', collapsed)
values <- read.csv("")
collapsed <- function(x)
x[length(x)] < 0.1 * max(x, na.rm=TRUE)
values %>% group_by(assessid) %>% summarise(collapsed(ssb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment