Advertisement

Python处理xlsx文件内容

阅读量:

通过八爪鱼工具获取了今日发布的所有上市公司公告标题清单,并将其本地存储为xlsx格式文件。针对公告类别,仅关注“其他”类型的条目。同时,希望通过公告标题内容,排除包含“转债”、“业绩”以及“债券”等关键词的信息。为此,决定采用Python进行后续处理。

复制代码
    import pandas as pd
    
    
    table=pd.read_excel('C:\ Users\ NING MEI\ Desktop\ 沪深京A股公告一览表 _ 数据中心 _ 东方财富网.xlsx', index_col=None)
    
    
    table=table.drop(table[table['公告类型']!='其他'].index,axis=0)
    table=table.drop(table[table['公告标题'].str.contains('转债')].index,axis=0)
    table=table.drop(table[table['公告标题'].str.contains('业绩')].index,axis=0)
    table=table.drop(table[table['公告标题'].str.contains('债券')].index,axis=0)
    print(type(table))
    table.

全部评论 (0)

还没有任何评论哟~