I am creating a function which argument is a dataframe. Problem is that dataframes used by this function has different lengths, and I need my dataframe to have specific length in order my code to work.
To be specific, I need my dataframe to have 84 columns, and sometimes I have less columns (having more than needed 84 columns is not an issue). So in order my code to work I neeed to add columns filled with 0.
My column names are numbers starting from 0. I came up with this code:
df.insert(len(df.columns), len(df.columns)-1, 0)
but I am not sure how to put it into a loop to get dataframe which always has 84 columns?
Thank you.