在 Spyder (Python 3.9.7) 中更改列名称并查找平均值和标准差
我正在做一个课堂项目,你们都非常有帮助!
无论如何,我使用了这段代码:
SO21= BI21[BI21["OnHand"].eq(0)].groupby("BrandID")["InventoryDate"].nunique()
它生成了这个系列(请告诉我,我仍在学习如何最好地在此处输入我的信息供您查看):
然后我想查找总和、平均值、标准差和标准误差,并使用了我们在课堂上学到的代码:
SOSummary19 = SO19["InventoryDate"].agg(["sum","mean","std","sem"])
它返回一个 KeyError:“InventoryDate”
My目标是根据我发布的图像中“InventoryDate”列中的数字进行这些测量,我还想将“InventoryDate”重命名为“DaysStockedOut”,
提前感谢您你们的帮助,你们都太棒了!
I'm working on a project for class, and y'all have been so incredibly helpful!
Anyways, I used this code:
SO21= BI21[BI21["OnHand"].eq(0)].groupby("BrandID")["InventoryDate"].nunique()
And it generated this series (please bare with me I'm still learning how to best input my information here for you to see):
I then wanted to find the sum, mean, standard deviation, and standard error and used this code that we learned in class:
SOSummary19 = SO19["InventoryDate"].agg(["sum","mean","std","sem"])
It returns a KeyError: "InventoryDate'
My goal is to take those measurements based on the numbers in the 'InventoryDate' Column from the image I posted, and I would also like to rename 'InventoryDate' to 'DaysStockedOut'
Thank you in advance for your help, you are ALL amazing!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SOSummary19= SO19.agg(["sum","mean","std","sem"]) 是修复
SOSummary19= SO19.agg(["sum","mean","std","sem"]) Was the fix