<jupyter_start><jupyter_text>Lab 7  1) Company: LeidosDecription: Entry Level Intelligence Analyst [website](https://careers.leidos.com/jobs/3674591-intelligence-analyst?tm_job=R-00007987&tm_event=view&tm_company=2502&bid=32)  2)<jupyter_code>from collections import Counter

with open('job.txt', 'r') as job:
    job_list = job.read().split()
    
    count_result = Counter(job_list)
    
    for word, count in count_result.most_common(20):
        print(word, count)<jupyter_output>- 9
and 8
Must 6
in 5
to 4
have 4
an 3
for 3
language 3
Experience 3
using 3
Indeed 3
at 2
Arabic 2
as 2
data 2
reports 2
Qualifications 2
be 2
a 2<jupyter_text>3)<jupyter_code>import xlwt
from collections import Counter

book = xlwt.Workbook()
sheet = book.add_sheet('word_count')
i = 0
sheet.write(0, 0, 'word')
sheet.write(0, 1, 'count')

with open('job.txt', 'r') as job:
    job_list = job.read().split()
    count_result = Counter(job_list)
    
    for result in count_result.most_common(20):
        i += 1
        sheet.write(i, 0, result[0])
        sheet.write(i, 1, result[1])
            
        
book.save('realjobs.xls')<jupyter_output><empty_output><jupyter_text>4)<jupyter_code>import xlrd

book = xlrd.open_workbook('realjobs.xls')
sheet = book.sheet_by_name('word_count')
num_record = sheet.nrows

for i in range(num_record):
    row = sheet.row_values(i)
    word, count = row
    print(word, count)<jupyter_output>word count
- 9.0
and 8.0
Must 6.0
in 5.0
to 4.0
have 4.0
an 3.0
for 3.0
language 3.0
Experience 3.0
using 3.0
Indeed 3.0
at 2.0
Arabic 2.0
as 2.0
data 2.0
reports 2.0
Qualifications 2.0
be 2.0
a 2.0
{'fraction_non_alphanumeric': 0.12098765432098765, 'fraction_numerical': 0.06172839506172839, 'mean_word_length': 3.7122093023255816, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '10148', 'license': 'MIT', 'n_tokens_mistral': 725, 'n_tokens_neox': 641, 'n_words': 166, 'path': 'lab7.ipynb', 'repo_name': 'owainscholbe/ia241', 'size': '1620'}