I have a dataframe which gets da Date from a calendar and extracts some feature out of the date.
def processDate(self,date):
WEEKDAY_MAP = {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7}
df = pandas.DataFrame(data=[date], columns = ['DATE'])
df['DATE'] = pandas.to_datetime(df['DATE'])
df['DATE'] = df['DATE'].astype(str)
df['MONTH'] = pandas.DatetimeIndex(df['DATE']).month
df['WEEKDAY'] = pandas.DatetimeIndex(df['DATE']).dayofweek
df['WEEKDAY'] = df['WEEKDAY'].map(WEEKDAY_MAP)
df['HOLIDAY'] = '0'
set_holiday(df)
df['INTERVALL'] = '1'
df.append([df]*5,ignore_index=True)
print(df)
Console Log:
DATE MONTH WEEKDAY HOLIDAY INTERVALL
2017-09-13 9 3 0 1
What i need: duplicate the entry 48 times and increase the INTERVALL Value.
Outcome should be like this:
Console Log:
DATE MONTH WEEKDAY HOLIDAY INTERVALL
2017-09-13 9 3 0 1
2017-09-13 9 3 0 2
2017-09-13 9 3 0 3
2017-09-13 9 3 0 4
2017-09-13 9 3 0 5
...
2017-09-13 9 3 0 48
I tried df.append([df]*48,ignore_index=True) but that didnt work.