type of data_frame There are 85 something columns and 800+ rows data frame look like this
for eg jan-1 jan-30 feb-1 feb-28 march-1 march-30
party Debit Credit Debit Credit Debit Credit xyz 0 0 100 200 10 10
What I am trying to do
Credit and debit is for each month for e.g jan1 - jan30 what i want is i want to make new dataframe which will have credit - debit for each month for each party for eg for jan month credit - debit for party xyz and feb month etc
I tried to throw iterrows but was unable to do it
data_set = {
"Party": [],
"Month": [],
"Total": []
}
Name of dataFrame is new_data_set
for ind, row in new_data_set.iterrows():
data_set["Particulars"].append(ind)
data_set["Month"].append("")
data_set["Total"].append(row["Debit"] - row["Credit"])
not getting desired output