Assignment 1
Assignment 1
Code
# Import the pandas library
import pandas as pd
print("Number of rows:",df.shape[0])
print("Number of columns:",df.shape[1])
print("-" * 40)
print("Data types:")
print(datatypes)
print("-" * 40)
print("-" * 40)
print("-" * 40)
print("-" * 40)
print("-" * 40)
try:
# Load the CSV file into a DataFrame
df=pd.read_csv("E:\phone_usage_india_dirty.csv")
print("-" * 40)
Output
df=pd.read_csv("E:\phone_usage_india_dirty.csv")
----------------------------------------
Number of rows: 53058
Number of columns: 19
----------------------------------------
Data types:
User ID object
Age float64
Gender object
Location object
Phone Brand object
OS object
Screen Time (hrs/day) float64
Data Usage (GB/month) float64
Calls Duration (mins/day) float64
Number of Apps Installed float64
Social Media Time (hrs/day) float64
E-commerce Spend (INR/month) float64
Streaming Time (hrs/day) float64
Gaming Time (hrs/day) float64
Monthly Recharge Cost (INR) float64
Primary Use object
Timestamp object
Customer_Satisfaction int64
Customer_Lifetime_Value float64
dtype: object
----------------------------------------
Continue_features:
Customer_Satisfaction
----------------------------------------
Dataset size (Number of rows): 53058
----------------------------------------
Null values in the dataset
User ID 5452
Age 5048
Gender 5335
Location 5247
Phone Brand 5303
OS 5353
Screen Time (hrs/day) 4822
Data Usage (GB/month) 4997
Calls Duration (mins/day) 5238
Number of Apps Installed 5456
Social Media Time (hrs/day) 5292
E-commerce Spend (INR/month) 5018
Streaming Time (hrs/day) 5334
Gaming Time (hrs/day) 5245
Monthly Recharge Cost (INR) 5270
Primary Use 5289
Timestamp 0
Customer_Satisfaction 0
Customer_Lifetime_Value 5018
dtype: int64
----------------------------------------
Feature Unique Categories
User ID 17665
Age. 47
Gende 3
Location 10
Phone Brand 10
OS 2
Screen Time (hrs/day) 112
Data Usage (GB/month) 492
Calls Duration (mins/day) 2945
Number of Apps Installed 191
Social Media Time (hrs/day) 56
E-commerce Spend (INR/month) 8195
Streaming Time (hrs/day) 76
Gaming Time (hrs/day) 51
Monthly Recharge Cost (INR) 1901
Primary Use 5
Timestamp 53058
Customer_Satisfaction 5
Customer_Lifetime_Value 48040
----------------------------------------
enter the starting range value:100
Enter the ending range value:2000
User ID Age Gender Location Phone Brand ... Monthly Recharge Cost (INR) Primary Use Timestamp Customer_Satisfaction
Customer_Lifetime_Value
100 U00101 31.0 Female Pune Apple ... NaN Education 2023-01-05 04:00:00 2 168606.410928
101 U00102 39.0 Male Pune Apple ... NaN Social Media 2023-01-05 05:00:00 4 64562.179611
102 U00103 15.0 NaN Mumbai Realme ... 687.0 Work 2023-01-05 06:00:00 0 136436.260992
103 U00104 21.0 Male NaN Apple ... 1129.0 Entertainment 2023-01-05 07:00:00 0 86387.988358
104 U00105 56.0 NaN NaN Motorola ... 1037.0 Entertainment 2023-01-05 08:00:00 1 91850.388545
... ... ... ... ... ... ... ... ... ... ... ...
1995 U01996 28.0 Other Bangalore Google Pixel ... 547.0 Entertainment 2023-03-25 03:00:00 2
108289.398497
1996 U01997 57.0 Male NaN Motorola ... 900.0 Work 2023-03-25 04:00:00 3 89147.220506
1997 U01998 23.0 NaN Ahmedabad OnePlus ... 509.0 Entertainment 2023-03-25 05:00:00 2
374678.862645
1998 U01999 25.0 Male Pune NaN ... 138.0 Gaming 2023-03-25 06:00:00 1 129811.377124
1999 U02000 35.0 Female Kolkata Vivo ... NaN Gaming 2023-03-25 07:00:00 1 142723.216312