Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
"user_id","mail_id","mail_category","mail_type","sent_time","open_time","click_time","unsubscribe_time","last_online","hacker_created_at","hacker_timezone","clicked","contest_login_count","contest_login_count_1_days","contest_login_count_30_days","contest_login_count_365_days","contest_login_count_7_days","contest_participation_count","contest_participation_count_1_days","contest_participation_count_30_days","contest_participation_count_365_days","contest_participation_count_7_days","forum_comments_count","forum_count","forum_expert_count","forum_questions_count","hacker_confirmation","ipn_count","ipn_count_1_days","ipn_count_30_days","ipn_count_365_days","ipn_count_7_days","ipn_read","ipn_read_1_days","ipn_read_30_days","ipn_read_365_days","ipn_read_7_days","opened","submissions_count","submissions_count_1_days","submissions_count_30_days","submissions_count_365_days","submissions_count_7_days","submissions_count_contest","submissions_count_contest_1_days","submissions_count_contest_30_days","submissions_cou
@caiotaniguchi
caiotaniguchi / submissions_sample_data.csv
Last active February 19, 2017 20:07
HackerRank submissions sample dataset
hacker_id contest_id challenge_id language solved created_at
56d47667c6a9242e c8ff662c97d345d2 6d95afeb4d968b91 java 0 2011-08-07 01:12:00 UTC
56d47667c6a9242e c8ff662c97d345d2 6d95afeb4d968b91 python 0 2011-08-07 10:48:48 UTC
56d47667c6a9242e c8ff662c97d345d2 6d95afeb4d968b91 python 1 2011-08-07 12:49:36 UTC
661657184c3d9218 c8ff662c97d345d2 6d95afeb4d968b91 java 0 2011-08-08 07:24:53 UTC
05d5253080e43d9f c8ff662c97d345d2 a4d04413ee4b0b24 ruby 0 2011-08-08 07:48:11 UTC
4d025499868b7b53 c8ff662c97d345d2 77c995ae877308a5 csharp 1 2011-08-25 09:26:20 UTC
ef8bff0286ecbf0e c8ff662c97d345d2 77c995ae877308a5 python 0 2011-08-27 22:40:27 UTC
ef8bff0286ecbf0e c8ff662c97d345d2 77c995ae877308a5 python 0 2011-08-27 23:05:56 UTC
30de5ed0c6363f94 c8ff662c97d345d2 77c995ae877308a5 cpp 0 2011-08-28 08:06:42 UTC
@caiotaniguchi
caiotaniguchi / chalenges_sample_data.csv
Created February 19, 2017 20:35
HackerRank Challenges dataset
challenge_id contest_id domain subdomain difficulty solved_submission_count total_submissions_count
18e0a2dad5e127d6 c8ff662c97d345d2 Artificial Intelligence Bot Building 0.9782608695652174 319 655
0a29ba3e013657fb c8ff662c97d345d2 Algorithms Dynamic Programming 0.788421297372704 241 457
888304da1c716f8e 2f6c6a2dd757af3e 0.7 1 2
45ebad7a3829ffe2 c8ff662c97d345d2 Data Structures Linked Lists 0.9872489639783233 590 636
43b4c6b6f9de8346 c8ff662c97d345d2 Mathematics Fundamentals 0.9177094147860773 546 1198
feb666a0b4f1d685 c8ff662c97d345d2 Algorithms Implementation 0.9501810813141329 2367 3055
b3868f49ff0b3d19 c8ff662c97d345d2 Artificial Intelligence Natural Language Processing 0.7 1 1
14c694b32b06354f c8ff662c97d345d2 Artificial Intelligence Statistics and Machine Learning 0.0 20 35
43143e7a4c6f90e0 c8ff662c97d345d2 Artificial Intelligence Digital Image Analysis 0.2 0 1
@caiotaniguchi
caiotaniguchi / lollipop_plotly.py
Last active January 18, 2022 16:19
Plotting Lollipop Charts with Plotly
import numpy as np
import plotly.offline as pyo
import plotly.graph_objs as go
# Generate a random signal
np.random.seed(42)
random_signal = np.random.normal(size=100)
# Offset the line length by the marker size to avoid overlapping
marker_offset = 0.04

Case: Estudo de rentabilidade

A planilha em anexo contém dados fictícios de cerca de 5 mil clientes. Nela você vai encontrar dados transacionais de alguns meses, assim como as receitas e custos associados a esse cliente nos respectivos meses. Além disso, também existem informações cadastrais, tais quais a cidade em que ele atua, seu MCC (Merchant Category Code), seu canal de vendas, e quando ele entrou na empresa.

A partir desses dados, faremos um estudo para indicar quais os diferentes perfis de clientes, e listar algumas estratégias que podemos adotar com relação a cada perfil para melhorar a lucratividade da empresa no curto, médio, e longo prazo.

Como uma empresa de receita recorrente, um dos principais indicadores de rentabilidade de um cliente é o tempo esperado que o cliente use o nosso produto. Isso está associado ao Índice de evasão de clientes de um mês para outro, o que chamamos de "Churn".

O Índice de evasão mensal (ou "churn") no mês de novembro, por exemplo, pode ser calculado como: