import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import mpl_toolkits
import numpy as np
import scipy.stats as stats
%matplotlib inline
from sklearn.model_selection import train_test_split
df=pd.read_csv(r"C:\Users\Ismail\Desktop\internet_session.csv")
df
print(df.columns)
df[['usage_time', 'IP', 'MAC']]
IP_frequency = df['IP'].nunique() / df.shape[0]
print(f"Frequency of IP changes: {IP_frequency:.2f}")
device_frequency = df['MAC'].nunique() / df.shape[0]
print(f"Frequency of device changes: {device_frequency:.2f}")
activity_hour = df.groupby(df['usage_time'])['total_transfer'].sum().idxmax()
print(f"Most frequent internet activity time of the day: {activity_hour}:00")
# Average usage per hour
average_usage_per_hour = df.groupby(df['usage_time'])['total_transfer'].mean()
print(f"Average usage per hour: {average_usage_per_hour}")
# Average usage per day
average_usage_per_day = df.groupby(df['usage_time'])['total_transfer'].mean()
print(f"Average usage per day: {average_usage_per_day}")
# Average usage per month
average_usage_per_month = df.groupby(df['usage_time'])['total_transfer'].mean()
print(f"Average usage per month: {average_usage_per_month}")