title: How do I use booleans to create dataframe and plot the filtered data on pie chart?
body: <pre><code>import pandas as pd
  import numpy as np
  
  
  data = {'City': ['KUMASI', 'ACCRA', 'ACCRA', 'ACCRA', 'KUMASI', 'ACCRA', 'ACCRA', 'ACCRA', 'ACCRA'], 'Building': ['Commercial', 'Commercial', 'Industrial', 'Commercial', 'Industrial', 'Commercial', 'Commercial', 'Commercial', 'Commercial'], 'LPL': ['NC', 'C', 'C', 'C', 'NC', 'C', 'NC', 'NC', 'NC'], 'Lgfd': ['NC', 'C', 'C', 'C', 'NC', 'C', 'NC', 'NC', 'C'], 'Location': ['NC', 'C', 'C', 'C', 'NC', 'C', 'C', 'NC', 'NC'], 'Hazard': ['NC', 'C', 'C', 'C', 'NC', 'C', 'C', 'NC', 'NC'], 'Inspection': ['NC', np.nan, np.nan, np.nan, 'NC', 'NC', 'C', 'C', 'C'], 'Name': ['Zonal', 'In Prog', 'Tullow Oil', 'XGI', 'Food Factory', 'MOH', 'EV', 'CSD', 'Electroland'], 'Air Termination System': ['Vertical Air Termination', 'Vertical Air Termination', 'Vertical Air Termination', 'Early Streamer Emission', 'Vertical Air Termination', 'Vertical Air Termination', 'Vertical Air Termination', 'Vertical Air Termination', 'Early Streamer Emission'], 'Positioned Using': ['Highest Points', 'Software', 'Software', 'Software', 'Highest Points', np.nan, np.nan, 'Rolling Sphere Method', 'Software']}
  df = pd.DataFrame(data)
  
  #Filter dataset to return rows with LPL being &quot;C&quot; and Hazard being &quot;C&quot;
  filter = df[(df[&quot;LPL&quot;] == &quot;C&quot;) &amp; (df[&quot;Hazard&quot;] == &quot;C&quot;)]
  
  #Show number of rows in filter
  print(filtered_1[&quot;LPL&quot;].value_counts())
  print(filtered_1[&quot;Hazard&quot;].value_counts())
  </code></pre>
  <p>Now what I want to do is to plot a pie chart with two labels.<br />
  One label will be <code>LPL and Hazard being C</code> and another label will be <code>LPL and Hazard not being C</code>.</p>
  <p>Essentially, what I mean is, the percentage of <code>LPL and Hazard being C</code> with respect to the total number of rows will be displayed on the chart and the same for <code>LPL and Hazard not being C</code>. Can anyone help with that?</p>