text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df_district = pd.read_csv('../input/learnplatform-covid19-impact-on-digital-learning/districts_info.csv')

df_district.isnull().sum()

df_district.columns

df_district.shape

df_district.dtypes

df_district = df_district.drop_duplicates()

plt.xticks(rotation=60)

fig, ax  = plt.subplots(figsize=(12, 6))
fig.suptitle('Locale Distribution', size = 20)
explode = (0.04, 0.04, 0.04, 0.04)
labels = list(df_district.locale.value_counts().index)
sizes = df_district.locale.value_counts().values
ax.pie(sizes, explode=explode,startangle=60, labels=labels, shadow= True)
ax.add_artist(plt.Circle((0,0),0.4,fc='white'))
plt.show()

df_products = pd.read_csv('../input/learnplatform-covid19-impact-on-digital-learning/products_info.csv')

c1 = c2 = c3 = 0
for s in df_products['Sector(s)']:
    if not pd.isnull(s):
        s = s.split(';')
        for i in range(len(s)):
            sub = s[i].strip()
            if sub == 'PreK-12':
                c1 += 1
            if sub == 'Higher Ed':
                c2 += 1
            if sub == 'Corporate':
                c3 += 1
fig, ax = plt.subplots(figsize=(16, 8))
fig.suptitle('Sector Distribution', size=20)
explode = (0.05, 0.05, 0.05)
labels = ['PreK-12', 'Higher Ed', 'Corporate']
sizes = [c1, c2, c3]
ax.pie(sizes, explode=explode, startangle=60, labels=labels)
ax.add_artist(plt.Circle((0, 0), 0.4, fc='white'))
plt.show()