)
df_deconcat = df[column_name].str.split(sep, expand=True)
else:
df_deconcat = pd.DataFrame(
df[column_name].to_list(), columns=new_column_names, index=df.index
)
if preserve_position:
// Keep a copy of the original dataframe
df_original = df.copy()
if new_column_names is None and autoname is None:
raise ValueError(
"One of `new_column_names` or `autoname` must be supplied."
)
if autoname:
new_column_names = [
f"{autoname}{i}" for i in range(1, df_deconcat.shape[1] + 1)
]
if not len(new_column_names) == df_deconcat.shape[1]:
raise JanitorError(
f"Number of supplied column names was not equal to the number of "
f"deconcatenated columns. You need to provide "