对上市公司公告关键词数据分析

29 篇文章 0 订阅
7 篇文章 2 订阅

前文已经全部爬取上市公司公告,https://blog.csdn.net/qq_37195257/article/details/85015987

 

# coding: utf-8
#coded by 伊玛目的门徒

from pylab import mpl

mpl.rcParams['font.sans-serif'] = ['SimHei']



import jieba
txt= open('test.txt','r').read()

words = jieba.lcut(txt)     # 使用精确模式对文本进行分词

counts = {}

for word in words:
    if len(word) == 1:    # 单个词语不计算在内
        continue
    else:
        counts[word] = counts.get(word, 0) + 1    # 遍历所有词语,每出现一次其对应的值加 1



print (counts)





items = list(counts.items())
print (items)
items.sort(key=lambda x: x[1], reverse=True)    # 根据词语出现的次数进行从大到小排序        # .


word_list=[]
count_list=[]

for i in range(0,20):
    word, count = items[i]
    word_list.append(word)
    count_list.append(count)
    print("{0:<5}{1:>5}".format(word, count))



import matplotlib.pyplot as plt


plt.bar(range(len(count_list)), count_list)

plt.xlabel(word_list)


plt.show()

 

频率最高词排序:

关于    4527
公告    4356
股份    2155
2018  1628
会议    1353
独立    1316
公司    1275
临时    1156
董事会   1076
意见    1006
决议     953
有限公司   942
董事     934
股东大会   778
股东     725
事项     617
资金     602
科技     573
部分     558
交易     510

 

图:

 

另外说一下,报告度最高的个股是 云南白药

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值