I need to transform df1 to df2:
import pandas as pd
from pandas import DataFrame, Series
import numpy as np
df1 = pd.DataFrame(index=['date_1', 'date_2', 'date_3'],
columns=["A_count", "A_dollar", "B_count", "B_dollar"],
data=[[10,"$100",7,"$786"], [3,"$43",6,"$88"], [5,"$565",8,"$876"]])
df1
Basically what I need is put the items (A and B) as labels in a new column, then move the 3rd and 4th columns data each row under A items. That will give us a new row for each date.