def append(dfs, like): """ Concat multiple dataframes :param dfs: List of Dataframes :param like: concat as columns or rows :return: """ return append(dfs, like)
def append(cols_values=None): """ Append a column or a Dataframe to a Dataframe :param cols_values: New Column Names and data values :type cols_values: List of tuples :return: """ df_result = None # Append a dataframe if is_list_of_dataframes(cols_values): dfs = cols_values dfs.insert(0, self) df_result = append(dfs, like="columns") elif is_list_of_tuples(cols_values): df_result = self for c in cols_values: col_name = c[0] value = c[1] df_result = df_result.cols.append(col_name, value) return df_result