I'm trying to add x number of blank columns to a dataframe.
Here is my function:
def fill_with_bars(df, number=10):
'''
Add blank, empty columns to dataframe, at position 0
'''
numofcols = len(df.columns)
while numofcols < number:
whitespace = ''
df.insert(0, whitespace, whitespace, allow_duplicates=True)
whitespace += whitespace
return df
but I get this error
ValueError: Wrong number of items passed 2, placement implies 1
I'm not sure what I'm doing wrong?
Try this: