Question: it doesn't work, here's what i have so far Zip_code_Arrests = Arrests_NoBlanks.where('Zipcode', '27514').where('Drugs_or_Alcohol_Present', 'Y').drop('U') Arrest_types_drugs_or_alcohol = Zip_code_Arrests.pivot( 'Drugs_or_Alcohol_Present', Zip_code_Arrests.column('Type_of_Arrest'), values = 'Age', collect = np.mean

it doesn't work, here's what i have so far Zip_code_Arrests = Arrests_NoBlanks.where('Zipcode', '27514').where('Drugs_or_Alcohol_Present', 'Y').drop('U') Arrest_types_drugs_or_alcohol = Zip_code_Arrests.pivot( 'Drugs_or_Alcohol_Present', Zip_code_Arrests.column('Type_of_Arrest'), values = 'Age', collect = np.mean ) #np.mean(Zip_code_Arrests.group( Arrest_types_drugs_or_alcohol

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock