Customized method for dataframe in my analysis module
This if statement

    if ind &lt; 3 :
        transformed_str.append(data_str[ind])
    else:
        transformed_str.append(data_str[ind])
        transformed_str.append(sep_line)


Can be rewritten as

    transformed_str.append(data_str[ind])
    if ind &gt;= 3:
        transformed_str.append(sep_line)