我有一张Excel表格
participantData.xlsx
email Name Date RegPushupCount EasyPushupCount DifficultPushupCount
a@b.com John 2020-05-01 5 0 0
a@b.com John 2020-05-01 5 0 0
a@b.com John 2020-05-02 0 5 0
a@b.com Jane 2020-05-02 5 0 0
a@b.com Jane 2020-05-01 0 0 5
b@a.com Bill 2020-05-01 0 0 5
b@a.com Bill 2020-05-02 0 5 0
我想给每封邮件发一封邮件,总结他们做了多少俯卧撑。我有一个功能发送电子邮件(电子邮件地址,电子邮件文本),这将照顾电子邮件部分
我想发送这样的电子邮件
发送电子邮件至:a@b.com
John Regular Push ups Easy Push ups Difficult Pushups
2020-05-01 10 0 0
2020-05-02 0 5 0
Jane Regular Push ups Easy Push ups Difficult Pushups
2020-05-01 5 0 0
2020-05-02 0 5 0
发送电子邮件至:b@a.com
Bill Regular Push ups Easy Push ups Difficult Pushups
2020-05-01 10 0 0
2020-05-02 0 5 0
我希望这能解释清楚
我已经走了多远:
participantsData = pd.DataFrame(
... pushupCountXLS.groupby(['Email', 'Name', 'Date'] ).sum().astype(int))
请您指导我如何从数据框中提取每个电子邮件地址的数据,并向他们发送有关他们所做俯卧撑的电子邮件
以防万一,如果你想知道,一群美国朋友正在进行100天俯卧撑挑战,我们在谷歌表单中输入这些数据,这就像从谷歌表单发送给他们的确认电子邮件:)
下面是我如何解决这个问题的,如果你有任何优化的想法,请不要犹豫发表评论。非常感谢。感谢@Mayank Porwal的帮助
将^{} 与^{} 一起使用:
OP评论后:
您可以像这样获取
a@b.com
的所有记录:你可以得到你的所有记录b@a.com像这样:
相关问题 更多 >
编程相关推荐