Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array = pd.DataFrame(np.object, index=[], columns=[])
- array = array.append({'Project': b.name, 'Summary': card.name,
- 'Key': card.id, 'Assignee': m, 'Points': s},
- ignore_index=True)
- array1 = pd.read_excel('ProjectCostUCP.xlsx', 'Лист1')
- result = array[['Project', 'Assignee', 'Points']].groupby(['Project',
- 'Assignee']).sum(axis=1)
- print(result.columns.tolist())
- result = result.merge(array1, on=['Project'])
- result['Value'] = result.Points * result.Price
- writer = pd.ExcelWriter('third.xlsx')
- array.to_excel(writer, "June")
- result.to_excel(writer, "June_agregation")
- writer.save()
- Project Assignee Price Points Value
- srnd-demo Serhii 5,5 23 126,5
- result = array[['Project', 'Assignee','Points']].groupby(['Project',
- 'Assignee']).sum(axis=1)
- Points
- Project Assignee
- srnd-demo Serhii 23
- Project Price
- srnd-demo 5.5
- result.reset_index().merge(array1)
- Project Assignee Price_x Points Price_y
- 0 srnd-demo Serhii 5.5 23.0 5.5
- In [245]: result
- Out[245]:
- Points
- Project Assignee
- srnd-demo Serhii 23
- In [246]: array1
- Out[246]:
- Project Price
- 0 srnd-demo 5.5
- In [247]: result.reset_index().merge(array1)
- Out[247]:
- Project Assignee Points Price
- 0 srnd-demo Serhii 23 5.5
- In [259]: result
- Out[259]:
- Points Price
- Project Assignee
- srnd-demo Serhii 23 5.5
- In [260]: array1
- Out[260]:
- Project Price
- 0 srnd-demo 5.5
- In [257]: result.reset_index().merge(array1, on='Project')
- Out[257]:
- Project Assignee Points Price_x Price_y
- 0 srnd-demo Serhii 23 5.5 5.5
- In [258]: result.reset_index().merge(array1.drop(['Price'], axis=1), on='Project')
- Out[258]:
- Project Assignee Points Price
- 0 srnd-demo Serhii 23 5.5
Add Comment
Please, Sign In to add comment