The previous article has already captured the data, then analyze it. Here is the simple processing of data with Python, followed by the drawing of Excel, yes,, or Excel. In fact, there are better tools for analyzing these data, such as R ... But for the time being, Excel will live with it.
Here are a total of three aspects: TOP10 Word, the relationship between the amount of time and the number of posts, date and number of postings.
PROJECT1:TOP10 WORD
Note that the top_words.txt here is that I use XLRD to take out the text and save it in Notepad, and get rid of the punctuation (this shameful process does not show ...). Find a better way to rewrite later)
#!/usr/bin/python#-*-coding:utf-8-*-import xlrdimport xlsxwriterfrom Collections Import Counterwith open (' Top_ Words.txt ', encoding= ' Utf-8 ') as f:# print (F.read ()) L = List (F.read ()) print (l) word_dict = Counter (L). Most_common () # Print (word_dict) workbook = Xlsxwriter. Workbook (' top_words.xlsx ') worksheet = Workbook.add_worksheet () worksheet.set_column (' a:a ', ten) Worksheet.set_column (' B:b ') worksheet.write (0,0, ' keywords ') worksheet.write (0,1, ' frequency ') i = 1num = []for k, v in Word_dict:i + = 1worksheet.write (i, 0,k) Worksheet.write (i,1,v) num.append (v) workbook.close () print (num)
The output Excel table is as follows (part):
Simply make a diagram:
Crawler re-exploration (v) ——— crawl app data-Super curriculum "two"--word frequency analysis