I have created the following code which counts the amount of times a person (by their login_id) has logged into a program over a period of a year.
data1.query("'2015-12-01' <= login_date <= '2016-12-01'").groupby(['employer_key','account_id']).size().reset_index().groupby(['employer_key','account_id'])[[0]].count()
The output looks something like this:
employer_key account_id # times logged in
Apple X1 1
Google Y5 2
Facebook X3 4
Apple X2 2
Facebook Y2 1
I would like to count the number of account_ids for each separate employer_key, so that I can determine how many accounts logged in for each individual employer over a period of a year.
The output would hopefully look something like this:
employer_key user_logins
Apple 2
Google 1
Facebook 2
account_idin that column, so it may be a moot point.