This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
def crosstab(rows, columns, col_idx_for_columns, lst_col_idx_for_rows, value_col_idx, fill_val, format_func=None): | |
"""Take col_idx_to_cross_tab and make its unique values be new columns at the end filled with | |
value_col_idx values. col idx arguments are 0 based. | |
This is basically a simplified pivot table creator with the limitations that you can only have one field in the columns | |
and there is no aggregation. | |