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
def split_dataframe_rows(df,column_selectors, row_delimiter): | |
# we need to keep track of the ordering of the columns | |
def _split_list_to_rows(row,row_accumulator,column_selector,row_delimiter): | |
split_rows = {} | |
max_split = 0 | |
for column_selector in column_selectors: | |
split_row = row[column_selector].split(row_delimiter) | |
split_rows[column_selector] = split_row | |
if len(split_row) > max_split: | |
max_split = len(split_row) |