The population

Predictive Analytics Tingkat Menengah dengan Python

Nele Verbiest Ph. D.

Senior Data Scientist @PythonPredictions

Population requirements

Population should be eligible for being target:

  • Address available
  • Privacy settings
  • ...
Predictive Analytics Tingkat Menengah dengan Python

Timeline compliant population: age (1)

Predictive Analytics Tingkat Menengah dengan Python

Timeline compliant population: age (2)

Predictive Analytics Tingkat Menengah dengan Python

Timeline compliant population: donations (1)

Predictive Analytics Tingkat Menengah dengan Python

Timeline compliant population: donations (2)

Predictive Analytics Tingkat Menengah dengan Python

Timeline compliant population: donations (3)

Predictive Analytics Tingkat Menengah dengan Python

Population in python

donations_2016 = gifts[gifts["date"].dt.year==2016]
donors_include = set(donations_2016["id"])
print(donors_include)
{1002,3043,4934, ...}
donations_2017 = gifts[(gifts["date"].dt.year==2017) 
                       & (gifts["date"].dt.month<5)]
donors_exclude = set(donations_2017["id"])
print(donors_exclude)
{2451,3047,4474, ...}
population = donors_include.difference(donors_exclude)
Predictive Analytics Tingkat Menengah dengan Python

Let's practice!

Predictive Analytics Tingkat Menengah dengan Python

Preparing Video For Download...