搜索和选择python pandas的小区周围的区域
我最近一直在使用熊猫来工作,我是新手。我有一个数据框架,我想搜索整个数据框架上的特定字符串,然后在其右侧和左侧选择 n 单元格。我该怎么做?
I have been using pandas for work lately and I am fairly new to it. I have a data frame and I wanted to search the whole data frame for a specific string and then select the n cells to the right and to the left of it. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设此虚拟输入,我们将寻找
0
作为目标,n = 2
在左/右的值:处理:输出:
输出:
Assuming this dummy input, we'll be looking for
0
as target withn=2
values on the left/right:processing:
output: