def make_users_events_table(event_col_names, all_cols): """event_col_names is a list of all the column names that represent events (these can be alpha or numeric). This function assumes that all_cols has already been sorted, merged, had voided records excluded, etc.""" event_cols = all_cols.select(*event_col_names) rows = iterate_user_events(all_cols.user_id, event_cols) return ColumnGroup.from_rows(["user_id", "event_id", "value"], rows)
def make_events_table(event_headers): """The column names are of the format "Friday Dinner #123123". We want to take all the column names and make a table of event ids and descriptions""" events = [ parse_event_header(header) for header in event_headers if is_event_header(header) ] return ColumnGroup.from_rows(["event_id", "name"], sorted(events))
def make_events_table(event_headers): """The column names are of the format "Friday Dinner #123123". We want to take all the column names and make a table of event ids and descriptions""" events = [parse_event_header(header) for header in event_headers if is_event_header(header)] return ColumnGroup.from_rows(["event_id", "name"], sorted(events))