May-09-2019, 09:53 PM
Thank you. This is working. But the columns are not appending to the original dataframe, as I can't add dataframe2 = dataframe.assign(month='').
So how can I append the new columns to the original dataframe and create a new copy?
So how can I append the new columns to the original dataframe and create a new copy?
def add_column_missing(dataframe): from calendar import month_name for month in month_name: if month not in list(dataframe): dataframe.assign(month='')