熊猫dataframe返回行,状态,城市和日期多次发生
首先,这是我的第一篇文章,所以如果格式差,我很抱歉。
因此,我拥有了我已附加图片的数据框架。它包含不明飞行物的目击事件,我想返回行if城市和状态相同的行,然后如果日期相同。我试图发现在同一城市和州同一天发生的目击事件。如果需要更多信息,请让我知道。 先感谢您!
Firstly, this is my first post, so my apologies if it is formatted poorly.
So I have this dataframe which I have attached a picture of. It contains UFO sightings and I want to return the rows where the if the city and state are the same and then also if the dates are the same. I am trying to find sightings that occurred on the same day in the same city and state. Please let me know if more info is required.
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
替代方案,布尔索引以保持 行:
如果您不想要新列:
Alternative, boolean indexing to keep the
duplicated
rows:If you don't want the new column:
尝试一下。
Try this.