<jupyter_start><jupyter_text>This Dataset was taken online<jupyter_code>import pandas as pd
import numpy as np
dataset = pd.read_csv('url_dataset.csv')
#deleting all columns except url
dataset.drop(dataset.columns.difference(['URL']), 1, inplace=True)
dataset.head(5)
dataset.to_csv('cleaned_link_dataset.csv')
#split protocol from the other part of link
cleaned_dataset = pd.read_csv('cleaned_link_dataset.csv')
protocol = cleaned_dataset['URL'].str.split('://',expand=True)
#renaming columns
protocol.head()
protocol.rename(columns={0: 'protocol'}, inplace= True)
protocol.head()
#dividing domain name from the address of the link and create a new column with it
domain = protocol[1].str.split('/', 1,expand=True)
domain.head()
domain.rename(columns ={0:'domain', 1:'address'}, inplace= True)
domain.head()
protocol.head()
#joining datasets together in one dataframe using pd.concat
full_dataset = pd.concat([protocol['protocol'],domain],axis=1)
full_dataset.head(5)
full_dataset.to_csv('full_cleaned.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1396917148362235, 'fraction_numerical': 0.008670520231213872, 'mean_word_length': 7.880341880341881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '87', 'license': 'MIT', 'n_tokens_mistral': 337, 'n_tokens_neox': 334, 'n_words': 83, 'path': 'Link Dataset Cleaning.ipynb', 'repo_name': 'geridashja/phishing-links-detection', 'size': '1038'}