How to reshape dataframe with wide_to_long or pivot?
问题 This should be fairly simple but have not been able to wrap my brain around it. I am trying to convert df1 to df2, where df1 and df2 are pandas dataframes df1 = pd.DataFrame({'site': ['1', '2'], 'sat_open': ['0900', '0900'], 'sat_close': ['1900','1900'], 'sun_open': ['1000', '1000'], 'sun_close': ['1800', '1800'], 'mon_open': ['0900', '0900'], 'mon_close': ['2100', '2100'] }) df2 = pd.DataFrame({'store': ['1', '1', '1', '2', '2','2'], 'day': ['sat', 'sun', 'mon','sat', 'sun', 'mon'], 'open':