首页 > 编程语言 >python获取信息的行号excel

python获取信息的行号excel

时间:2023-02-24 10:37:28浏览次数:46  
标签:__ 获取信息 python demo excel df print indexs

  • python获取行号excel 
import pandas as pd

def finddata():
    demo_df=pd.read_excel(r'C:\Users\Asus\Downloads\网上充值明细20230224093351.xlsx') ##文件路径 
    print(demo_df)
    for indexs in demo_df.index:
        for i in range(len(demo_df.loc[indexs].values)):
            if (demo_df.loc[indexs].values[i] == "31048800000000017531"):
                print('行数:',indexs+4, '列数:',i+1)
                print(demo_df.loc[indexs].values[i])
                #print('行数:',indexs+2)
            # else:
            #     #显示行数
            #     print('没有找到信息')


if __name__ == '__main__':
    finddata()

  •  封装的太好了,读取excel 还没有进程残留
  •  

     

标签:__,获取信息,python,demo,excel,df,print,indexs
From: https://www.cnblogs.com/springcloud/p/17150381.html

相关文章