Adding a new column in data frame after calculation on time,"df['period'] = df.apply(period, axis=1)"