Analyze customer behavior and content by using the datasets started_streams.csv and whatson.csv files
Download the datasets(Assignment_Cuelebre.zip) and unzip to your local folder.
script customer_behavior_content.py holds 3 functions
-
To find the broadcast rights for a title to be able to expose it to the analytics team for further analysis. This should be for Product Types: TVOD and EST. Matching on most recent date for whatson data and joining based on the house_number and country.
-
sales_rental_broadcast_rights uses two datasets started_streams.csv ans whatson.csv files as arguments.
-
df_country is a new table/dataframe created, to map country with country code in both the input files.
-
Know how many watches a product is getting and how many unique users are watching the content, in what device, country and what product_type.
-
product_user_count uses started_streams.csv dataset as one argument.
-
product_watches dataframe contains number of watches a prouct is getting based on date,program title,device_name,country_code.
-
unique_user_count dataframe contains number of unique user watching based on date,program title,device_name,country_code.
-
List the most popular Genre and what hours people watch.
-
Added new column in start_stream dataframe containing at what hour(Time) of the day people watch.
When executing the function, the script will prompt to enter the path to the folder. Provide the path until the file name. Ex : c:\assignmnets\
Note:Do not include the filenames, as it is part of the code.