<jupyter_start><jupyter_text>Group Members: <NAME>, <NAME>, <NAME>Current Hypothesis:Currently we are trying to narrow down the number of suspicious employees by looking at their email activity, checking if attachments were sent out, and if several emails were sent to addresses outside of dtaa.com. From there we would look at what devices they have connected to, and which websites they visit, and logon times. We will also look into unusual logon times that are far outside the normal 8-5 work day. We also want to filter out any commonly visited websites and associate those websites with who has logged visited them and from what computer.<jupyter_code>import pandas
import numpy
devices = pandas.read_csv('device_info.csv') 
emails = pandas.read_csv('email_info.csv')
employees = pandas.read_csv('employee_info.csv') 
websites = pandas.read_csv('http_info.csv')
logons = pandas.read_csv('logon_info.csv')
devices
emails
employees
websites
logons
emailwAttachments =  emails.loc[emails['attachments'] !=0 ]
emailwAttachments
#create table of emails sent to outside email address
#split on ; and split on @ and look for not dtaa.com
table = emails.iloc[:,1:]
table
table.to = table.to.apply(lambda t: t.replace(';', ' '))

def emailFilter(email):
    if "@dtaa.com" not in email:
        return email   
table.to = table.to.apply(lambda t: emailFilter(t))
table = table[table.to.notnull()]
table
table2 = table.groupby('from').to.aggregate(" ".join).reset_index()
table2
table3 = table2
table3.to = table3.to.apply(lambda t: t.split(' '))
table3
table3['number'] = table3.to.apply(lambda t: len(t))
table3
table3 = table3[table3.number > 50]
table3
suspects = ['<EMAIL>', '<EMAIL>', 'Car<EMAIL>', '<EMAIL>'
           '<EMAIL>', '<EMAIL>']
table4 = table.set_index("from", drop = False)
table4
suspect1 = table4.loc["Levi.<EMAIL>", :]
suspect1
len(suspect1)
suspect2 = table4.loc["<EMAIL>", :]
suspect2
len(suspect2)
suspect3 = table4.loc["Carson.<EMAIL>", :]
suspect3
len(suspect3)
suspect4 = table4.loc["<EMAIL>", :]
suspect4
suspect5 = table4.loc["<EMAIL>", :]
suspect5
suspect6 = table4.loc["<EMAIL>", :]
suspect6
suspect7 = table4.loc["<EMAIL>", :]
suspect7
suspect8 = table4.loc["Lucian.Rajah.<EMAIL>", :]
suspect8
suspect9 = table4.loc["Denise.<EMAIL>", :]
suspect9
data = emails.iloc[:,2:4]
def emailFilterPlus(email):
    if "@dtaa.com" in email:
        return email   
data.to = data.to.apply(lambda t: emailFilterPlus(t))
data = data[data.to.notnull()]
data
data1 = data.set_index("from", drop = False)
#emails from cedric in company
suspect1data = data1.loc["<EMAIL>", :]
g = suspect1data.groupby('to').aggregate(" ".join).reset_index()
g.to = g.to.apply(lambda t: t.split(';'))
cchToList = g.to.tolist()
cchToList = [p for e in cchToList for p in e]
cchList = pandas.DataFrame({'people':cchToList})
group1 = cchList.groupby('people').count().reset_index()
group1.people = group1.people.apply(lambda t: emailFilterPlus(t))
group1 = group1[group1.people.notnull()]
group1
#emails from sade in company
suspect2data = data1.loc["<EMAIL>", :]
gr = suspect2data.groupby('to').aggregate(" ".join).reset_index()
gr.to = gr.to.apply(lambda t: t.split(';'))
slcToList = gr.to.tolist()
slcToList = [p for e in slcToList for p in e]
slcList = pandas.DataFrame({'people':slcToList})
group2 = slcList.groupby('people').count().reset_index()
group2.people = group2.people.apply(lambda t: emailFilterPlus(t))
group2 = group2[group2.people.notnull()]
group2
#cedric is on this list
#emails from cyrus in company
suspect3data = data1.loc["<EMAIL>", :]
gro = suspect3data.groupby('to').aggregate(" ".join).reset_index()
gro.to = gro.to.apply(lambda t: t.split(';'))
cjpToList = gro.to.tolist()
cjpToList = [p for e in cjpToList for p in e]
cjpList = pandas.DataFrame({'people':cjpToList})
group3 = cjpList.groupby('people').count().reset_index()
group3.people = group3.people.apply(lambda t: emailFilterPlus(t))
group3 = group3[group3.people.notnull()]
group3
#emails from hector in company
suspect4data = data1.loc["H<EMAIL>.Martin.<EMAIL>", :]
grou = suspect4data.groupby('to').aggregate(" ".join).reset_index()
grou.to = grou.to.apply(lambda t: t.split(';'))
hmdToList = grou.to.tolist()
hmdToList = [p for e in hmdToList for p in e]
hmdList = pandas.DataFrame({'people':hmdToList})
group4 = hmdList.groupby('people').count().reset_index()
group4.people = group4.people.apply(lambda t: emailFilterPlus(t))
group4 = group4[group4.people.notnull()]
group4
#emails from daquan in company
suspect5data = data1.loc["<EMAIL>", :]
group = suspect5data.groupby('to').aggregate(" ".join).reset_index()
group.to = group.to.apply(lambda t: t.split(';'))
dwgToList = group.to.tolist()
dwgToList = [p for e in dwgToList for p in e]
dwgList = pandas.DataFrame({'people':dwgToList})
group5 = dwgList.groupby('people').count().reset_index()
group5.people = group5.people.apply(lambda t: emailFilterPlus(t))
group5 = group5[group5.people.notnull()]
group5<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1563380281690141, 'fraction_numerical': 0.02112676056338028, 'mean_word_length': 5.6546184738955825, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '93803', 'license': 'MIT', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1793, 'n_words': 438, 'path': 'katbird_TermProject.ipynb', 'repo_name': 'joseph97git/cmda-3654-project', 'size': '5343'}