Question: Create a DataFrame named faculty _ grade _ dist by performing the following steps. Group the records in the grades DataFrame according to fid. Perform
Create a DataFrame named facultygradedist by performing the following steps.
Group the records in the grades DataFrame according to fid.
Perform the following aggregations:
o Count the number of grades that have been issued by each faculty member. Name the
resulting column N
o Use aggregation operations to create columns named countA, countB, countC, countD,
and countF. Each of these columns should contain a count of the number of grades of the
indicated type that have been assigned by each faculty member. This can be accomplished
using the SUM and CASE keywords discussed above.
Use a join to pull in columns from the faculty DataFrame.
Use select to select the following columns: fid, firstname, lastname, dept, and N Use
the same call to select to create five new columns named propA, propB, propC, propD, and
propF. Each of these new propX columns should be calculated by dividing the associated countX
column by N and rounding the results to decimal places.
Display the first records of the facultygradedist DataFrame.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
