I have a dataframe that looks like below. I want to build a data profile by getting the following counts.
1) count of unique student IDs(Number of students) My Answer works:
print(len(df['Student ID'].unique()))
2)count of unique student IDs where International=N (Number of Non international students)
My answer does not work: print(len(df1.loc[(df1['Student ID'].unique())['International Student'] == N]))
3)count of unique student IDs where International=N & ATAR is not null(number of non-international students who has an ATAR)
4) count of unique student IDs where ATAR is between 0-50
some other questions:
5) how can I create a new dataframe with only unique Student IDs with all other columns, dropping all rows per student ID after the first
answers to questions 2-5 would be much appreciated.
Student_ID International marks ATAR
119 N 60 80
119 N 70 80
119 N 75 80
129 Y 78 75
129 Y 60 75
155 Y 85
155 Y 80