This is the dataframe I am working with,
data = pd.DataFrame({'id':[1,2,3], 'start date': ['2001-11-13', '2002-6-26', '2004-2-22'], 'end date': ['2002-6-25', '2004-2-21', '2006-8-21'], 'values':[1000,2000,3000]}) I am trying to stack only the date columns, start date and end date, while leaving the id and values columns unstacked. The final dataframe would look like this,
data = pd.DataFrame({'id':[1,1,2,2,3,3], 'date': ['2001-11-13', '2002-6-26','2004-2-22','2002-6-25','2004-2-21', '2006-8-21'], 'values':[1000,1000,2000,2000,3000,3000]})