Data Interview Qs - Average lifetime value of a customer

InterviewQs

Average lifetime value of a customer

Python Product Metrics Pandas Data Analysis External Dataset

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Given the following dataset, calculate the average lifetime value of a customer.

Below are a couple of definitions to help solve the problem:

  • Lifetime value is average revenue divided by the churn rate
  • Churn rate is defined as the total number of churned customers / total number of customers

Additionally, here is code to import the relevant packages as well as the dataset shown above, to help get you started:

    

#Importing packages

import pandas as pd

import numpy as np

#Read in the dataset

data = pd.read_csv("https://raw.githubusercontent.com/erood/interviewqs.com_code_snippets/master/Datasets/teleco_user_data.csv")

#Convert these column types to int

data['TotalCharges'] = pd.to_numeric(data.TotalCharges, downcast='integer', errors='coerce')

data['MonthlyCharges'] = pd.to_numeric(data.MonthlyCharges, downcast='integer', errors='coerce')


Solution will be written in Python for premium users.




 

You’ve accumulated 194 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Office space capacity

Monday, September 27, 2021

SQL, Database Querying, InterviewQs Office space capacity SQL Database Querying Forward this email to a friend or colleague and challenge them to solve it. Hi, You are given a table of office sites

Customer recency

Friday, September 24, 2021

Data Analysis, Python, Pandas, Data Manipulation, External Dataset, InterviewQs Customer recency Data Analysis Python Pandas Data Manipulation External Dataset Forward this email to a friend or

Winning the lottery!

Wednesday, September 22, 2021

Statistics, Probability Theory, InterviewQs Winning the lottery! Statistics Probability Theory Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose you're trying

Predicting missed appointments

Monday, September 20, 2021

Python, Pandas, External Dataset, Machine Learning, Classifers, Decision Tree, Feature Optimization, Feature Engineering, InterviewQs Predicting missed appointments Python Pandas External Dataset

Top Earners

Friday, September 17, 2021

SQL, Database Querying, Rank Function, Window Function, External Dataset, InterviewQs Top Earners SQL Database Querying Rank Function Window Function External Dataset Forward this email to a friend or

You Might Also Like

AI search engine startup Perplexity eyes a $3B valuation

Tuesday, April 23, 2024

Plus: It's Tesla earnings day and AWS wants to host your AI models View this email online in your browser By Cody Corrall Tuesday, April 23, 2024 Welcome back to TechCrunch PM. Today we have big

🎞️ We Tried 3D Printing a Photo — You'll Love This Secret Samsung Galaxy Bluetooth Feature

Tuesday, April 23, 2024

Also: Transferring Your Phone Number to a New Carrier, and More! How-To Geek Logo April 23, 2024 📩 Get expert reviews, the hottest deals, how-to's, breaking news, and more delivered directly to

You're invited – product sense, prioritization, careers

Tuesday, April 23, 2024

Product Sense Product Sense Wednesday, May 1st @ 01:00 PM EST Learn how to identify opportunities, assess risks, and make informed decisions that lead to successful product innovations by better

CTRL-C, Exceptions, Ruff Speed-up, and More

Tuesday, April 23, 2024

Asyncio Handle Control-C (SIGINT) #626 – APRIL 23, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Asyncio Handle Control-C (SIGINT) When the user presses CTRL-C on the keyboard, the OS raises an

Writing Contests Just Landed On Product Hunt 🔥

Tuesday, April 23, 2024

Upvote us to keep the $$$ coming! 👍 ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ ͏ ‌  ͏ ‌  ͏ ‌  ͏ ‌ 

Daily Coding Problem: Problem #1421 [Hard]

Tuesday, April 23, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Uber. Given an array of integers, return a new array such that each element at index i

Ranked | The Top 10 EV Battery Manufacturers 🔋

Tuesday, April 23, 2024

Asia dominates this ranking of the world's largest EV battery manufacturers in 2023. See which battery makers feature in the top 10. View Online | Subscribe Presented by: EnergyX's

Bringing PGO to the build pipeline

Tuesday, April 23, 2024

Plus how Go grew at Google, cmp.Or, and ways to visualize makefiles, Go binaries, and live Go processes. | #​504 — April 23, 2024 Unsub | Web Version Together with Three Dots Labs Go Weekly How Dolt

Noonification: Leetcode: Two-sum an Intuitive Approach

Tuesday, April 23, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech this week: The Noonification by HackerNoon has got you covered with

The best AI chatbot for coding

Tuesday, April 23, 2024

9 video gadget must-haves; 6 things Linux should borrow from MacOS -- ZDNET ZDNET Tech Today - US April 23, 2024 placeholder Can Meta AI code? I tested it against Llama, Gemini and ChatGPT - it wasn