Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I am having trouble with the first part of this question below: I know how to plot the heatmap, I just don't know how

Hi, I am having trouble with the first part of this question below:

image text in transcribed

I know how to plot the heatmap, I just don't know how to create a new df for violators that obtained 3 business licenses or more under the same dba name.

Here is how I created the original data frame:

image text in transcribed

Any help on how to create a new df to filter for these results would be greatly appreciated!

Plot on the Heatmap those frequent violators who have obtained 3 business licenses or more under the same DBA Name through out the liftime of their business. You can answer this question from data already queried or you can do a new Elasticsearch query. In [153]: df1 = df_top_frequent_violators.groupby('DBA Name') In [154]: violations_count =df1[ [Inspection ID'].,count () licenses_count =df1[ 'License # ].nunique( ) In [156]: df_final = pd.DataFrame( { 'Violations': violations_count, 'Licenses \#': licenses_count }) In [157]: df_final.head(10) Out [157] : Violations Licenses DBA Name \begin{tabular}{rll} \hline A CHILD'S WORLD EARLY LEARNING CENTER & 7 & 2 \\ ADA S MCKINLEY MAGGIE DRUMMON & 5 & 2 \\ AMAZING GRACE DAYCARE CENTER & 7 & 2 \\ ANGELS & 5 & 2 \\ BOTTLES TO BOOKS LEARNING CENTER & 8 & 2 \\ BUSY BUMBLE BEE ACADEMY DAYCARE & 9 & 3 \\ COMMONWEALTH DAYCARE CENTER & 6 & 1 \\ DISCOVERY LEARNING ACADEMY, INC. & 6 & 2 \\ EARLY CHILDHOOD EDUCARE CENTER & 6 & 3 \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

Students also viewed these Databases questions